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();
        }
示例#2
0
        private void PropagateFoe()
        {
            int addedThisTick = 0;

            if (_otherPendingTargetList.Count > 0)
            {
                lock (_otherPendingTargetList)
                {
                    foreach (NewBuff buff in _otherPendingTargetList)
                    {
                        _otherTargetList.Add(buff.Target, new AuraInfo(buff, _passNum));
                    }

                    _otherPendingTargetList.Clear();
                }
            }

            foreach (Object obj in Target.ObjectsInRange)
            {
                Unit foe = obj as Unit;

                if (foe == null || foe.IsInvulnerable)
                {
                    continue;
                }

                if (!Target.IsDead && foe.ObjectWithinRadiusFeet(Target, MaxFoeRadius - 10) && CombatInterface.CanAttack(Caster, foe) && ((Caster is Creature) || (!(foe is Player) || foe.CbtInterface.IsPvp)) && Target.LOSHit(foe))
                {
                    if (_otherTargetList.ContainsKey(foe))
                    {
                        if (_otherTargetList[foe].Buff.BuffHasExpired)
                        {
                            _otherTargetList.Remove(foe);
                        }
                        else
                        {
                            _otherTargetList[foe].PassNum = _passNum;
                        }
                        continue;
                    }

                    if (addedThisTick + _otherTargetList.Count == 9)
                    {
                        continue;
                    }

                    if (Duration == 0)
                    {
                        foe.BuffInterface.QueueBuff(new BuffQueueInfo(Caster, BuffLevel, AbilityMgr.GetBuffInfo(_buffInfo.Entry, Caster, foe), RegisterOtherBuff));
                    }
                    else
                    {
                        BuffInfo BI = AbilityMgr.GetBuffInfo(_buffInfo.Entry, Caster, foe);
                        BI.IsAoE    = true;
                        BI.Duration = Math.Max((ushort)1, (ushort)(RemainingTimeMs * 0.001f));
                        foe.BuffInterface.QueueBuff(new BuffQueueInfo(Caster, BuffLevel, BI, RegisterOtherBuff));
                    }

                    ++addedThisTick;
                }

                else
                {
                    if (!_otherTargetList.ContainsKey(foe))
                    {
                        continue;
                    }

                    // Group member out of range - finish the buff and remove them
                    if (!_otherTargetList[foe].Buff.BuffHasExpired)
                    {
                        _otherTargetList[foe].Buff.BuffHasExpired = true;
                    }

                    _otherTargetList.Remove(foe);
                }
            }


            List <Unit> oldUnits = _otherTargetList.Keys.ToList();

            // Remove any units not refreshed on this tick
            foreach (Unit oldfoe in oldUnits)
            {
                if (_otherTargetList[oldfoe].PassNum == _passNum)
                {
                    continue;
                }

                _otherTargetList[oldfoe].Buff.BuffHasExpired = true;
                _otherTargetList.Remove(oldfoe);
            }
        }