Code: Select all
function createMagicScroll()
local s = spawn("scroll",party.level, party.x, party.y, 0, 0)
s.scrollitem:setScrollText("Blabla")
s:createComponent("ItemAction")
s.itemaction:addConnector("onAttack", "script_entity_scroll_teleport", "teleportSiAuBonEndroit")
s.item:setSecondaryAction("itemaction")
end
function teleportSiAuBonEndroit(self, champion, slot)
print("Test - Teleport")
endBut I don't see where my code should try to access the field map of whatever object it may try to access.
The script that creates the scroll runs fine. It just when I use the secondary action of the scroll that I get the error message.
The function attached to the "onAttack" hook don't even fire itself (I don't get the print "Test - Teleport" on the console)
I don't know what to do. I tried touse hook on the ItemComponent, I tried to use the hook on a MeleeAttackComponent after adding one to the scroll (yeah Scroll Attack for the win !) and after each o fthose tries, I got the error message.