YinDevilNode.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using Server.MirDatabase;
  2. using S = ServerPackets;
  3. namespace Server.MirObjects.Monsters
  4. {
  5. public class YinDevilNode : MonsterObject
  6. {
  7. protected override bool CanMove { get { return false; } }
  8. protected internal YinDevilNode(MonsterInfo info)
  9. : base(info)
  10. {
  11. }
  12. public override void Turn(MirDirection dir)
  13. {
  14. }
  15. public override bool Walk(MirDirection dir) { return false; }
  16. protected override void ProcessRoam() { }
  17. protected override void CompleteAttack(IList<object> data)
  18. {
  19. List<MapObject> targets = FindAllTargets(7, CurrentLocation);
  20. if (targets.Count == 0) return;
  21. for (int i = 0; i < targets.Count; i++)
  22. {
  23. Target = targets[i];
  24. if (Target == null || !Target.IsFriendlyTarget(this) || Target.CurrentMap != CurrentMap || Target.Node == null) continue;
  25. BuffType type = Info.AI == 41 ? BuffType.BlessedArmour : BuffType.UltimateEnhancer;
  26. var stats = new Stats
  27. {
  28. [type == BuffType.BlessedArmour ? Stat.MaxAC : Stat.MaxDC] = Target.Level / 7 + 4
  29. };
  30. Target.AddBuff(type, this, Settings.Second * 5, stats);
  31. Target.OperateTime = 0;
  32. }
  33. }
  34. protected override void ProcessTarget()
  35. {
  36. if (!CanAttack) return;
  37. if (!FindFriendsNearby(7)) return;
  38. ShockTime = 0;
  39. Broadcast(new S.ObjectAttack { ObjectID = ObjectID, Direction = Direction, Location = CurrentLocation });
  40. ActionList.Add(new DelayedAction(DelayedType.Damage, Envir.Time + 500));
  41. ActionTime = Envir.Time + 300;
  42. AttackTime = Envir.Time + AttackSpeed;
  43. }
  44. }
  45. }