--each aid you add here plz go add in the line in movement.xml
local tile = {
--[actionid] = {vocation id}
[7890] = {voca = 1 }, --please make sure the action id isnt used before
[7891] = {voca = 2 }
}
function onStepIn(cid, item, position, fromPosition)
local r = tile[item.actionid]
if getPlayerVocation(cid) ~= r.voca then
doTeleportThing(cid, fromPosition, false)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, only "..getVocationInfo(r.voca).name.."s are allowed.")
end
return true
end
<movevent type="StepIn" actionid="7890-7891" event="script" value="xxxx.lua" />
local tile = {
--[actionid] = {vocation id}
[65535] = {voca = 9 },
[65535] = {voca = 10 },
[65535] = {voca = 11 },
[65535] = {voca = 12 }
}
function onStepIn(cid, item, position, fromPosition)
local r = tile[item.actionid]
if getPlayerVocation(cid) ~= r.voca then
doTeleportThing(cid, fromPosition, false)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Wejsc moga tylko "..getVocationInfo(r.voca).name.."s .")
end
return true
end
local tile = {
--[actionid] = {vocation id}
[65535] = {voca = 9 },
[65536] = {voca = 10 },
[65537] = {voca = 11 },
[65538] = {voca = 12 }
}
function onStepIn(cid, item, position, fromPosition)
local r = tile[item.actionid]
if getPlayerVocation(cid) ~= r.voca then
doTeleportThing(cid, fromPosition, false)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Wejsc moga tylko "..getVocationInfo(r.voca).name.."s .")
end
return true
end
<movevent type="StepIn" actionid="65535-65536-65537-65538" event="script" value="xxxx.lua" />
local vocations = {9,10,11,12} --- allowed vocations.
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
local tpos,v = {x=1,y=1,z=1},getThingPos(cid) -- {x=1,y=1,z=1} is the position you teleport to, don't change getThingPos(cid).
if isInArray(vocations,getPlayerVocation(cid)) then
doTeleportThing(cid,tpos)
doSendMagicEffect(v,10)
else
doTeleportThing(cid,fromPosition)
doPlayerSendTextMessage(cid,27,'You aren\'t the right vocation.')
doSendMagicEffect(v,2)
end
return true
end
<movevent type="StepIn" itemid="[B]ITEM_ID[/B]" event="script" value="[B]SCRIPT_NAME[/B].lua"/>