Esta spell serve, simplesmente, para te teletransportar para alguns lugares, ela usa mana dependendo da config e também você pode estabelecer pelos configs, se vai ou não precisar de estar em uma protection zone para usar a magia...
Vamos as actions...
Crie um arquivo chamado teleport.lua em data/talkactions/scripts, nele adcione:
function onSay(cid, words, param)
-- MSG Configs
needmana = 100
neededpz = 1 -- 1 for needed 0 for no needed to stay in a protection zone to use the spell
-- Teleport Configs
depot = {x=1029, y=996, z=7}
temple = {x=1000, y=1000, z=7}
playerpos = getPlayerPosition(cid)
if param == "" then
doPlayerSendTextMessage(cid,21,"Select one of these places to teleport later talk teleport: Depot and Temple.")
end
if getPlayerMana(cid) >= 100 then
if getTilePzInfo(playerpos) >= neededpz then
if param == "depot" then
doTeleportThing(cid,depot)
doSendAnimatedText(playerpos,"Zummm...",180)
doSendAnimatedText(depot,"Bzzzz...",180)
doPlayerAddMana(cid,-needmana)
doSendMagicEffect(playerpos,10)
doSendMagicEffect(depot,10)
elseif param == "temple" then
doTeleportThing(cid,temple)
doSendAnimatedText(playerpos,"Zummm...",180)
doSendAnimatedText(temple,"Bzzzz...",180)
doPlayerAddMana(cid,-needmana)
doSendMagicEffect(playerpos,10)
doSendMagicEffect(temple,10)
-- Add here others teleports...
end
else
doPlayerSendTextMessage(cid,21,"Sorry, but you need to stay in a protection zone to use this spell.")
doSendMagicEffect(playerpos,2)
end
else
doPlayerSendTextMessage(cid,21,"You need at least ".. needmana .." mana to use this spell.")
doSendMagicEffect(playerpos,2)
end
end
Feche, e abra o arquivo talkactions.xml em data/talkactions, adcione:
<talkaction words="teleport" script="teleport.lua" />
Para usar a magia, fale:
teleport "depotteleport "temple
teleport "nomedolugar
Para adcionar outro teleport, adcione embaixo de onde está escrito -- Add here others teleports...:
novoteleport = {x= X POS, y= Y POS, z= Z POS} -- declare o nome e as posições do teleportelseif param == "a palavra depois das aspas" then
doTeleportThing(cid,nome do lugar que você acabou de declarar do teleport)
-- declare o nome do teleport
doSendAnimatedText(playerpos,"Zummm...",180)
doSendAnimatedText(nome do lugar que você acabou de declarar do teleport,"Bzzzz...",180)
-- declare o nome do teleport
doPlayerAddMana(cid,-needmana)
doSendMagicEffect(playerpos,10)
doSendMagicEffect(nome do lugar que você acabou de declarar do teleport,10)
-- declare o nome do teleport
Bom proveito ... ^^
Créditos:
//Yunie~~