I want to create a quest in which the player throws an item into a magic forcefield and among other things, a message appears at the position of the portal. I found two functions with which to send a message, doPlayerSendTextMessage and doSendAnimatedText (doCreatureSay would be unfitting since the message doesn't come from a creature). But doSendAnimatedText is deprecated, and onAddItem doesn't seem to pass the cid variable that is required for doPlayerSendTextMessage.
movements.xml
rookicequest.lua
I tried putting cid at the beginning of the parameter list instead of at the end, it didn't help.
I'm using TFS 1.1 with client version 10.76.
Any ideas?
movements.xml
Code:
<movements>
<!-- CUSTOM MOVEMENTS -->
<movevent event="AddItem" tileitem="1" itemid="1387" script="other/rookicequest.lua"/>
</movements>
rookicequest.lua
Code:
function onAddItem(moveitem, tileitem, position, cid)
if (tileitem.actionid > 0 and tileitem.uid == 61012) then -- player throws an item into a portal
doRemoveItem(moveitem.uid)
if moveitem ~= nil then print("moveitem has value, " .. tostring(moveitem)) end -- true, userdata
if tileitem ~= nil then print("tileitem has value, " .. tostring(tileitem)) end -- true, userdata
if position ~= nil then print("position has value, " .. tostring(position)) end -- true, table
if cid ~= nil then print("cid has value, " .. tostring(cid)) end -- false
-- deprecated
doSendAnimatedText(position, "Inferior creatures, do they think they can delude me with their offerings?", MESSAGE_COLOR_ORANGE)
-- function would require cid
doPlayerSendTextMessage(cid, MESSAGE_COLOR_ORANGE, "Inferior creatures, do they think they can delude me with their offerings?")
end
return true
end
I tried putting cid at the beginning of the parameter list instead of at the end, it didn't help.
I'm using TFS 1.1 with client version 10.76.
Any ideas?