Hello,
First I want to say thanks for the ui question, I was looking for the graphics component on the class list and not objects and classes category.
Second, I have a question regarding something I already asked about the traits because it has come up again.
Because I have a usableItem and not an Item, I cannot use item functions such as hasTrait or even have access to itemHooks such as onEquipItem.
I was thinking of creating an itemClone and then use this itemClone for the usableItem that i will have on my scene, thus giving me access to the hook functions.
Is this the best way to proceed in regards to usableItems?
Code: Select all
cloneObject{
name = "Potion_Energy_IC",
baseObject = "potion_energy",
components = {
{
class = "Item",
uiName = "Potion of energy",
onEquipItem = function(item, champion, slot)
print("yo")
hooks.script.item_OnEquipItem(item, champion, {"magic"})
end,
onUnequipItem = function(item, champion, slot)
print("yo")
hooks.script.item_OnEquipItem(item, champion, {"magic"})
end
}
},
}
cloneObject{
name = "Potion_Energy",
baseObject = "Potion_Energy_IC",
components = {
{
class = "UsableItem",
uiName = "Potion of energy",
onUseItem = function(item, champion)
hooks.script.item_OnUsePotion(item, champion, {"magic"})
end,
}
},
}