ArmadilloElder.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using Server.MirDatabase;
  2. using Server.MirEnvir;
  3. using S = ServerPackets;
  4. namespace Server.MirObjects.Monsters
  5. {
  6. public class ArmadilloElder : Armadillo
  7. {
  8. protected internal ArmadilloElder(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. ShockTime = 0;
  20. Direction = Functions.DirectionFromPoint(CurrentLocation, Target.CurrentLocation);
  21. ActionTime = Envir.Time + 300;
  22. AttackTime = Envir.Time + AttackSpeed;
  23. switch (Envir.Random.Next(0, 6))
  24. {
  25. case 0:
  26. {
  27. Retreat();
  28. _runAway = true;
  29. }
  30. break;
  31. case 1:
  32. {
  33. Broadcast(new S.ObjectAttack { ObjectID = ObjectID, Direction = Direction, Location = CurrentLocation, Type = 1 });
  34. int damage = GetAttackPower(Stats[Stat.MinDC], Stats[Stat.MaxDC]);
  35. if (damage == 0) return;
  36. Target.Pushed(this, Direction, 2);
  37. }
  38. break;
  39. default:
  40. {
  41. Broadcast(new S.ObjectAttack { ObjectID = ObjectID, Direction = Direction, Location = CurrentLocation });
  42. int damage = GetAttackPower(Stats[Stat.MinDC], Stats[Stat.MaxDC]) * 2;
  43. if (damage == 0) return;
  44. DelayedAction action = new DelayedAction(DelayedType.Damage, Envir.Time + 400, Target, damage, DefenceType.ACAgility);
  45. ActionList.Add(action);
  46. }
  47. break;
  48. }
  49. }
  50. protected override void CompleteRangeAttack(IList<object> data)
  51. {
  52. //Retreat attack does no damage
  53. }
  54. }
  55. }