GlacierSnail.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using Server.MirDatabase;
  2. using Server.MirEnvir;
  3. using S = ServerPackets;
  4. namespace Server.MirObjects.Monsters
  5. {
  6. public class GlacierSnail : MonsterObject
  7. {
  8. protected internal GlacierSnail(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. ActionTime = Envir.Time + 300;
  20. AttackTime = Envir.Time + AttackSpeed;
  21. ShockTime = 0;
  22. int damage = GetAttackPower(Stats[Stat.MinDC], Stats[Stat.MaxDC]);
  23. if (damage == 0) return;
  24. if (Envir.Random.Next(5) != 0)
  25. {
  26. Direction = Functions.DirectionFromPoint(CurrentLocation, Target.CurrentLocation);
  27. Broadcast(new S.ObjectAttack { ObjectID = ObjectID, Direction = Direction, Location = CurrentLocation });
  28. DelayedAction action = new DelayedAction(DelayedType.Damage, Envir.Time + 300, Target, damage, DefenceType.ACAgility);
  29. ActionList.Add(action);
  30. }
  31. else
  32. {
  33. Direction = Functions.DirectionFromPoint(CurrentLocation, Target.CurrentLocation);
  34. Broadcast(new S.ObjectAttack { ObjectID = ObjectID, Direction = Direction, Location = CurrentLocation, Type = 1 });
  35. DelayedAction action1 = new DelayedAction(DelayedType.Damage, Envir.Time + 350, Target, damage, DefenceType.ACAgility);
  36. ActionList.Add(action1);
  37. DelayedAction action2 = new DelayedAction(DelayedType.Damage, Envir.Time + 550, Target, damage, DefenceType.ACAgility);
  38. ActionList.Add(action2);
  39. DelayedAction action3 = new DelayedAction(DelayedType.Damage, Envir.Time + 750, Target, damage, DefenceType.ACAgility);
  40. ActionList.Add(action3);
  41. }
  42. }
  43. }
  44. }