Item Functions¶
GET_ITEM(type, index)¶
Computes the global item ID from its category type and sub-index.
CGItemDropRecv(lpObj, slot, x, y, mode)¶
Simulates a player dropping an item from inventory to the ground.
- Returns:
boolean
ItemGive(aIndex, specialValue)¶
Gives an item to the player using the ItemBag (DropTable) system.
- Returns:
boolean
ItemGiveEx(aIndex, itemIndex, level, durability, opt1, opt2, opt3, newOpt, [setOpt], [johOpt], [optEx], [sock0..4], [sockBonus], [duration], [harmonyExCount], [harmExOp1], [harmExVal1], [harmExOp2], [harmExVal2], [harmExOp3], [harmExVal3], [harmBonusOp], [harmBonusLvl])¶
Creates and gives a fully customized item to the player's inventory.
- Returns:
boolean
Harmony Ex Parameters (optional, available from version S21.1-2):
- harmonyExCount (integer): Number of Harmony Ex options (0-3). Default: 0.
- harmExOp1, harmExVal1 (integer): Harmony Ex option 1 type and value.
- harmExOp2, harmExVal2 (integer): Harmony Ex option 2 type and value.
- harmExOp3, harmExVal3 (integer): Harmony Ex option 3 type and value.
- harmBonusOp, harmBonusLvl (integer): Harmony Bonus option and level.
-- Give a +9 Excellent Blade with Luck
ItemGiveEx(aIndex, GET_ITEM(0, 18), 9, 255, 0, 1, 7, 0x1C)
-- Give a timed item (1 hour = 3600 seconds)
ItemGiveEx(aIndex, GET_ITEM(13, 30), 0, 255, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 3600)
-- Give item with Harmony Ex options (3 options + bonus)
ItemGiveEx(aIndex, GET_ITEM(7, 413), 15, 0, 0, 1, 4, 63, 2, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 3, 9, 50, 11, 5, 12, 120, 3, 1000)
ItemDrop(aIndex, mapNumber, x, y, specialValue)¶
Drops an item on the ground using the ItemBag system.
- Returns:
boolean
ItemDropEx(aIndex, mapNumber, x, y, itemIndex, level, durability, opt1, opt2, opt3, newOpt, [setOpt], [johOpt], [optEx], [sock0..4], [sockBonus], [duration], [ownerIndex])¶
Drops a fully customized item on the ground.
- Returns:
boolean
MoneyDrop(aIndex, mapNumber, x, y, amount)¶
Drops Zen on the ground.
- Returns:
boolean
GremoryGive(aIndex, itemIndex, level, dur, opt1, opt2, opt3, newOpt, storageType, rewardSource, daysToExpire, [duration], [setOpt], [johOpt], [optEx], [sock0..4], [sockBonus])¶
Sends an item to the player's Gremory Case. Available from version S9 onwards.
WARNING: Do NOT call from
OnCharacterEntry— Gremory data is not loaded yet. UseOnGremoryCaseReadyinstead.
- Returns:
boolean
-- Permanent item to character storage, 7-day expiry
GremoryGive(aIndex, GET_ITEM(14, 13), 0, 0, 0, 0, 0, 0,
GREMORY_CASE_CHARACTER, GREMORY_REWARD_EVENT, GREMORY_EXPIRE_7_DAYS)
-- Timed item (24h) to account storage
GremoryGive(aIndex, GET_ITEM(14, 13), 0, 0, 0, 0, 0, 0,
GREMORY_CASE_SERVER, GREMORY_REWARD_GM_REWARD, GREMORY_EXPIRE_30_DAYS, 86400)
CheckItemFromSpecialValue(specialValue)¶
Checks if an item exists in the ItemBag for the given special value (without giving it).
- Returns:
boolean
GetItemFromItemBag(aIndex, specialValue)¶
Gets an item from the ItemBag and sends it to the player's inventory.
- Returns:
boolean
CharacterSkinSend(aIndex, monsterID)¶
Changes the player's visual appearance to a monster model. Use -1 to revert.
- Returns:
boolean
CharacterSkinSend(aIndex, 275) -- Transform into monster 275
CharacterSkinSend(aIndex, -1) -- Revert to normal
Help