AssassinBird.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. using Server.MirDatabase;
  2. using S = ServerPackets;
  3. namespace Server.MirObjects.Monsters
  4. {
  5. public class AssassinBird : MonsterObject
  6. {
  7. protected internal AssassinBird(MonsterInfo info)
  8. : base(info)
  9. {
  10. }
  11. protected override void Attack()
  12. {
  13. if (!Target.IsAttackTarget(this))
  14. {
  15. Target = null;
  16. return;
  17. }
  18. ShockTime = 0;
  19. Direction = Functions.DirectionFromPoint(CurrentLocation, Target.CurrentLocation);
  20. ActionTime = Envir.Time + 300;
  21. AttackTime = Envir.Time + AttackSpeed;
  22. if (Envir.Random.Next(9) > 0)
  23. {
  24. if (Envir.Random.Next(4) > 0)
  25. {
  26. Broadcast(new S.ObjectAttack { ObjectID = ObjectID, Direction = Direction, Location = CurrentLocation, Type = 0 });
  27. int damage = GetAttackPower(Stats[Stat.MinDC], Stats[Stat.MaxDC]);
  28. if (damage == 0) return;
  29. DelayedAction action = new DelayedAction(DelayedType.Damage, Envir.Time + 400, Target, damage, DefenceType.ACAgility);
  30. ActionList.Add(action);
  31. }
  32. else
  33. {
  34. Broadcast(new S.ObjectAttack { ObjectID = ObjectID, Direction = Direction, Location = CurrentLocation, Type = 1 });
  35. int damage = GetAttackPower(Stats[Stat.MinMC], Stats[Stat.MaxMC]);
  36. if (damage == 0) return;
  37. DelayedAction action = new DelayedAction(DelayedType.Damage, Envir.Time + 700, Target, damage, DefenceType.ACAgility);
  38. ActionList.Add(action);
  39. }
  40. }
  41. else
  42. {
  43. Broadcast(new S.ObjectAttack { ObjectID = ObjectID, Direction = Direction, Location = CurrentLocation, Type = 2 });
  44. int damage = GetAttackPower(Stats[Stat.MinDC], Stats[Stat.MaxDC]);
  45. SinglePushAttack(damage, delay: 500);
  46. }
  47. }
  48. }
  49. }