| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- using Server.MirDatabase;
- using Server.MirEnvir;
- using S = ServerPackets;
- namespace Server.MirObjects.Monsters
- {
- public class PlagueCrab : MonsterObject
- {
- protected internal PlagueCrab(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 > 4 || y > 4) return false;
- return (x == 0) || (y == 0) || (x == y);
- }
- protected override void Attack()
- {
- if (!Target.IsAttackTarget(this))
- {
- Target = null;
- return;
- }
- Direction = Functions.DirectionFromPoint(CurrentLocation, Target.CurrentLocation);
- ActionTime = Envir.Time + 300;
- AttackTime = Envir.Time + AttackSpeed + 500;
- ShockTime = 0;
- Broadcast(new S.ObjectAttack { ObjectID = ObjectID, Direction = Direction, Location = CurrentLocation, Type = 0 });
- int damage = GetAttackPower(Stats[Stat.MinDC], Stats[Stat.MaxDC]);
- if (damage == 0) return;
- LineAttack(damage, 4, 500, DefenceType.MACAgility);
- }
- }
- }
|