Forums WoW Modding Support Archives WoWModding Threads [DiscordArchive] Can anyone help me out with a small

[DiscordArchive] Can anyone help me out with a small

[DiscordArchive] Can anyone help me out with a small

rektbyfaith
Administrator
0
06-17-2023, 10:37 PM
#1
Archived author: Lucian Tudorache • Posted: 2023-06-17T22:37:04.776000+00:00
Original source

rektbyfaith
06-17-2023, 10:37 PM #1

Archived author: Lucian Tudorache • Posted: 2023-06-17T22:37:04.776000+00:00
Original source

rektbyfaith
Administrator
0
06-17-2023, 10:37 PM
#2
Archived author: Lucian Tudorache • Posted: 2023-06-17T22:37:05.735000+00:00
Original source

int AddItem(lua_State* L, Player* player)
{
uint32 itemId = Eluna::CHECKVAL<uint32>(L, 2);
uint32 itemCount = Eluna::CHECKVAL<uint32>(L, 3, 1);

#if defined TRINITY || AZEROTHCORE
uint32 noSpaceForCount = 0;
ItemPosCountVec dest;
InventoryResult msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, itemCount, &noSpaceForCount);
if (msg != EQUIP_ERR_OK)
itemCount -= noSpaceForCount;

if (itemCount == 0 || dest.empty())
return;
Item* item = player->StoreNewItem(dest, itemId, true, GenerateItemRandomPropertyId(itemId));
if (item)
player->SendNewItem(item, itemCount, true, false);
Eluna:Tongueush(L, item);
#else
Eluna:Tongueush(L, player->StoreNewItemInInventorySlot(itemId, itemCount));
#endif
return 1;
}
rektbyfaith
06-17-2023, 10:37 PM #2

Archived author: Lucian Tudorache • Posted: 2023-06-17T22:37:05.735000+00:00
Original source

int AddItem(lua_State* L, Player* player)
{
uint32 itemId = Eluna::CHECKVAL<uint32>(L, 2);
uint32 itemCount = Eluna::CHECKVAL<uint32>(L, 3, 1);

#if defined TRINITY || AZEROTHCORE
uint32 noSpaceForCount = 0;
ItemPosCountVec dest;
InventoryResult msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, itemCount, &noSpaceForCount);
if (msg != EQUIP_ERR_OK)
itemCount -= noSpaceForCount;

if (itemCount == 0 || dest.empty())
return;
Item* item = player->StoreNewItem(dest, itemId, true, GenerateItemRandomPropertyId(itemId));
if (item)
player->SendNewItem(item, itemCount, true, false);
Eluna:Tongueush(L, item);
#else
Eluna:Tongueush(L, player->StoreNewItemInInventorySlot(itemId, itemCount));
#endif
return 1;
}

Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)