| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- using Server.MirDatabase;
- using Server.MirEnvir;
- using S = ServerPackets;
- namespace Server.MirObjects.Monsters
- {
- class PurpleFaeFlower : ZumaMonster
- {
- protected override bool CanMove { get { return false; } }
- protected internal PurpleFaeFlower(MonsterInfo info)
- : base(info)
- {
- }
- protected override bool InAttackRange()
- {
- return CurrentMap == Target.CurrentMap && CanFly(Target.CurrentLocation) && Functions.InRange(CurrentLocation, Target.CurrentLocation, Info.ViewRange);
- // ADDED CANFLY SO THAT PROJECTILE MOBS CANNOT SHOOT THROUGH WALLS
- }
- protected override void Attack()
- {
- if (!Target.IsAttackTarget(this))
- {
- Target = null;
- return;
- }
- ActionTime = Envir.Time + 300;
- AttackTime = Envir.Time + AttackSpeed;
- int damage = GetAttackPower(Stats[Stat.MinDC], Stats[Stat.MaxDC]);
- ShockTime = 0;
- Direction = Functions.DirectionFromPoint(CurrentLocation, Target.CurrentLocation);
- bool ranged = CurrentLocation == Target.CurrentLocation || !Functions.InRange(CurrentLocation, Target.CurrentLocation, 1);
- if (!ranged)
- {
- Broadcast(new S.ObjectAttack { ObjectID = ObjectID, Direction = Direction, Location = CurrentLocation });
- if (damage == 0) return;
- DelayedAction action = new DelayedAction(DelayedType.Damage, Envir.Time + 300, Target, damage, DefenceType.AC);
- ActionList.Add(action);
- }
- else
- {
- Broadcast(new S.ObjectRangeAttack { ObjectID = ObjectID, Direction = Direction, Location = CurrentLocation, TargetID = Target.ObjectID, Type = 0 });
- AttackTime = Envir.Time + AttackSpeed + 500;
- if (damage == 0) return;
- int delay = Functions.MaxDistance(CurrentLocation, Target.CurrentLocation) * 50 + 500; //50 MS per Step
- DelayedAction action = new DelayedAction(DelayedType.Damage, Envir.Time + delay, Target, damage, DefenceType.MAC);
- ActionList.Add(action);
- }
- }
- public override bool Walk(MirDirection dir) { return false; }
- protected override void ProcessRoam() { }
- }
- }
|