void HeroDespawn() { Creature* AllianceHero; AllianceHero = NULL; AllianceHero = _unit->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(HeroSPoints[1].x, HeroSPoints[1].y, HeroSPoints[1].z, pAllianceHero->GetEntry()); if(AllianceHero) { AllianceHero->Despawn(0,0); } else { char broadcast[100]; WorldPacket data(SMSG_BROADCAST_MSG, 50); snprintf((char*)broadcast, 100, "DotA Controller: No Alliance Hero to despawn."); data << uint32(3) << broadcast << uint8(0); sWorld.SendInstanceMessage(&data, _unit->GetInstanceID(), 0); } }