IncarnatedGhoul.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using Server.MirDatabase;
  2. using S = ServerPackets;
  3. namespace Server.MirObjects.Monsters
  4. {
  5. public class IncarnatedGhoul : MonsterObject
  6. {
  7. protected internal IncarnatedGhoul(MonsterInfo info) : base(info)
  8. {
  9. }
  10. protected override void Attack()
  11. {
  12. if (!Target.IsAttackTarget(this))
  13. {
  14. Target = null;
  15. return;
  16. }
  17. ShockTime = 0;
  18. Direction = Functions.DirectionFromPoint(CurrentLocation, Target.CurrentLocation);
  19. Broadcast(new S.ObjectAttack { ObjectID = ObjectID, Direction = Direction, Location = CurrentLocation });
  20. ActionTime = Envir.Time + 300;
  21. AttackTime = Envir.Time + AttackSpeed;
  22. int damage = GetAttackPower(Stats[Stat.MinDC], Stats[Stat.MaxDC]);
  23. if (damage == 0) return;
  24. DelayedAction action = new DelayedAction(DelayedType.Damage, Envir.Time + 300, Target, damage, DefenceType.ACAgility);
  25. ActionList.Add(action);
  26. }
  27. protected override void CompleteAttack(IList<object> data)
  28. {
  29. MapObject target = (MapObject)data[0];
  30. int damage = (int)data[1];
  31. DefenceType defence = (DefenceType)data[2];
  32. if (target == null || !target.IsAttackTarget(this) || target.CurrentMap != CurrentMap || target.Node == null) return;
  33. if (target.Attacked(this, damage, defence) <= 0) return;
  34. PoisonTarget(target, 15, 5, PoisonType.Paralysis, 1000);
  35. }
  36. }
  37. }