void Creature::DespawnOrUnsummon() { if (m_despawnAtDeathTime) { Despawn(0, 0); } else { Unsummon(); } }In this code example, the DespawnOrUnsummon method is defined for the Creature class. If the creature needs to be despawned at its death time, then the Despawn method is called, otherwise the Unsummon method is called. Package Library: This code example belongs to the TrinityCore package library, a widely-used open source MMORPG server emulator for World of Warcraft.