*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
This commit is contained in:
QAston
2009-08-04 01:44:14 +02:00
parent 29c9d709b9
commit 2e34af64cf
15 changed files with 91 additions and 7 deletions

View File

@@ -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)
{