public virtual void Initialize(Unit caster, Unit target, ushort buffId, byte buffLevel, byte stackLevel, BuffInfo myBuffInfo, BuffInterface parentInterface)
        {
            Caster         = caster;
            Target         = target;
            _buffInfo      = myBuffInfo;
            StackLevel     = stackLevel;
            BuffLevel      = buffLevel;
            BuffId         = buffId;
            _buffInterface = parentInterface;

            uint leadMs = 0;

            // Fixed lead-in (Oil channel)
            if (_buffInfo.LeadInDelay < 0)
            {
                leadMs = (uint)-_buffInfo.LeadInDelay;
            }
            // Variable lead-in with range (Rapid Fire channel)
            else if (_buffInfo.LeadInDelay > 0)
            {
                leadMs = (uint)(_buffInfo.LeadInDelay * Caster.GetDistanceTo(Target) * 0.01f);
            }

            NextTickTime = TCPManager.GetTimeStampMS() + _buffInfo.Interval + leadMs;

            if (Duration > 0)
            {
                DurationMs = (uint)(_buffInfo.Duration * 1000 + leadMs);
                EndTime    = TCPManager.GetTimeStampMS() + DurationMs;
            }
        }
        public override void Update(long tick)
        {
            if (PendingDisposal)
            {
                Dispose();
                return;
            }

            BuffInterface.Update(tick);
            EvtInterface.Update(tick);
        }
Beispiel #3
0
        protected override void SetDeath(Unit killer)
        {
            Health = 0;

            PacketOut Out = new PacketOut((byte)Opcodes.F_OBJECT_DEATH, 12);

            Out.WriteUInt16(Oid);
            Out.WriteByte(1);
            Out.WriteByte(0);
            Out.WriteUInt16(killer.IsPet() ? killer.GetPet().Owner.Oid : killer.Oid);
            Out.Fill(0, 6);
            DispatchPacket(Out, true);

            AbtInterface.Cancel(true);
            ScrInterface.OnDie(this);
            BuffInterface.RemoveBuffsOnDeath();

            EvtInterface.Notify(EventName.OnDie, this, killer);

            Pet    pet      = killer as Pet;
            Player credited = (pet != null) ? pet.Owner : (killer as Player);

            if (credited != null)
            {
                HandleDeathRewards(credited);
            }

            ClearTrackedDamage();

            _buildState = EConstructionState.Destroying;

            foreach (Player plr in _interactors)
            {
                plr.Palisade = null;
            }

            _interactors.Clear();

            foreach (NewBuff buff in _interactionBuffs)
            {
                buff.BuffHasExpired = true;
            }

            _interactionBuffs.Clear();

            GroundTarget gt = new GroundTarget(_constructor, new Point3D(WorldPosition), GameObjectService.GetGameObjectProto(23));

            Region.AddObject(gt, Zone.ZoneId);

            gt.BuffInterface.QueueBuff(new BuffQueueInfo(_constructor, 40, AbilityMgr.GetBuffInfo(23762)));

            gt.SetExpiry(TCPManager.GetTimeStampMS() + 5000);
        }
Beispiel #4
0
        public override void Update(long tick)
        {
            if (!_hasExploded && tick > _nextCheckInterval)
            {
                foreach (var obj in ObjectsInRange)
                {
                    Unit victim = obj as Unit;

                    if (victim == null || victim.IsDead)
                    {
                        continue;
                    }

                    if (!(victim is Player) && !(victim is Creature))
                    {
                        continue;
                    }

                    if (victim.Realm != Owner.Realm && ObjectWithinRadiusFeet(victim, 30))
                    {
                        BuffInterface.NotifyCombatEvent((byte)BuffCombatEvents.Manual, null, victim);

                        _hasExploded = true;
                        return;
                    }
                }

                _nextCheckInterval = tick + 1000;
            }

            if (PendingDisposal)
            {
                Dispose();
                return;
            }

            BuffInterface.Update(tick);
            EvtInterface.Update(tick);
        }
Beispiel #5
0
        protected override void SetDeath(Unit killer)
        {
            Health = 0;

            States.Add((byte)CreatureState.Dead); // Death State

            PacketOut Out = new PacketOut((byte)Opcodes.F_OBJECT_DEATH, 12);

            Out.WriteUInt16(Oid);
            Out.WriteByte(1);
            Out.WriteByte(0);
            Out.WriteUInt16(killer.IsPet() ? killer.GetPet().Owner.Oid : killer.Oid);
            Out.Fill(0, 6);
            DispatchPacket(Out, true);

            AbtInterface.Cancel(true);
            ScrInterface.OnDie(this);

            BuffInterface.RemoveBuffsOnDeath();

            EvtInterface.Notify(EventName.OnDie, this, killer);

            AiInterface.ProcessCombatEnd();

            EvtInterface.AddEvent(RezUnit, 10000, 1); // Clear the object in 10 seconds.

            if (_ownerUILinked)
            {
                SendPetRemove(true);

                IPetCareerInterface petInterface = Owner.CrrInterface as IPetCareerInterface;

                petInterface?.Notify_PetDown();

                _ownerUILinked = false;
            }
        }
Beispiel #6
0
 public override void Initialize(Unit caster, Unit target, ushort buffId, byte buffLevel, byte stackLevel, BuffInfo myBuffInfo, BuffInterface parentInterface)
 {
     base.Initialize(caster, target, buffId, buffLevel, stackLevel, myBuffInfo, parentInterface);
     previousPlayers.Add(target);
 }
Beispiel #7
0
        public override void Initialize(Unit caster, Unit target, ushort buffId, byte buffLevel, byte stackLevel, BuffInfo myBuffInfo, BuffInterface parentInterface)
        {
            base.Initialize(caster, target, buffId, buffLevel, stackLevel, myBuffInfo, parentInterface);

            _myPlayer = caster as Player;

            switch (_buffInfo.AuraPropagation)
            {
            case "Group":
                _groupTargetList        = new Dictionary <Unit, NewBuff>();
                _groupPendingTargetList = new List <NewBuff>();
                break;

            case "Foe":
            case "Foe20":
            case "Foe30":
            case "Foe40":
            case "Foe250":
                _otherTargetList        = new Dictionary <Unit, AuraInfo>();
                _otherPendingTargetList = new List <NewBuff>();
                break;

            case "All":
                _groupTargetList        = new Dictionary <Unit, NewBuff>();
                _groupPendingTargetList = new List <NewBuff>();
                _otherTargetList        = new Dictionary <Unit, AuraInfo>();
                _otherPendingTargetList = new List <NewBuff>();
                break;

            case "HTL":
                _otherTargetList        = new Dictionary <Unit, AuraInfo>();
                _otherPendingTargetList = new List <NewBuff>();
                break;
            }

            _propInterval = Entry == 9251 || Entry == 1927 ? 250 : 1000;
        }