Olá!
Eu novamente trazendo novidades pro xtibia!
Queria logo avisar.. q essa action ja deve ter sido inventada, pois eu vi ela em outro servidor, gostei e tudo, n consegui falar com o host que criou nem nada (isso faz um ano mais ou menos), ai eu tive a ideia de montar ela pra ve se conseguia =D, e deu certo...
Começando:
Primeiramente vá em movements/scripts, copie qualquer arquivo e renomeie para treino.lua
abra ele e add..
--Script by Skyblade
function onStepIn(cid, item, position, fromPosition)
local parametro = {cid=cid}
voc = getPlayerVocation(cid)
p = getPlayerPosition(cid)
doTransformItem(item.uid,item.itemid-1)
if voc == 0 then
doPlayerSendTextMessage(cid,25,"Somente players com vocação podem treinar!")
elseif voc == 1 or voc == 2 or voc == 5 or voc == 6 then --pode ser editada
mageevent = addEvent(mage,3000,parametro)
doSendMagicEffect(p,3)
doPlayerSendTextMessage(cid,25,"Seu Treinamento começa em instantes!")
elseif voc == 3 or voc == 7 then --pode ser editada
archerevent = addEvent(arch,3000,parametro)
doPlayerSendTextMessage(cid,25,"Seu Treinamento começa em instantes!")
doSendMagicEffect(p,3)
elseif voc == 4 or voc == 8 then --pode ser editada
knightevent = addEvent(kina,3000,parametro)
doPlayerSendTextMessage(cid,25,"Seu Treinamento começa em instantes!")
doSendMagicEffect(p,3)
end
setPlayerStorageValue(cid,1881,p.x)
setPlayerStorageValue(cid,1882,p.y)
return TRUE
end
function mage(parametro)
cid = parametro.cid
parametro = {cid=cid}
p = getPlayerPosition(cid)
xiz = getPlayerStorageValue(cid,1881)
yps = getPlayerStorageValue(cid,1882)
inip = {x=xiz,y=yps,z=7,stackpos=253}
ini = getThingfromPos(inip)
if ini.uid == cid then
doPlayerAddSkillTry(cid,5,5)
doPlayerAddSpentMana(cid,100)
mageevent = addEvent(mage,1000,parametro)
doSendMagicEffect(p,12)
ip = getPlayerIp(cid)
if ip == 0 then
stopEvent(mageevent)
end
end
end
function kina(parametro)
cid = parametro.cid
parametro = {cid=cid}
p = getPlayerPosition(cid)
ip = getPlayerIp(cid)
if ip == 0 then
stopEvent(knightevent)
end
xiz = getPlayerStorageValue(cid,1881)
yps = getPlayerStorageValue(cid,1882)
inip = {x=xiz,y=yps,z=7,stackpos=253}
ini = getThingfromPos(inip)
if ini.uid == cid then
knightevent = addEvent(kina,1000,parametro)
doSendMagicEffect(p,12)
club = getPlayerSkill(cid,1)
sword = getPlayerSkill(cid,2)
axe = getPlayerSkill(cid,3)
doPlayerAddSkillTry(cid,3,5)
if (club > axe) and (club > sword) then
doPlayerAddSkillTry(cid,1,5)
elseif (axe > club) and (axe > sword) then
doPlayerAddSkillTry(cid,3,5)
elseif (sword > axe) and (sword > club) then
doPlayerAddSkillTry(cid,2,5)
end
doPlayerAddSkillTry(cid,5,5)
doPlayerAddSpentMana(cid,100)
end
end
function arch(parametro)
cid = parametro.cid
parametro = {cid=cid}
p = getPlayerPosition(cid)
ip = getPlayerIp(cid)
if ip == 0 then
stopEvent(archevent)
end
xiz = getPlayerStorageValue(cid,1881)
yps = getPlayerStorageValue(cid,1882)
inip = {x=xiz,y=yps,z=7,stackpos=253}
ini = getThingfromPos(inip)
if ini.uid == cid then
archerevent = addEvent(arch,1000,parametro)
doSendMagicEffect(p,12)
doPlayerAddSkillTry(cid,4,5)
doPlayerAddSkillTry(cid,5,5)
doPlayerAddSpentMana(cid,100)
end
end
function onStepOut(cid, item, position, fromPosition)
doTransformItem(item.uid,item.itemid+1)
local parametro = {cid=cid}
voc = getPlayerVocation(cid)
p = getPlayerPosition(cid)
setPlayerStorageValue(cid,9444, 0)
if voc == 1 then
stopEvent(mageevent)
elseif voc == 2 then
stopEvent(archerevent)
elseif voc == 3 then
stopEvent(knightevent)
end
end
Vá em movements.xml e add essa tag:
<movevent type="StepOut" actionid="5555" event="script" value="treino.lua"/>
Agora em seu ot crie uma area tipo treiners... só que sem eles =D... bote um tile "diferenciado" (sugiro o ID 426) e bote a actionid 5555..
Pronto =)
Como Funciona:
Seguinte.. quando o player pisa o script verifica a vocaçao e começa o treino (arch,mage,kina) ai ele fica "adicionando" skills (poucas) no player... até ele sair.
ScreenShot:
Créditos:
Não posso colocar créditos para a pessoa q inventou mais posso agradecer pela ótima idéia.
e Créditos a mim que consegui colocar funfa uma coisa q eu só tinha visto =D
desculpe pela má formatação do texto é q to com um poco de preguiça
Cyaa!