| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- using Server.MirDatabase;
- using Server.MirEnvir;
- using S = ServerPackets;
- namespace Server.MirObjects.Monsters
- {
- public class ShamanZombie : MonsterObject
- {
- protected internal ShamanZombie(MonsterInfo info)
- : base(info)
- {
- }
- protected override bool InAttackRange()
- {
- if (Target.CurrentMap != CurrentMap) return false;
- if (Target.CurrentLocation == CurrentLocation) return false;
- int x = Math.Abs(Target.CurrentLocation.X - CurrentLocation.X);
- int y = Math.Abs(Target.CurrentLocation.Y - CurrentLocation.Y);
- if (x > 6 || y > 6) return false;
- return (x == 0) || (y == 0) || (x == y);
- }
- protected override void Attack()
- {
- ShockTime = 0;
- if (!Target.IsAttackTarget(this))
- {
- Target = null;
- return;
- }
- AttackTime = Envir.Time + AttackSpeed;
- ActionTime = Envir.Time + 300;
- Direction = Functions.DirectionFromPoint(CurrentLocation, Target.CurrentLocation);
- Broadcast(new S.ObjectRangeAttack { ObjectID = ObjectID, Direction = Direction, Location = CurrentLocation });
- int damage = GetAttackPower(Stats[Stat.MinDC], Stats[Stat.MaxDC]);
- if (damage == 0) return;
- LineAttack(damage, 6, 300, DefenceType.MACAgility);
- }
- protected override void ProcessTarget()
- {
- if (Target == null) return;
- if (InAttackRange() && CanAttack)
- {
- Attack();
- if (Target.Dead)
- FindTarget();
- return;
- }
- if (Envir.Time < ShockTime)
- {
- Target = null;
- return;
- }
- MoveTo(Target.CurrentLocation);
- }
- }
- }
|