diff options
author | QAston <none@none> | 2009-08-04 01:44:14 +0200 |
---|---|---|
committer | QAston <none@none> | 2009-08-04 01:44:14 +0200 |
commit | 2e34af64cf83d79b7352636da71b60132b512106 (patch) | |
tree | cea5dcc663fed54b74f728c3af730b47da0e9096 /src/game/Debugcmds.cpp | |
parent | 29c9d709b908bae35b03dc24e5ba64481c1d547e (diff) |
*Allow ItemExpire events to be scripted.
*Add .debug itemexpire command
*Add script for Disgusting Jar and Mysterious Egg - original patch by Elron.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Debugcmds.cpp')
-rw-r--r-- | src/game/Debugcmds.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/game/Debugcmds.cpp b/src/game/Debugcmds.cpp index a3faf1ec746..69b3bcb1284 100644 --- a/src/game/Debugcmds.cpp +++ b/src/game/Debugcmds.cpp @@ -37,6 +37,7 @@ #include "GridNotifiers.h" #include "GridNotifiersImpl.h" #include "SpellMgr.h" +#include "ScriptCalls.h" bool ChatHandler::HandleDebugSendSpellFailCommand(const char* args) { @@ -845,6 +846,28 @@ bool ChatHandler::HandleDebugSetItemFlagCommand(const char* args) return true; } +bool ChatHandler::HandleDebugItemExpireCommand(const char* args) +{ + if (!*args) + return false; + + char* e = strtok((char*)args, " "); + if (!e) + return false; + + uint32 guid = (uint32)atoi(e); + + Item *i = m_session->GetPlayer()->GetItemByGuid(MAKE_NEW_GUID(guid, 0, HIGHGUID_ITEM)); + + if (!i) + return false; + + m_session->GetPlayer()->DestroyItem( i->GetBagSlot(),i->GetSlot(), true); + Script->ItemExpire(m_session->GetPlayer(),i->GetProto()); + + return true; +} + //show animation bool ChatHandler::HandleDebugAnimCommand(const char* args) { |