ZumaTaurus.cs 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. using Server.MirDatabase;
  2. using S = ServerPackets;
  3. namespace Server.MirObjects.Monsters
  4. {
  5. public class ZumaTaurus : ZumaMonster
  6. {
  7. private byte _stage = 7;
  8. protected internal ZumaTaurus(MonsterInfo info) : base(info)
  9. {
  10. Direction = MirDirection.DownLeft;
  11. AvoidFireWall = false;
  12. }
  13. protected override void ProcessAI()
  14. {
  15. if (Dead) return;
  16. if (Stats[Stat.HP] >= 7)
  17. {
  18. byte stage = (byte)(HP / (Stats[Stat.HP] / 7));
  19. if (stage < _stage) SpawnSlaves();
  20. _stage = stage;
  21. }
  22. base.ProcessAI();
  23. }
  24. protected override void Attack()
  25. {
  26. if (!Target.IsAttackTarget(this))
  27. {
  28. Target = null;
  29. return;
  30. }
  31. ShockTime = 0;
  32. Direction = Functions.DirectionFromPoint(CurrentLocation, Target.CurrentLocation);
  33. Broadcast(new S.ObjectAttack { ObjectID = ObjectID, Direction = Direction, Location = CurrentLocation });
  34. ActionTime = Envir.Time + 300;
  35. AttackTime = Envir.Time + AttackSpeed;
  36. int damage = GetAttackPower(Stats[Stat.MinDC], Stats[Stat.MaxDC]);
  37. if (damage == 0) return;
  38. DelayedAction action = new DelayedAction(DelayedType.Damage, Envir.Time + 300, Target, damage, DefenceType.MACAgility);
  39. ActionList.Add(action);
  40. }
  41. private void SpawnSlaves()
  42. {
  43. int count = Math.Min(8, 40 - SlaveList.Count);
  44. for (int i = 0; i < count; i++)
  45. {
  46. MonsterObject mob = null;
  47. switch (Envir.Random.Next(7))
  48. {
  49. case 0:
  50. mob = GetMonster(Envir.GetMonsterInfo(Settings.Zuma1));
  51. break;
  52. case 1:
  53. mob = GetMonster(Envir.GetMonsterInfo(Settings.Zuma2));
  54. break;
  55. case 2:
  56. mob = GetMonster(Envir.GetMonsterInfo(Settings.Zuma3));
  57. break;
  58. case 3:
  59. mob = GetMonster(Envir.GetMonsterInfo(Settings.Zuma4));
  60. break;
  61. case 4:
  62. mob = GetMonster(Envir.GetMonsterInfo(Settings.Zuma5));
  63. break;
  64. case 5:
  65. mob = GetMonster(Envir.GetMonsterInfo(Settings.Zuma6));
  66. break;
  67. case 6:
  68. mob = GetMonster(Envir.GetMonsterInfo(Settings.Zuma7));
  69. break;
  70. }
  71. if (mob == null) continue;
  72. if (!mob.Spawn(CurrentMap, Front))
  73. mob.Spawn(CurrentMap, CurrentLocation);
  74. mob.Target = Target;
  75. mob.ActionTime = Envir.Time + 2000;
  76. SlaveList.Add(mob);
  77. }
  78. }
  79. }
  80. }