Creature respawn linking, idea by Rat, wrote by Iskander, blessed by raczman.

--HG--
branch : trunk
This commit is contained in:
raczman committed 2009-04-14 14:33:48 +02:00
1 parent 37f8ee0680
commit a712170758
10 files changed
+230 -35

No files matched your search

+33
View File
@@ -4054,3 +4054,36 @@ bool ChatHandler::HandleNpcAddFormationCommand(const char* args)
return true;
}
bool ChatHandler::HandleNpcSetLinkCommand(const char* args)
{
if (!*args)
return false;
uint32 linkguid = (uint32) atoi((char*)args);
Creature* pCreature = getSelectedCreature();
if(!pCreature)
{
SendSysMessage(LANG_SELECT_CREATURE);
SetSentErrorMessage(true);
return false;
}
if(!pCreature->GetDBTableGUIDLow())
{
PSendSysMessage("Selected creature isn't in `creature` table", pCreature->GetGUIDLow());
SetSentErrorMessage(true);
return false;
}
if(!objmgr.SetCreatureLinkedRespawn(pCreature->GetDBTableGUIDLow(), linkguid))
{
PSendSysMessage("Selected creature can't link with guid '%u'", linkguid);
SetSentErrorMessage(true);
return false;
}
PSendSysMessage("LinkGUID '%u' added to creature with DBTableGUID: '%u'", linkguid, pCreature->GetDBTableGUIDLow());
return true;
}