/// <summary> /// Adds a command to the command sequence, linking the previous command's damage information. /// </summary> public void AddCommandToChainWithDamage(AbilityCommandInfo slaveCommand) { if (CommandSequence == 0) { if (NextCommand == null || slaveCommand.CommandSequence == CommandSequence) { NextCommand = slaveCommand; slaveCommand.LastCommand = this; if (DamageInfo != null) { slaveCommand.DamageInfo = DamageInfo.Clone(); } else { slaveCommand.DamageInfo = LastCommand.DamageInfo.Clone(); } } else { NextCommand.AddCommandToChainWithDamage(slaveCommand); } } else { if (slaveCommand.CommandSequence < CommandSequence) { LastCommand.NextCommand = slaveCommand; slaveCommand.LastCommand = LastCommand; LastCommand = slaveCommand; slaveCommand.NextCommand = this; if (slaveCommand.LastCommand.DamageInfo != null) { slaveCommand.DamageInfo = slaveCommand.LastCommand.DamageInfo.Clone(); } } else if (NextCommand == null) { NextCommand = slaveCommand; slaveCommand.LastCommand = this; if (DamageInfo != null) { slaveCommand.DamageInfo = DamageInfo.Clone(); } else { slaveCommand.DamageInfo = LastCommand.DamageInfo.Clone(); } } else { NextCommand.AddCommandToChainWithDamage(slaveCommand); } } }
public override void Update(long tick) { if (tick <= _rezTime) { return; } _slayerChoppa.RezUnit(_slayerChoppa.Realm == Realms.REALMS_REALM_ORDER ? (ushort)1489 : (ushort)1795, 25, true); AbilityDamageInfo damageThisPass = AbilityMgr.GetExtraDamageFor(_slayerChoppa.Realm == Realms.REALMS_REALM_ORDER ? (ushort)1489 : (ushort)1795, 0, 0); List <Object> objects; lock (_slayerChoppa.PlayersInRange) objects = new List <Object>(_slayerChoppa.ObjectsInRange); int count = 0; foreach (Object obj in objects) { Unit unit = obj as Unit; if (unit == null || unit == _slayerChoppa) { continue; } if (unit.ObjectWithinRadiusFeet(_slayerChoppa, 40) && CombatInterface.CanAttack(_slayerChoppa, unit) && _slayerChoppa.LOSHit(unit)) { CombatManager.InflictDamage(damageThisPass.Clone(), _slayerChoppa.AbtInterface.GetMasteryLevelFor(3), _slayerChoppa, unit); } ++count; if (count == 9) { break; } } Dispose(); }
public BuffCommandInfo CloneChain() { BuffCommandInfo cCommandInfo = (BuffCommandInfo)MemberwiseClone(); cCommandInfo.CommandName = (string)CommandName.Clone(); if (DamageInfo != null) { cCommandInfo.DamageInfo = DamageInfo.Clone(); } if (NextCommand != null) { cCommandInfo.NextCommand = NextCommand.CloneChain(); } if (cCommandInfo.NextCommand != null) { cCommandInfo.NextCommand.LastCommand = cCommandInfo; } return(cCommandInfo); }