| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- using Server.MirDatabase;
- using Server.MirEnvir;
- using S = ServerPackets;
- namespace Server.MirObjects.Monsters
- {
- public class RedMoonEvil : MonsterObject
- {
- protected override bool CanMove { get { return false; } }
- protected override bool CanRegen { get { return false; } }
- protected internal RedMoonEvil(MonsterInfo info) : base(info)
- {
- Direction = MirDirection.Up;
- ActionTime = Envir.Time + 300;
- AttackTime = Envir.Time + AttackSpeed;
- }
- protected override bool InAttackRange()
- {
- if (Target.CurrentMap != CurrentMap) return false;
- return Target.CurrentLocation != CurrentLocation && Functions.InRange(CurrentLocation, Target.CurrentLocation, Info.ViewRange);
- }
- public override void Turn(MirDirection dir)
- {
- }
- public override bool Walk(MirDirection dir) { return false; }
- protected override void ProcessTarget()
- {
- if (!CanAttack) return;
- List<MapObject> targets = FindAllTargets(Info.ViewRange, CurrentLocation);
- if (targets.Count == 0) return;
- ShockTime = 0;
- Broadcast(new S.ObjectAttack {ObjectID = ObjectID, Direction = Direction, Location = CurrentLocation});
- for (int i = 0; i < targets.Count; i++)
- {
- Target = targets[i];
- Attack();
- }
- ActionTime = Envir.Time + 300;
- AttackTime = Envir.Time + AttackSpeed;
- }
- protected override void Attack()
- {
- int damage = GetAttackPower(Stats[Stat.MinDC], Stats[Stat.MaxDC]);
- if (damage == 0) return;
- DelayedAction action = new DelayedAction(DelayedType.Damage, Envir.Time + 300, Target, damage, DefenceType.ACAgility);
- ActionList.Add(action);
- Broadcast(new S.ObjectEffect{ ObjectID = Target.ObjectID, Effect = SpellEffect.RedMoonEvil});
- }
- }
- }
|