//MQ2StackIt.cpp : Defines the entry point for the DLL application.
// Written by Wickedmofo and Psycotic
// Any item that is stackable will now be stackable to 200
//
// Also you may crash if this plugin is not loaded and you
// are playing around with a stack of stuff.
#include "../MQ2Plugin.h"
PreSetup("MQ2StackIt");
#define STACKSIZE 5000
PLUGIN_API VOID OnPulse(VOID)
{
PCONTENTS pSlots = 0;
PCONTENTS pCursor = 0;
if (gGameState == GAMESTATE_INGAME)
{
pCursor = GetCharInfo2()->Cursor;
if (pCursor)
{
if ((pCursor->Item->StackSize != STACKSIZE) && (pCursor->Item->StackSize > 1))
{
pCursor->Item->StackSize = STACKSIZE;
}
}
for (int Slots=22;Slots<30;Slots++)
{
if (GetCharInfo2()->InventoryArray[Slots])
{
pSlots = GetCharInfo2()->InventoryArray[Slots];
if ((pSlots->Item->StackSize != STACKSIZE) && (pSlots->Item->StackSize > 1))
{
pSlots->Item->StackSize = STACKSIZE;
}
if (pSlots->Item->Type == ITEMTYPE_PACK)
{
for (int Packs=0;Packs < (DWORD)pSlots->Item->Slots; Packs++)
{
if (pSlots->Contents[Packs])
{
if ((pSlots->Contents[Packs]->Item->StackSize != STACKSIZE) && (pSlots->Contents[Packs]->Item->StackSize > 1))
{
pSlots->Contents[Packs]->Item->StackSize = STACKSIZE;
}
}
}
}
}
}
}
}