protected override void SetDeath(Unit killer)
        {
            if (Spawn.DoorId == 0)
            {
                if (Spawn.AllowVfxUpdate == 1)
                {
                    UpdateVfxState(1);
                }
                else
                {
                    IsActive = false;
                }
            }
            else
            {
                OpenDoor(false);
            }

            // I'm ashamed by the way I fixed it...
            if (Name != "Keep Door" && Entry != 100 && Respawn == 1)
            {
                SetRespawnTimer();
            }

            if (this.IsAttackable == 1 && this.Spawn.Proto.CreatureId != 0)
            {
                SpawnNPCFromGO();
            }

            base.SetDeath(killer);

            AiInterface.ProcessCombatEnd();
        }
Esempio n. 2
0
        protected override void SetDeath(Unit killer)
        {
            Health = 0;

            States.Add((byte)CreatureState.Dead);

            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);
            }

            AiInterface.ProcessCombatEnd();

            SetRespawnTimer();

            EvtInterface.RemoveEventNotify(EventName.OnReceiveDamage, OnReceiveDamage);

            if (!FlagGuard.Info.KeepLord)
            {
                _keep.OnKeepNpcAttacked(0);
                return;
            }

            /*Log.Info(_keep.Info.Name, (_keep.Realm == Realms.REALMS_REALM_ORDER ? "Order" : "Destruction") + " keep lord slain by " + killer.Name + " of " + (killer.Realm == Realms.REALMS_REALM_ORDER ? "Order" : "Destruction"));*/

            if (_keep.Realm == killer.Realm)
            {
                /*if (FlagGuard.Info.KeepLord)
                 *  Log.Info(_keep.Info.Name, (_keep.Realm == Realms.REALMS_REALM_ORDER ? "Order" : "Destruction") + " keep lord respawned.");*/
                _logger.Debug($"Kill request from own realm {killer.Name} {_keep.Realm}");
                FlagGuard.Creature = new KeepCreature(Spawn, FlagGuard, _keep);
                Region.AddObject(FlagGuard.Creature, Spawn.ZoneId);
                Destroy();
            }
            else
            {
                _keep.OnLordKilled();
            }
        }
Esempio n. 3
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;
            }
        }