Index: lua_baseentity.cpp =================================================================== --- lua_baseentity.cpp (revision 3948) +++ lua_baseentity.cpp (working copy) @@ -5387,6 +5387,38 @@ /************************************************************************ * * +* Sets Container Size * +* * +************************************************************************/ + +inline int32 CLuaBaseEntity::setContainerSize(lua_State *L) +{ + DSP_DEBUG_BREAK_IF(m_PBaseEntity == NULL); + DSP_DEBUG_BREAK_IF(m_PBaseEntity->objtype != TYPE_PC); + + if( !lua_isnil(L,1) && lua_isnumber(L,1) && + !lua_isnil(L,2) && lua_isnumber(L,2)) + { + uint8 LocationID = (uint8)lua_tointeger(L,1); + + if (LocationID < MAX_CONTAINER_ID) + { + CCharEntity* PChar = ((CCharEntity*)m_PBaseEntity); + + PChar->getStorage(LocationID)->SetSize(lua_tointeger(L,2)); + PChar->pushPacket(new CInventorySizePacket(PChar)); + charutils::SaveCharInventoryCapacity(PChar); + } + else + { + ShowError(CL_RED"CLuaBaseEntity::setContainerSize: bad container id (%u)\n", LocationID); + } + } + return 0; +} + +/************************************************************************ +* * * Get Entity's id * * * ************************************************************************/ @@ -7672,6 +7704,7 @@ LUNAR_DECLARE_METHOD(CLuaBaseEntity,needToZone), LUNAR_DECLARE_METHOD(CLuaBaseEntity,getContainerSize), LUNAR_DECLARE_METHOD(CLuaBaseEntity,changeContainerSize), + LUNAR_DECLARE_METHOD(CLuaBaseEntity,setContainerSize), LUNAR_DECLARE_METHOD(CLuaBaseEntity,getPartyMember), LUNAR_DECLARE_METHOD(CLuaBaseEntity,getPartySize), LUNAR_DECLARE_METHOD(CLuaBaseEntity,getAllianceSize), Index: lua_baseentity.h =================================================================== --- lua_baseentity.h (revision 3948) +++ lua_baseentity.h (working copy) @@ -376,6 +376,7 @@ int32 getContainerSize(lua_State*); // Gets the current capacity of a container int32 changeContainerSize(lua_State*); // Increase/Decreases container size + int32 setContainerSize(lua_State*); // Sets container size int32 resetPlayer(lua_State*); // if player is stuck, GM command @resetPlayer name int32 setLevel(lua_State*); // sets the character's level int32 setsLevel(lua_State*); // sets the character's level