DragonWarrior.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. using Server.MirDatabase;
  2. using Server.MirEnvir;
  3. using S = ServerPackets;
  4. namespace Server.MirObjects.Monsters
  5. {
  6. public class DragonWarrior : MonsterObject
  7. {
  8. protected internal DragonWarrior(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. Direction = Functions.DirectionFromPoint(CurrentLocation, Target.CurrentLocation);
  23. if (Envir.Random.Next(5) > 0)
  24. {
  25. if (Envir.Random.Next(3) > 0)
  26. {
  27. base.Attack();
  28. }
  29. else
  30. {
  31. Broadcast(new S.ObjectAttack { ObjectID = ObjectID, Direction = Direction, Location = CurrentLocation, Type = 1 });
  32. int damage = GetAttackPower(Stats[Stat.MinDC], Stats[Stat.MaxDC]);
  33. if (damage == 0) return;
  34. HalfmoonAttack(damage);
  35. }
  36. }
  37. else
  38. {
  39. Broadcast(new S.ObjectAttack { ObjectID = ObjectID, Direction = Direction, Location = CurrentLocation, Type = 2 });
  40. //Shield Bash Attack
  41. int damage = GetAttackPower(Stats[Stat.MinDC], Stats[Stat.MaxDC]);
  42. SinglePushAttack(damage);
  43. //TODO - Delay
  44. PoisonTarget(Target, 3, 5, PoisonType.Dazed);
  45. }
  46. }
  47. }
  48. }