BugBagMaggot.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using Server.MirDatabase;
  2. using S = ServerPackets;
  3. namespace Server.MirObjects.Monsters
  4. {
  5. public class BugBagMaggot : MonsterObject
  6. {
  7. protected override bool CanMove { get { return false; } }
  8. protected internal BugBagMaggot(MonsterInfo info) : base(info)
  9. {
  10. Direction = MirDirection.Up;
  11. }
  12. public override void Turn(MirDirection dir)
  13. {
  14. }
  15. public override bool Walk(MirDirection dir) { return false; }
  16. protected override bool InAttackRange()
  17. {
  18. return CurrentMap == Target.CurrentMap && Functions.InRange(CurrentLocation, Target.CurrentLocation, Globals.DataRange);
  19. }
  20. protected override void Attack()
  21. {
  22. ShockTime = 0;
  23. if (!Target.IsAttackTarget(this))
  24. {
  25. Target = null;
  26. return;
  27. }
  28. if (SlaveList.Count >= 20) return;
  29. MonsterObject spawn = GetMonster(Envir.GetMonsterInfo(Settings.BugBatName));
  30. if (spawn == null) return;
  31. Broadcast(new S.ObjectAttack { ObjectID = ObjectID, Direction = Direction, Location = CurrentLocation });
  32. ActionTime = Envir.Time + 300;
  33. AttackTime = Envir.Time + 3000;
  34. spawn.Target = Target;
  35. spawn.ActionTime = Envir.Time + 1000;
  36. CurrentMap.ActionList.Add(new DelayedAction(DelayedType.Spawn, Envir.Time + 500, spawn, CurrentLocation, this));
  37. }
  38. protected override void ProcessRoam() { }
  39. }
  40. }