Core/Scripts: Added wrapper method for despawning creatures DespawnOrUnsummon

This commit is contained in:
Shauren
2011-01-02 21:33:37 +01:00
parent c2f98606b2
commit 9c0cd63e93
66 changed files with 153 additions and 194 deletions
@@ -1656,6 +1656,14 @@ void Creature::ForcedDespawn(uint32 timeMSToDespawn)
RemoveCorpse(false);
}
void Creature::DespawnOrUnsummon(uint32 msTimeToDespawn /*= 0*/)
{
if (TempSummon* summon = this->ToTempSummon())
summon->UnSummon();
else
ForcedDespawn(msTimeToDespawn);
}
bool Creature::IsImmunedToSpell(SpellEntry const* spellInfo)
{
if (!spellInfo)
@@ -596,6 +596,7 @@ class Creature : public Unit, public GridObject<Creature>
bool isDeadByDefault() const { return m_isDeadByDefault; };
void ForcedDespawn(uint32 timeMSToDespawn = 0);
void DespawnOrUnsummon(uint32 msTimeToDespawn = 0);
time_t const& GetRespawnTime() const { return m_respawnTime; }
time_t GetRespawnTimeEx() const;