<action itemid="[COLOR="red"]1775[/COLOR]" event="script" value="tpscroll1.lua"/>
--Script by Sonical
local newpos = {x=32247, y=33569, z=7} --New position
function onUse(cid, item, frompos, item2, topos)
local inFight = hasCondition(cid, CONDITION_INFIGHT)
if not inFight then
doSendMagicEffect(getPlayerPosition(cid), 2)
doTeleportThing(cid,newpos)
doSendMagicEffect(newpos,10)
doRemoveItem(item.uid,1)
else
doPlayerSendTextMessage(cid,25,"You could not use this teleport scroll if you are in fight!")
end
return 1
end
--Script by Sonical
function onUse(cid, item, frompos, item2, topos)
local inFight = hasCondition(cid, CONDITION_INFIGHT)
if not inFight then
doSendMagicEffect(getPlayerPosition(cid), 2)
doTeleportThing(cid,getTownTemplePosition(getPlayerTown(cid)))
doSendMagicEffect(newpos,10)
doRemoveItem(item.uid,1)
else
doPlayerSendTextMessage(cid,25,"You could not use this teleport scroll if you are in fight!")
end
return 1
end
function onStepIn(cid, item, position, fromPosition)
local config = {
battle = "yes", -- players deve estar sem battle ("yes" or "no")
msg_fail = "Você não pode passar por aqui com battle."
}
if(config.battle == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doTeleportThing(cid, fromPosition, true)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, config.msg_fail)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
return TRUE
end
return TRUE
end
<movevent type="StepIn" uniqueid="13710" event="script" value="notbattle.lua"/>
local pos = {x=1,y=1,z=1}
function onStepIn(cid, item, position, fromPosition)
if hasCondition(cid, CONDITION_INFIGHT) == false then
doTeleportThing(cid,pos)
else
doTeleportThing(cid,fromPosition)
doSendMagicEffect(getThingPos(cid),2)
doPlayerSendCancel(cid,"You cant enter when having a battle sign")
end
return true
end
<movevent type="StepIn" actionid="XXX" event="script" value="XXX.lua"/>