void TempSummon::UnSummon(uint32 msTime) { if (msTime) { ForcedUnsummonDelayEvent* pEvent = new ForcedUnsummonDelayEvent(*this); m_Events.AddEvent(pEvent, m_Events.CalculateTime(msTime)); return; } //ASSERT(!isPet()); if (isPet()) { ((Pet*)this)->Remove(PET_SAVE_NOT_IN_SLOT); ASSERT(!IsInWorld()); return; } Unit* owner = GetSummoner(); if (owner && GetEntry() == 30230) // Risen ally { owner->RemoveAurasDueToSpell(62218); owner->RemoveAurasDueToSpell(46619); } if (owner && owner->GetTypeId() == TYPEID_UNIT && owner->ToCreature()->IsAIEnabled) owner->ToCreature()->AI()->SummonedCreatureDespawn(this); AddObjectToRemoveList(); }
void Vehicle::Dismiss() { RemoveAllPassengers(); SendObjectDeSpawnAnim(GetGUID()); CombatStop(); AddObjectToRemoveList(); }
void Totem::UnSummon() { CombatStop(); RemoveAurasDueToSpell(GetSpell()); // clear owner's totem slot for (int i = SUMMON_SLOT_TOTEM; i < MAX_TOTEM_SLOT; ++i) { if (m_owner->m_SummonSlot[i] == GetGUID()) { m_owner->m_SummonSlot[i] = 0; break; } } m_owner->RemoveAurasDueToSpell(GetSpell()); //remove aura all party members too Group *pGroup = NULL; if (m_owner->GetTypeId() == TYPEID_PLAYER) { m_owner->ToPlayer()->SendAutoRepeatCancel(this); // Not only the player can summon the totem (scripted AI) pGroup = m_owner->ToPlayer()->GetGroup(); if (pGroup) { for (GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) { Player* Target = itr->getSource(); if (Target && pGroup->SameSubGroup((Player*) m_owner, Target)) Target->RemoveAurasDueToSpell(GetSpell()); } } } AddObjectToRemoveList(); }
void Totem::UnSummon() { CombatStop(); // clear owner's totem slot for (int i = SUMMON_SLOT_TOTEM; i < MAX_TOTEM_SLOT; ++i) { if (_owner->m_SummonSlot[i] == GetGUID()) { _owner->m_SummonSlot[i] = 0; break; } } //remove aura all party members too if (Player* owner = _owner->ToPlayer()) { owner->SendAutoRepeatCancel(this); if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(GetUInt32Value(UNIT_CREATED_BY_SPELL))) owner->SendCooldownEvent(spell, 0, NULL, false); } AddObjectToRemoveList(); }
void TempSummon::UnSummon(uint32 msTime) { if (msTime) { ForcedUnsummonDelayEvent *pEvent = new ForcedUnsummonDelayEvent(*this); m_Events.AddEvent(pEvent, m_Events.CalculateTime(msTime)); return; } //ASSERT(!isPet()); if (isPet()) { if(((Pet*)this)->getPetType() == HUNTER_PET) ((Pet*)this)->Remove(PET_SAVE_AS_CURRENT); else ((Pet*)this)->Remove(PET_SAVE_NOT_IN_SLOT); ASSERT(!IsInWorld()); return; } Unit* owner = GetSummoner(); if (owner && owner->GetTypeId() == TYPEID_UNIT && owner->ToCreature()->IsAIEnabled) owner->ToCreature()->AI()->SummonedCreatureDespawn(this); AddObjectToRemoveList(); }
void TempSummon::UnSummon(uint32 msTime) { if (msTime) { ForcedUnsummonDelayEvent* pEvent = new ForcedUnsummonDelayEvent(*this); m_Events.AddEvent(pEvent, m_Events.CalculateTime(msTime)); return; } //ASSERT(!isPet()); if (isPet()) { if (ToPet()->getPetType() == HUNTER_PET) ToPet()->Remove(PET_SLOT_ACTUAL_PET_SLOT, false, ToPet()->m_Stampeded); else ToPet()->Remove(PET_SLOT_OTHER_PET, false, ToPet()->m_Stampeded); ASSERT(!IsInWorld()); return; } Unit* owner = GetSummoner(); if (owner && owner->GetTypeId() == TYPEID_UNIT && owner->ToCreature()->IsAIEnabled) owner->ToCreature()->AI()->SummonedCreatureDespawn(this); AddObjectToRemoveList(); }
void TempSummon::UnSummon(uint32 msTime) { if (msTime) { ForcedUnsummonDelayEvent* pEvent = new ForcedUnsummonDelayEvent(*this); m_Events.AddEvent(pEvent, m_Events.CalculateTime(msTime)); return; } //ASSERT(!IsPet()); if (IsPet()) { ((Pet*)this)->Remove(PET_SAVE_NOT_IN_SLOT); ASSERT(!IsInWorld()); return; } Unit* owner = GetSummoner(); if (owner && owner->GetTypeId() == TYPEID_UNIT && owner->ToCreature()->IsAIEnabled) owner->ToCreature()->AI()->SummonedCreatureDespawn(this); //npcbot if (GetIAmABot() || GetIAmABotsPet()) { //TC_LOG_ERROR("entities.player", "TempSummon::UnSummon(): Trying to unsummon Bot %s (guidLow: %u owner: %s)", GetName().c_str(), GetGUIDLow(), GetBotOwner()->GetName().c_str()); if (IsTempBot()) AI()->JustDied(NULL); return; } //end npcbots AddObjectToRemoveList(); }
void AreaTrigger::Remove() { if (IsInWorld()) { AddObjectToRemoveList(); // calls RemoveFromWorld } }
void TempSummon::UnSummon() { //ASSERT(!isPet()); if (isPet()) { if (((Pet*)this)->getPetType() == HUNTER_PET) ((Pet*)this)->Remove(PET_SLOT_ACTUAL_PET_SLOT); else ((Pet*)this)->Remove(PET_SLOT_OTHER_PET); ASSERT(!IsInWorld()); return; } Unit* owner = GetSummoner(); if (owner && owner->GetTypeId() == TYPEID_UNIT && owner->ToCreature()->IsAIEnabled) owner->ToCreature()->AI()->SummonedCreatureDespawn(this); if (owner && owner->GetTypeId() == TYPEID_PLAYER && ((Player*)owner)->HaveBot() && ((Player*)owner)->GetBot()->GetGUID()==this->GetGUID() && this->isDead()) { // dont unsummon corpse if a bot return; } AddObjectToRemoveList(); }
void DynamicObject::Remove() { if (IsInWorld()) { SendObjectDeSpawnAnim(GetGUID()); RemoveFromWorld(); AddObjectToRemoveList(); } }
void Vehicle::Dismiss() { SendObjectDeSpawnAnim(GetGUID()); CombatStop(); CleanupsBeforeDelete(); AddObjectToRemoveList(); }
void Totem::UnSummon() { CombatStop(); RemoveAurasDueToSpell(GetSpell()); if (Unit *owner = GetOwner()) { owner->_RemoveTotem(this); owner->RemoveAurasDueToSpell(GetSpell()); //remove aura all party members too if (owner->GetTypeId() == TYPEID_PLAYER) { ((Player*)owner)->SendAutoRepeatCancel(this); // Not only the player can summon the totem (scripted AI) if (Group *pGroup = ((Player*)owner)->GetGroup()) { for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) { Player* Target = itr->getSource(); if(Target && pGroup->SameSubGroup((Player*)owner, Target)) Target->RemoveAurasDueToSpell(GetSpell()); } } } if (owner->GetTypeId() == TYPEID_UNIT && ((Creature*)owner)->AI()) ((Creature*)owner)->AI()->SummonedCreatureDespawn((Creature*)this); } AddObjectToRemoveList(); }
void TemporarySummon::UnSummon(uint32 delay) { if (delay > 0) { m_type = TEMPSUMMON_TIMED_OR_DEAD_DESPAWN; m_timer = delay; return; } m_isActive = false; CombatStop(); if (GetSummonerGuid().IsCreatureOrVehicle()) { if (Creature* sum = GetMap()->GetCreature(GetSummonerGuid())) { if (sum->AI()) sum->AI()->SummonedCreatureDespawn(this); } } KillAllEvents(false); AddObjectToRemoveList(); // Prevent double unsummonig before remove from world m_type = TEMPSUMMON_MANUAL_DESPAWN; }
void TempSummon::UnSummon(uint32 msTime) { if (msTime) { ForcedUnsummonDelayEvent* pEvent = new ForcedUnsummonDelayEvent(*this); m_Events.AddEvent(pEvent, m_Events.CalculateTime(msTime)); return; } // Dont allow to call this function twice (possible) if (m_type == TEMPSUMMON_DESPAWNED) return; SetTempSummonType(TEMPSUMMON_DESPAWNED); //ASSERT(!IsPet()); if (IsPet()) { ((Pet*)this)->Remove(PET_SAVE_NOT_IN_SLOT); ASSERT(!IsInWorld()); return; } Unit* owner = GetSummoner(); if (owner && owner->GetTypeId() == TYPEID_UNIT && owner->ToCreature()->IsAIEnabled) owner->ToCreature()->AI()->SummonedCreatureDespawn(this); AddObjectToRemoveList(); }
void Totem::UnSummon() { CombatStop(); uint32 maxIdx = GetSpellMaxIndex(); for (int32 i = maxIdx; i >= 0; --i) { if (uint32 spellId = GetSpell(i)) RemoveAurasDueToSpell(spellId); } if (Unit* owner = GetOwner()) { owner->_RemoveTotem(this); for (int32 i = maxIdx; i >= 0; --i) { if (uint32 spellId = GetSpell(i)) owner->RemoveAurasDueToSpell(spellId); } // Remove Sentry Totem aura on totem unsummon if (GetEntry() == SENTRY_TOTEM_ENTRY) owner->RemoveAurasDueToSpell(6495); //remove aura all party members too if (owner->GetTypeId() == TYPEID_PLAYER) { ((Player*)owner)->SendAutoRepeatCancel(this); // Not only the player can summon the totem (scripted AI) if (Group* pGroup = ((Player*)owner)->GetGroup()) { for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) { Player* Target = itr->getSource(); if (Target && pGroup->SameSubGroup((Player*)owner, Target)) { for (int32 i = maxIdx; i >= 0; --i) { if (uint32 spellId = GetSpell(i)) Target->RemoveAurasDueToSpell(spellId); } } } } } if (owner->GetTypeId() == TYPEID_UNIT && ((Creature*)owner)->AI()) ((Creature*)owner)->AI()->SummonedCreatureDespawn((Creature*)this); } // any totem unsummon look like as totem kill, req. for proper animation if (isAlive()) SetDeathState(DEAD); AddObjectToRemoveList(); }
void DynamicObject::Remove() { if (IsInWorld()) { RemoveFromWorld(); AddObjectToRemoveList(); } }
void GameObject::Delete() { SendObjectDeSpawnAnim(GetGUID()); SetGoState(1); SetUInt32Value(GAMEOBJECT_FLAGS, GetGOInfo()->flags); AddObjectToRemoveList(); }
void AreaTrigger::Remove() { if (IsInWorld()) { SendObjectDeSpawnAnim(GetGUID()); RemoveFromWorld(); AddObjectToRemoveList(); } }
void TemporarySummon::UnSummon() { AddObjectToRemoveList(); Unit* sum = m_summoner ? GetMap()->GetUnit(m_summoner) : NULL; if (sum && sum->GetTypeId() == TYPEID_UNIT && ((Creature*)sum)->IsAIEnabled) { ((Creature*)sum)->AI()->SummonedCreatureDespawn(this); } }
void Totem::UnSummon(uint32 msTime) { if (msTime) { m_Events.AddEvent(new ForcedUnsummonDelayEvent(*this), m_Events.CalculateTime(msTime)); return; } CombatStop(); RemoveAurasDueToSpell(GetSpell(), GetGUID()); // clear owner's totem slot for (uint8 i = SUMMON_SLOT_TOTEM; i < MAX_TOTEM_SLOT; ++i) { if (GetOwner()->m_SummonSlot[i] == GetGUID()) { GetOwner()->m_SummonSlot[i].Clear(); break; } } GetOwner()->RemoveAurasDueToSpell(GetSpell(), GetGUID()); // Remove Sentry Totem Aura if (GetEntry() == SENTRY_TOTEM_ENTRY) GetOwner()->RemoveAurasDueToSpell(SENTRY_TOTEM_SPELLID); //remove aura all party members too if (Player* owner = GetOwner()->ToPlayer()) { owner->SendAutoRepeatCancel(this); if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(GetUInt32Value(UNIT_CREATED_BY_SPELL))) GetSpellHistory()->SendCooldownEvent(spell, 0, nullptr, false); if (Group* group = owner->GetGroup()) { for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) { Player* target = itr->GetSource(); if (target && group->SameSubGroup(owner, target)) target->RemoveAurasDueToSpell(GetSpell(), GetGUID()); } } } //npcbot: send SummonedCreatureDespawn() if (GetCreatorGUID().IsCreature()) if (Unit* bot = ObjectAccessor::FindConnectedPlayer(GetCreatorGUID())) if (bot->ToCreature()->GetIAmABot()) bot->ToCreature()->OnBotDespawn(this); //end npcbot AddObjectToRemoveList(); }
void Corpse::DeleteBonesFromWorld() { ASSERT(GetType() == CORPSE_BONES); Corpse* corpse = ObjectAccessor::GetCorpse(*this, GetGUID()); if (!corpse) { sLog->outError("Bones %u not found in world.", GetGUIDLow()); return; } AddObjectToRemoveList(); }
void TemporarySummon::UnSummon() { CombatStop(); if (GetSummonerGuid().IsCreature()) if(Creature* sum = GetMap()->GetCreature(GetSummonerGuid())) if (sum->AI()) sum->AI()->SummonedCreatureDespawn(this); AddObjectToRemoveList(); }
void TemporarySummon::UnSummon() { CombatStop(); Unit* sum = m_summoner ? ObjectAccessor::GetUnit(*this, m_summoner) : NULL; if (sum && sum->GetTypeId() == TYPEID_UNIT && ((Creature*)sum)->AI()) { ((Creature*)sum)->AI()->SummonedCreatureDespawn(this); } AddObjectToRemoveList(); }
void Totem::UnSummon(uint32 msTime) { if (msTime) { m_Events.AddEvent(new ForcedUnsummonDelayEvent(*this), m_Events.CalculateTime(msTime)); return; } CombatStop(); RemoveAurasDueToSpell(GetSpell(), GetGUID()); // clear owner's totem slot for (uint8 i = SUMMON_SLOT_TOTEM; i < MAX_TOTEM_SLOT; ++i) { if (GetOwner()->m_SummonSlot[i] == GetGUID()) { GetOwner()->m_SummonSlot[i].Clear(); break; } } GetOwner()->RemoveAurasDueToSpell(GetSpell(), GetGUID()); // Remove Sentry Totem Aura if (GetEntry() == SENTRY_TOTEM_ENTRY) GetOwner()->RemoveAurasDueToSpell(SENTRY_TOTEM_SPELLID); //remove aura all party members too if (Player* owner = GetOwner()->ToPlayer()) { owner->SendAutoRepeatCancel(this); if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(GetUInt32Value(UNIT_CREATED_BY_SPELL))) GetSpellHistory()->SendCooldownEvent(spell, 0, nullptr, false); if (Group* group = owner->GetGroup()) { for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) { Player* target = itr->GetSource(); if (target && group->SameSubGroup(owner, target)) target->RemoveAurasDueToSpell(GetSpell(), GetGUID()); } } } // any totem unsummon look like as totem kill, req. for proper animation if (IsAlive()) setDeathState(DEAD); AddObjectToRemoveList(); }
void GameObject::Delete() { SendObjectDeSpawnAnim(GetGUID()); SetGoState(GO_STATE_READY); SetUInt32Value(GAMEOBJECT_FLAGS, GetGOInfo()->flags); uint16 poolid = sPoolMgr.IsPartOfAPool(GetGUIDLow(), TYPEID_GAMEOBJECT); if (poolid) sPoolMgr.UpdatePool(poolid, GetGUIDLow(), TYPEID_GAMEOBJECT); else AddObjectToRemoveList(); }
void Corpse::DeleteBonesFromWorld() { MANGOS_ASSERT(GetType() == CORPSE_BONES); Corpse* corpse = GetMap()->GetCorpse(GetObjectGuid()); if (!corpse) { sLog.outError("Bones %u not found in world.", GetGUIDLow()); return; } AddObjectToRemoveList(); }
void Corpse::DeleteBonesFromWorld() { ASSERT(GetType() == CORPSE_BONES); Corpse* corpse = ObjectAccessor::GetCorpse(*this, GetGUID()); if (!corpse) { TC_LOG_ERROR("entities.player", "Bones %u not found in world.", GetGUIDLow()); return; } AddObjectToRemoveList(); }
void Totem::UnSummon(uint32 msTime) { if (msTime) { m_Events.AddEvent(new ForcedUnsummonDelayEvent(*this), m_Events.CalculateTime(msTime)); return; } CombatStop(); RemoveAurasDueToSpell(GetSpell(), GetGUID()); Unit *m_owner = GetOwner(); // clear owner's totem slot for (uint8 i = SUMMON_SLOT_TOTEM; i < MAX_TOTEM_SLOT; ++i) { if (m_owner->m_SummonSlot[i] == GetGUID()) { m_owner->m_SummonSlot[i] = 0; break; } } m_owner->RemoveAurasDueToSpell(GetSpell(), GetGUID()); // Remove Sentry Totem Aura if (GetEntry() == SENTRY_TOTEM_ENTRY) m_owner->RemoveAurasDueToSpell(SENTRY_TOTEM_SPELLID); //remove aura all party members too if (Player* owner = m_owner->ToPlayer()) { owner->SendAutoRepeatCancel(this); if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(GetUInt32Value(UNIT_CREATED_BY_SPELL))) owner->SendCooldownEvent(spell, 0, NULL, false); if (Group* group = owner->GetGroup()) { for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) { Player* target = itr->GetSource(); if (target && target->IsInMap(owner) && group->SameSubGroup(owner, target)) target->RemoveAurasDueToSpell(GetSpell(), GetGUID()); } } } AddObjectToRemoveList(); }
void DynamicObject::Delete() { if (m_aura) { // dynObj may be removed in Aura::Remove - we cannot delete there // so recheck aura here if (!m_aura->IsRemoved()) m_aura->_Remove(AURA_REMOVE_BY_DEFAULT); delete m_aura; m_aura = NULL; } SendObjectDeSpawnAnim(GetGUID()); RemoveFromWorld(); AddObjectToRemoveList(); }
void TempSummon::UnSummon() { if (isPet()) { ((Pet*)this)->Remove(PET_SAVE_NOT_IN_SLOT); ASSERT(!IsInWorld()); return; } Unit* owner = GetSummoner(); if (owner && owner->GetTypeId() == TYPEID_UNIT && owner->ToCreature()->IsAIEnabled) owner->ToCreature()->AI()->SummonedCreatureDespawn(this); AddObjectToRemoveList(); }