ArcherGuard.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using Server.MirDatabase;
  2. using S = ServerPackets;
  3. namespace Server.MirObjects.Monsters
  4. {
  5. public class ArcherGuard : Guard
  6. {
  7. protected internal ArcherGuard(MonsterInfo info)
  8. : base(info)
  9. {
  10. }
  11. protected override bool CanMove
  12. {
  13. get { return false; }
  14. }
  15. protected override void Attack()
  16. {
  17. if (!Target.IsAttackTarget(this))
  18. {
  19. Target = null;
  20. return;
  21. }
  22. ShockTime = 0;
  23. Direction = Functions.DirectionFromPoint(CurrentLocation, Target.CurrentLocation);
  24. Broadcast(new S.ObjectRangeAttack { ObjectID = ObjectID, Direction = Direction, Location = CurrentLocation, TargetID = Target.ObjectID });
  25. ActionTime = Envir.Time + 300;
  26. AttackTime = Envir.Time + AttackSpeed;
  27. int damage = GetAttackPower(Stats[Stat.MinDC], Stats[Stat.MaxDC]);
  28. if (Target.Race != ObjectType.Player) damage = int.MaxValue;
  29. if (damage == 0) return;
  30. ProjectileAttack(damage);
  31. }
  32. }
  33. }