| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- using Server.MirDatabase;
- using Server.MirEnvir;
- using S = ServerPackets;
- namespace Server.MirObjects.Monsters
- {
- public class HellSlasher : MonsterObject
- {
- protected internal HellSlasher(MonsterInfo info)
- : base(info)
- {
- }
- protected override void Attack()
- {
- if (!Target.IsAttackTarget(this))
- {
- Target = null;
- return;
- }
-
- Direction = Functions.DirectionFromPoint(CurrentLocation, Target.CurrentLocation);
- if (Envir.Random.Next(3) > 0)
- {
- Broadcast(new S.ObjectAttack { ObjectID = ObjectID, Direction = Direction, Location = CurrentLocation, Type = 0 });
- 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, false);
- ActionList.Add(action);
- }
- else
- {
- Broadcast(new S.ObjectAttack { ObjectID = ObjectID, Direction = Direction, Location = CurrentLocation, Type = 1 });
- int damage = GetAttackPower(Stats[Stat.MinDC], Stats[Stat.MaxDC]);
- if (damage == 0) return;
- HalfmoonAttack(damage, 500, DefenceType.AC);
- }
- ShockTime = 0;
- ActionTime = Envir.Time + 300;
- AttackTime = Envir.Time + AttackSpeed;
- }
- protected override void CompleteAttack(IList<object> data)
- {
- MapObject target = (MapObject)data[0];
- int damage = (int)data[1];
- DefenceType defence = (DefenceType)data[2];
- bool poison = data.Count < 4 || (bool)data[3];
- if (target == null || !target.IsAttackTarget(this) || target.CurrentMap != CurrentMap || target.Node == null) return;
- if (target.Attacked(this, damage, defence) <= 0) return;
- if (poison)
- {
- PoisonTarget(target, 5, Envir.Random.Next(1, 4), PoisonType.Dazed, 1000);
- }
- }
- }
- }
|