BoulderSpirit.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using Server.MirDatabase;
  2. using Server.MirEnvir;
  3. namespace Server.MirObjects.Monsters
  4. {
  5. public class BoulderSpirit : MonsterObject
  6. {
  7. protected override bool CanMove { get { return false; } }
  8. protected override bool CanAttack { get { return false; } }
  9. protected override bool CanRegen { get { return false; } }
  10. protected internal BoulderSpirit(MonsterInfo info)
  11. : base(info)
  12. {
  13. }
  14. public override bool Walk(MirDirection dir)
  15. {
  16. return false;
  17. }
  18. protected override void ProcessAI()
  19. {
  20. if (Dead) return;
  21. var targets = FindAllTargets(Info.ViewRange, CurrentLocation, true);
  22. if (targets.Count > 0)
  23. {
  24. Die();
  25. }
  26. }
  27. public override void Die()
  28. {
  29. ActionList.Add(new DelayedAction(DelayedType.Die, Envir.Time + 300));
  30. base.Die();
  31. }
  32. protected override void CompleteDeath(IList<object> data)
  33. {
  34. var targets = FindAllTargets(Info.ViewRange, CurrentLocation, false);
  35. if (targets.Count == 0) return;
  36. for (int i = 0; i < targets.Count; i++)
  37. {
  38. int damage = GetAttackPower(Stats[Stat.MinDC], Stats[Stat.MaxDC]);
  39. if (damage == 0) return;
  40. if (targets[i].Attacked(this, damage, DefenceType.ACAgility) <= 0) continue;
  41. }
  42. }
  43. }
  44. }