Mr Noxi
Noxus Otserver
Hello there community, its all about sharing i guess, this is a paid script that was made for me a while ago and i thought why not share it for those that are in need of it!
So idk if there is a better script out there for TFS 1.3 or not but am dropping it for the community anyways so enjoy, or not
Info:
A teleport item that takes you to your home town /Tempel destination.
Installation below!
data/actions.xml (remember to change itemID to your own item.
new script file in data/actions/scripts and i named the script teleport.lua
So idk if there is a better script out there for TFS 1.3 or not but am dropping it for the community anyways so enjoy, or not
Info:
A teleport item that takes you to your home town /Tempel destination.
Installation below!
data/actions.xml (remember to change itemID to your own item.
Lua:
<action itemid="2344" script="teleport.lua"/>
new script file in data/actions/scripts and i named the script teleport.lua
Lua:
local cfg = {
useEffect = true, -- display effect after item used? true = yes, false = no
removeCharge = true, -- remove rune after using it? true = yes, false = no
minLevel = 8, --level to use
effect = CONST_ME_TELEPORT -- id or name of Effect
}
local exhaust = createConditionObject(CONDITION_EXHAUST_HEAL)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 2000))
function onUse(cid, item, fromPosition, itemEx, toPosition)
local player = Player(cid)
if(getCreatureCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return true
end
if player:getLevel() < cfg.minLevel then
player:say("You need " .. cfg.minLevel .. " level to use this item.", TALKTYPE_MONSTER_SAY)
doAddCondition(cid, exhaust)
return true
end
if player:getCondition(CONDITION_INFIGHT, CONDITIONID_DEFAULT) then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You cannot teleport with pz.")
doAddCondition(cid, exhaust)
return true
end
if cfg.useEffect then
player:say("Teleported Home!", TALKTYPE_MONSTER_SAY)
player:getPosition():sendMagicEffect(cfg.effect)
end
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
if cfg.useEffect then
player:getPosition():sendMagicEffect(cfg.effect)
end
doAddCondition(cid, exhaust)
if cfg.removeCharge then
doRemoveItem(item.uid, 1)
end
return true
end