- Fórum
- OTServ
- Recursos
- Scripting
- Actions e Talkactions
- [Talkaction] Sistema "turn" do PxG (t1, t2, t3, t4)
GA
talkaction
[Talkaction] Sistema "turn" do PxG (t1, t2, t3, t4)
Por Gabrieltxu, 30 de jan. de 2013 em Actions e Talkactions
turn system pxg
script
1
1.2k
info
Grupo: Herói
Registrado: 12/06/12
Posts: 2.2k
Reputação: +739
Gênero: Masculino
Char no Tibia: Supreme Player
Olá galera, hoje eu vou trazer um script simples, que é o sistema de turn do PxG. É igual a ele, e ainda tem DUAS maneiras de fazer seu poke virar. Bom adicione essas tags no talkactions.xml do seu server:
depois Crie um arquivo.lua em data/talkactions/script Chamado turnsystem e Cole isso dentro dele!
local dirs = {
["tl"] = {dir = 1, dire = "leste"},
["t2"] = {dir = 1, dire = "leste"},
["tn"] = {dir = 0, dire = "norte"},
["t1"] = {dir = 0, dire = "norte"},
["ts"] = {dir = 2, dire = "sul"},
["t3"] = {dir = 2, dire = "sul"},
["to"] = {dir = 3, dire = "oeste"},
["t4"] = {dir = 3, dire = "oeste"},
}
function onSay(cid, words, param)
if param ~= "" then
return false
end
if #getCreatureSummons(cid) == 0 then
return false
end
local function doTurn(cid, dir)
if not isCreature(cid) then return true end
if #getCreatureSummons(cid) == 0 then
return true
end
if getCreatureSpeed(getCreatureSummons(cid)[1]) == 0 then
doChangeSpeed(getCreatureSummons(cid)[1], 1)
doCreatureSetLookDir(getCreatureSummons(cid)[1], dirs[words].dir)
doChangeSpeed(getCreatureSummons(cid)[1], -1)
else
doCreatureSetLookDir(getCreatureSummons(cid)[1], dirs[words].dir)
end
end
addEvent(doTurn, 200, cid, dir)
doCreatureSay(cid, ""..getCreatureName(getCreatureSummons(cid)[1])..", vire para o "..dirs[words].dire.."!", TALKTYPE_SAY)
return true
end
Bom, aqui vai a lista dos comandos:
tn ou t1 - virar para o norte (cima)
tl ou t2 - virar para o leste (direita)
ts ou t3 - virar para o sul (baixo)
to ou t4 - virar para o oeste (esquerda)
Só isso galera Se Estiver com Duvidas Responda ao Topico!
Creditos!: Aott
Editado Janeiro 30 por Gabrieltxu