HellPirate.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using Server.MirDatabase;
  2. using Server.MirEnvir;
  3. using S = ServerPackets;
  4. namespace Server.MirObjects.Monsters
  5. {
  6. public class HellPirate : MonsterObject
  7. {
  8. protected internal HellPirate(MonsterInfo info)
  9. : base(info)
  10. {
  11. }
  12. protected override void Attack()
  13. {
  14. if (!Target.IsAttackTarget(this))
  15. {
  16. Target = null;
  17. return;
  18. }
  19. Direction = Functions.DirectionFromPoint(CurrentLocation, Target.CurrentLocation);
  20. if (Envir.Random.Next(3) > 0)
  21. {
  22. Broadcast(new S.ObjectAttack { ObjectID = ObjectID, Direction = Direction, Location = CurrentLocation, Type = 0 });
  23. base.Attack();
  24. }
  25. else
  26. {
  27. Broadcast(new S.ObjectAttack { ObjectID = ObjectID, Direction = Direction, Location = CurrentLocation, Type = 1 });
  28. int damage = GetAttackPower(Stats[Stat.MinDC], Stats[Stat.MaxDC]);
  29. if (damage == 0) return;
  30. FullmoonAttack(damage);
  31. }
  32. ShockTime = 0;
  33. ActionTime = Envir.Time + 300;
  34. AttackTime = Envir.Time + AttackSpeed;
  35. }
  36. }
  37. }