WoomaTaurus.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. using System.Drawing;
  2. using Server.MirDatabase;
  3. using Server.MirEnvir;
  4. namespace Server.MirObjects.Monsters
  5. {
  6. public class WoomaTaurus : FlamingWooma
  7. {
  8. private long _teleTime, _madTime;
  9. private const long TeleDelay = 10000;
  10. private byte _stage = 7;
  11. protected internal WoomaTaurus(MonsterInfo info)
  12. : base(info)
  13. {
  14. }
  15. protected override void ProcessAI()
  16. {
  17. if (Dead) return;
  18. if (_madTime > 0 && Envir.Time > _madTime)
  19. {
  20. _madTime = 0;
  21. RefreshAll();
  22. }
  23. if (Envir.Time > _teleTime)
  24. {
  25. _teleTime = Envir.Time + TeleDelay;
  26. int count = 0;
  27. MirDirection dir = Direction;
  28. for (int i = 0; i < 8; i++)
  29. {
  30. Point location = Functions.PointMove(CurrentLocation, dir, 1);
  31. if (CurrentMap.ValidPoint(location))
  32. {
  33. Cell cell = CurrentMap.GetCell(location);
  34. if (cell.Objects == null) continue;
  35. for (int o = 0; o < cell.Objects.Count; o++)
  36. {
  37. if (!cell.Objects[o].Blocking) continue;
  38. count++;
  39. break;
  40. }
  41. }
  42. else count++;
  43. dir = Functions.NextDir(dir);
  44. }
  45. if (count >= 5)
  46. {
  47. Target = null;
  48. TeleportRandom(4, 0);
  49. }
  50. }
  51. if (Stats[Stat.HP] >= 7)
  52. {
  53. byte stage = (byte)(HP / (Stats[Stat.HP] / 7));
  54. if (stage < _stage)
  55. {
  56. _madTime = Envir.Time + 8000;
  57. MoveSpeed = 400;
  58. AttackSpeed = 500;
  59. }
  60. _stage = stage;
  61. }
  62. base.ProcessAI();
  63. }
  64. }
  65. }