mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 09:44:45 +01:00
*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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user