Saltar a contenido

Funciones de Items

GET_ITEM(type, index)

Calcula el ID global del item a partir de su tipo de categoría y sub-índice.

local bladeId = GET_ITEM(0, 18) -- Blade item

CGItemDropRecv(lpObj, slot, x, y, mode)

Simula que un jugador suelta un item del inventario al suelo.

  • Retorna: boolean
CGItemDropRecv(player, 12, player.X, player.Y, false)

ItemGive(aIndex, specialValue)

Otorga un item al jugador usando el sistema ItemBag (DropTable).

  • Retorna: boolean
ItemGive(aIndex, 100) -- Give item from ItemBag with special value 100

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])

Crea y otorga un item completamente personalizado al inventario del jugador.

  • Retorna: boolean

Parámetros de Harmony Ex (opcionales, disponibles desde la versión S21.1-2): - harmonyExCount (integer): Número de opciones Harmony Ex (0-3). Por defecto: 0. - harmExOp1, harmExVal1 (integer): Tipo y valor de la opción Harmony Ex 1. - harmExOp2, harmExVal2 (integer): Tipo y valor de la opción Harmony Ex 2. - harmExOp3, harmExVal3 (integer): Tipo y valor de la opción Harmony Ex 3. - harmBonusOp, harmBonusLvl (integer): Opción y nivel de Harmony Bonus.

-- 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)

Suelta un item en el suelo usando el sistema ItemBag.

  • Retorna: boolean
ItemDrop(aIndex, player.Map, player.X, player.Y, 100)

ItemDropEx(aIndex, mapNumber, x, y, itemIndex, level, durability, opt1, opt2, opt3, newOpt, [setOpt], [johOpt], [optEx], [sock0..4], [sockBonus], [duration], [ownerIndex])

Suelta un item completamente personalizado en el suelo.

  • Retorna: boolean
ItemDropEx(aIndex, player.Map, player.X, player.Y, GET_ITEM(0, 18), 9, 255, 0, 1, 7, 0x1C)

MoneyDrop(aIndex, mapNumber, x, y, amount)

Suelta zen en el suelo.

  • Retorna: boolean
MoneyDrop(aIndex, player.Map, player.X, player.Y, 50000)

GremoryGive(aIndex, itemIndex, level, dur, opt1, opt2, opt3, newOpt, storageType, rewardSource, daysToExpire, [duration], [setOpt], [johOpt], [optEx], [sock0..4], [sockBonus])

Envía un item al Gremory Case del jugador. Disponible desde la versión S9 en adelante.

ADVERTENCIA: NO llamar desde OnCharacterEntry — los datos de Gremory aún no están cargados. Usa OnGremoryCaseReady en su lugar.

  • Retorna: 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)

Verifica si un item existe en el ItemBag para el valor especial dado (sin otorgarlo).

  • Retorna: boolean
if CheckItemFromSpecialValue(100) then
    LogAdd(LOG_GREEN, "ItemBag 100 has a valid item.")
end

GetItemFromItemBag(aIndex, specialValue)

Obtiene un item del ItemBag y lo envia al inventario del jugador.

  • Retorna: boolean
if GetItemFromItemBag(aIndex, 100) then
    GCNoticeSend(aIndex, 1, "You received a reward!")
end

CharacterSkinSend(aIndex, monsterID)

Cambia la apariencia visual del jugador a un modelo de monstruo. Usa -1 para revertir.

  • Retorna: boolean
CharacterSkinSend(aIndex, 275) -- Transform into monster 275
CharacterSkinSend(aIndex, -1)  -- Revert to normal