aboutsummaryrefslogtreecommitdiff
path: root/src/game/Level2.cpp
diff options
context:
space:
mode:
authorraczman <none@none>2009-04-14 14:33:48 +0200
committerraczman <none@none>2009-04-14 14:33:48 +0200
commita712170758cf1b6c62352e1bede372eae8c96593 (patch)
treec6f4559af878c2f214d8d106f3b1898426cd705b /src/game/Level2.cpp
parent37f8ee06802e721fd0546d6c972e33700e694eaa (diff)
Creature respawn linking, idea by Rat, wrote by Iskander, blessed by raczman.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Level2.cpp')
-rw-r--r--src/game/Level2.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp
index 26a701fc507..f79b8d9f04c 100644
--- a/src/game/Level2.cpp
+++ b/src/game/Level2.cpp
@@ -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;
+} \ No newline at end of file