domingo, 23 de dezembro de 2007

*(scrip) sala Treino

...Você esta cançado daquelas salas de treino, onde o player entra, mata o training monk, ou vem um pk e mata ele, ou até mesmo vem pega as food que é para ajudar a treinar e depois sai, seus problemas acabaram.

Vantagens:
  • Não presisa de respaw do monstro, o script verifica se há algum monstro na posição, se não tiver, ele sumona.
  • Se já houver alguem treinando naquela cabine, ele te avisa e não permite que você acesse ela.
  • Para entrar é simples, você fica na frente da cabine e fala enter, apos isso, um efeito é solto no lugar aonde não há monstro, e então depois de 1 segundo, você é teleportado para dentro.
  • Para ajudar na hora de treinar, você fala help dentro da cabine, e por um preço de 50 de seu hp, você recebe uma ajuda, se você ganha 1 ham, e caso seja paladin, alem de 1 ham você ainda ganha 2 spear.
  • Para você sair, você fala exit, então todas as ham são retiradas de você (e no caso do paladin, spears tambem), fazendo com que você não consiga os itens de graça
Montando a Area

....Primeiro, monte no map editor, uma cabine de treino, do mesmo geito que mostra a figura abaixo (a cabine tem que ser igual a 4° figura), abaixo segue encinado como fazer a cabine(não presisa ser nessesariamente assim, mas no final tem que ficar igual a 4° figura)



....Depois de ter montado as cabines, você ira adicionar um actionId no piso emque o player ficara em cima e dira a palavra enter para entrar na cabine:





....Caso você não tenha intendido ainda:



....Resumindo: se a cabine tiver virada para lá (<) será adicionada o actionId 9875, se a cabine estiver virada para lá (>) será adicionada o actionId 9874, se a cabine estiver virada para lá (/\) será adicionada o actionId 9876, se a cabine estiver virada para lá (\/) será adicionada o actionId 9873.


Fazendo o Script

Abra a pasta do seu Ot e vá até data/talkactions/scripts, copie qualquer arquivo de lá e renomei para trainer.lua, abra o arquivo apague tudo que estiver lá e cole isso:

Citação:
------------ By D@rK ------------
-------------- OTNet --------------

function onSay(cid, words, param)

hp = 50
monstro = 'training monk'




player = getPlayerPosition(cid)
controle = getPlayerStorageValue(cid,trainer)


exi = {x=player.x, y=player.y+2, z=player.z}
pos = {x=player.x, y=player.y-2, z=player.z, stackpos = 253}
monstro1 = {x=player.x+1, y=player.y-3, z=player.z, stackpos = 253}
monstro2 = {x=player.x-1, y=player.y-3, z=player.z, stackpos = 253}
posm1 = getThingfromPos(monstro1)
posm2 = getThingfromPos(monstro2)
posd = getThingfromPos(pos)

sexi = {x=player.x, y=player.y-2, z=player.z}
spos = {x=player.x, y=player.y+2, z=player.z, stackpos = 253}
smonstro1 = {x=player.x-1, y=player.y+3, z=player.z, stackpos = 253}
smonstro2 = {x=player.x+1, y=player.y+3, z=player.z, stackpos = 253}
sposm1 = getThingfromPos(smonstro1)
sposm2 = getThingfromPos(smonstro2)
sposd = getThingfromPos(spos)

lexi = {x=player.x+2, y=player.y, z=player.z}
lpos = {x=player.x-2, y=player.y, z=player.z, stackpos = 253}
lmonstro1 = {x=player.x-3, y=player.y+1, z=player.z, stackpos = 253}
lmonstro2 = {x=player.x-3, y=player.y-1, z=player.z, stackpos = 253}
lposm1 = getThingfromPos(lmonstro1)
lposm2 = getThingfromPos(lmonstro2)
lposd = getThingfromPos(lpos)

oexi = {x=player.x-2, y=player.y, z=player.z}
opos = {x=player.x+2, y=player.y, z=player.z, stackpos = 253}
omonstro1 = {x=player.x+3, y=player.y+1, z=player.z, stackpos = 253}
omonstro2 = {x=player.x+3, y=player.y-1, z=player.z, stackpos = 253}
oposm1 = getThingfromPos(omonstro1)
oposm2 = getThingfromPos(omonstro2)
oposd = getThingfromPos(opos)


pos1 = {x=player.x, y=player.y, z=player.z, stackpos = 0}

posd1 = getThingfromPos(pos1)



if words == 'enter' then
if posd1.actionid == 9876 then
if posd.itemid == 0 then

if posm1.itemid == 0 then
doSendMagicEffect(monstro1,34)

end
if posm2.itemid == 0 then
doSendMagicEffect(monstro2,34)

end
doSendMagicEffect(player,2)
param = {cid = cid, pos = pos, posm1 = posm1, posm2 = posm2, monstro1 = monstro1, monstro2 = monstro2, monstro = monstro}
addEvent(summon,1000,param)

else
doPlayerSendTextMessage(cid, 24,'Já a um player treinando aqui, tente mais tarde')

end

elseif posd1.actionid == 9873 then
if sposd.itemid == 0 then

if sposm1.itemid == 0 then
doSendMagicEffect(smonstro1,34)

end
if sposm2.itemid == 0 then
doSendMagicEffect(smonstro2,34)

end
doSendMagicEffect(player,2)
param = {cid = cid, spos = spos, sposm1 = sposm1, sposm2 = sposm2, smonstro1 = smonstro1, smonstro2 = smonstro2, monstro = monstro}
addEvent(ssummon,1000,param)

else
doPlayerSendTextMessage(cid, 24,'Já a um player treinando aqui, tente mais tarde')

end

elseif posd1.actionid == 9874 then
if oposd.itemid == 0 then

if oposm1.itemid == 0 then
doSendMagicEffect(omonstro1,34)

end
if oposm2.itemid == 0 then
doSendMagicEffect(omonstro2,34)

end
doSendMagicEffect(player,2)
param = {cid = cid, opos = opos, oposm1 = oposm1, oposm2 = oposm2, omonstro1 = omonstro1, omonstro2 = omonstro2, monstro = monstro}
addEvent(osummon,1000,param)

else
doPlayerSendTextMessage(cid, 24,'Já a um player treinando aqui, tente mais tarde')

end


elseif posd1.actionid == 9875 then
if lposd.itemid == 0 then

if lposm1.itemid == 0 then
doSendMagicEffect(lmonstro1,34)

end
if lposm2.itemid == 0 then
doSendMagicEffect(lmonstro2,34)

end
doSendMagicEffect(player,2)
param = {cid = cid, lpos = lpos, lposm1 = lposm1, lposm2 = lposm2, lmonstro1 = lmonstro1, lmonstro2 = lmonstro2, monstro = monstro}
addEvent(lsummon,1000,param)

else
doPlayerSendTextMessage(cid, 24,'Já a um player treinando aqui, tente mais tarde')

end

else
doPlayerSay(cid,words,1)


end

elseif words == 'exit' then
voc = getPlayerVocation(cid)

if controle == 1 then
if voc == 1 or voc == 5 then

doPlayerRemoveItem(cid,2671,getPlayerItemCount(cid ,2671))
doTeleportThing(cid,exi)
setPlayerStorageValue(cid,trainer,-1)
doSendMagicEffect(exi,10)
doPlayerSendTextMessage(cid, 22, 'Adeus')

elseif voc == 2 or voc == 6 then

doPlayerRemoveItem(cid,2671,getPlayerItemCount(cid ,2671))
doTeleportThing(cid,exi)
setPlayerStorageValue(cid,trainer,-1)
doSendMagicEffect(exi,10)
doPlayerSendTextMessage(cid, 22, 'Adeus')

elseif voc == 3 or voc == 7 then

doPlayerRemoveItem(cid,2671,getPlayerItemCount(cid ,2671))
doPlayerRemoveItem(cid,2389,getPlayerItemCount(cid ,2389))
doTeleportThing(cid,exi)
setPlayerStorageValue(cid,trainer,-1)
doSendMagicEffect(exi,10)
doPlayerSendTextMessage(cid, 22, 'Adeus')

elseif voc == 4 or voc == 8 then

doPlayerRemoveItem(cid,2671,getPlayerItemCount(cid ,2671))
doTeleportThing(cid,exi)
setPlayerStorageValue(cid,trainer,-1)
doSendMagicEffect(exi,10)
doPlayerSendTextMessage(cid, 22, 'Adeus')

end

elseif controle == 2 then
if voc == 1 or voc == 5 then

doPlayerRemoveItem(cid,2671,getPlayerItemCount(cid ,2671))
doTeleportThing(cid,sexi)
setPlayerStorageValue(cid,trainer,-1)
doSendMagicEffect(sexi,10)
doPlayerSendTextMessage(cid, 22, 'Adeus')

elseif voc == 2 or voc == 6 then

doPlayerRemoveItem(cid,2671,getPlayerItemCount(cid ,2671))
doTeleportThing(cid,sexi)
setPlayerStorageValue(cid,trainer,-1)
doSendMagicEffect(sexi,10)
doPlayerSendTextMessage(cid, 22, 'Adeus')

elseif voc == 3 or voc == 7 then

doPlayerRemoveItem(cid,2671,getPlayerItemCount(cid ,2671))
doPlayerRemoveItem(cid,2389,getPlayerItemCount(cid ,2389))
doTeleportThing(cid,sexi)
setPlayerStorageValue(cid,trainer,-1)
doSendMagicEffect(sexi,10)
doPlayerSendTextMessage(cid, 22, 'Adeus')

elseif voc == 4 or voc == 8 then

doPlayerRemoveItem(cid,2671,getPlayerItemCount(cid ,2671))
doTeleportThing(cid,sexi)
setPlayerStorageValue(cid,trainer,-1)
doSendMagicEffect(sexi,10)
doPlayerSendTextMessage(cid, 22, 'Adeus')

end

elseif controle == 6 then
if voc == 1 or voc == 5 then

doPlayerRemoveItem(cid,2671,getPlayerItemCount(cid ,2671))
doTeleportThing(cid,oexi)
setPlayerStorageValue(cid,trainer,-1)
doSendMagicEffect(oexi,10)
doPlayerSendTextMessage(cid, 22, 'Adeus')

elseif voc == 2 or voc == 6 then

doPlayerRemoveItem(cid,2671,getPlayerItemCount(cid ,2671))
doTeleportThing(cid,oexi)
setPlayerStorageValue(cid,trainer,-1)
doSendMagicEffect(oexi,10)
doPlayerSendTextMessage(cid, 22, 'Adeus')

elseif voc == 3 or voc == 7 then

doPlayerRemoveItem(cid,2671,getPlayerItemCount(cid ,2671))
doPlayerRemoveItem(cid,2389,getPlayerItemCount(cid ,2389))
doTeleportThing(cid,oexi)
setPlayerStorageValue(cid,trainer,-1)
doSendMagicEffect(oexi,10)
doPlayerSendTextMessage(cid, 22, 'Adeus')

elseif voc == 4 or voc == 8 then

doPlayerRemoveItem(cid,2671,getPlayerItemCount(cid ,2671))
doTeleportThing(cid,oexi)
setPlayerStorageValue(cid,trainer,-1)
doSendMagicEffect(oexi,10)
doPlayerSendTextMessage(cid, 22, 'Adeus')

end

elseif controle == 4 then
if voc == 1 or voc == 5 then

doPlayerRemoveItem(cid,2671,getPlayerItemCount(cid ,2671))
doTeleportThing(cid,lexi)
setPlayerStorageValue(cid,trainer,-1)
doSendMagicEffect(lexi,10)
doPlayerSendTextMessage(cid, 22, 'Adeus')

elseif voc == 2 or voc == 6 then

doPlayerRemoveItem(cid,2671,getPlayerItemCount(cid ,2671))
doTeleportThing(cid,lexi)
setPlayerStorageValue(cid,trainer,-1)
doSendMagicEffect(lexi,10)
doPlayerSendTextMessage(cid, 22, 'Adeus')

elseif voc == 3 or voc == 7 then

doPlayerRemoveItem(cid,2671,getPlayerItemCount(cid ,2671))
doPlayerRemoveItem(cid,2389,getPlayerItemCount(cid ,2389))
doTeleportThing(cid,lexi)
setPlayerStorageValue(cid,trainer,-1)
doSendMagicEffect(lexi,10)
doPlayerSendTextMessage(cid, 22, 'Adeus')

elseif voc == 4 or voc == 8 then

doPlayerRemoveItem(cid,2671,getPlayerItemCount(cid ,2671))
doTeleportThing(cid,lexi)
setPlayerStorageValue(cid,trainer,-1)
doSendMagicEffect(lexi,10)
doPlayerSendTextMessage(cid, 22, 'Adeus')

end

else
doPlayerSay(cid,words,1)

end




elseif words == 'help' then
voc = getPlayerVocation(cid)
if controle == 1 or controle == 2 or controle == 6 or controle == 4 then
if voc == 1 or voc == 5 then

doPlayerAddItem(cid,2671,1)
doPlayerAddHealth(cid,-hp)
doSendAnimatedText(player, 'Lose HP', 180)
doSendMagicEffect(player,31)

elseif voc == 2 or voc == 6 then

doPlayerAddItem(cid,2671,1)
doPlayerAddHealth(cid,-hp)
doSendAnimatedText(player, 'Lose HP', 180)
doSendMagicEffect(player,31)

elseif voc == 3 or voc == 7 then

doPlayerAddItem(cid,2671,1)
doPlayerAddItem(cid,2389,2)
doPlayerAddHealth(cid,-hp)
doSendAnimatedText(player, 'Lose HP', 180)
doSendMagicEffect(player,31)

elseif voc == 4 or voc == 8 then

doPlayerAddItem(cid,2671,1)
doPlayerAddHealth(cid,-hp)
doSendAnimatedText(player, 'Lose HP', 180)
doSendMagicEffect(player,31)

end
else
doPlayerSay(cid,words,1)
end
end
end


function summon(s)

cid = s.cid
pos = s.pos
monstro1 = s.monstro1
monstro2 = s.monstro2
posm1 = s.posm1
posm2 = s.posm2
monstro = s.monstro
name = getPlayerName(cid)

if posm1.itemid > 0 then
setPlayerStorageValue(cid,trainer,1)
doTeleportThing(cid,pos)
doSendMagicEffect(pos,10)
doPlayerSendTextMessage(cid, 22, 'Bem vindo ' .. name .. '')

else
setPlayerStorageValue(cid,trainer,1)
doTeleportThing(cid,pos)
doSendMagicEffect(pos,10)
doSummonCreature(monstro,monstro1)
doPlayerSendTextMessage(cid, 22, 'Bem vindo ' .. name .. '')

end

if posm2.itemid > 0 then
setPlayerStorageValue(cid,trainer,1)
doTeleportThing(cid,pos)
doSendMagicEffect(pos,10)
doPlayerSendTextMessage(cid, 22, 'Bem vindo ' .. name .. '')

else
setPlayerStorageValue(cid,trainer,1)
doTeleportThing(cid,pos)
doSendMagicEffect(pos,10)
doSummonCreature(monstro,monstro2)
doPlayerSendTextMessage(cid, 22, 'Bem vindo ' .. name .. '')

end


end

function ssummon(s)

cid = s.cid
spos = s.spos
smonstro1 = s.smonstro1
smonstro2 = s.smonstro2
sposm1 = s.sposm1
sposm2 = s.sposm2
monstro = s.monstro
name = getPlayerName(cid)

if sposm1.itemid > 0 then
setPlayerStorageValue(cid,trainer,2)
doTeleportThing(cid,spos)
doSendMagicEffect(spos,10)
doPlayerSendTextMessage(cid, 22, 'Bem vindo ' .. name .. '')

else
setPlayerStorageValue(cid,trainer,2)
doTeleportThing(cid,spos)
doSendMagicEffect(spos,10)
doSummonCreature(monstro,smonstro1)
doPlayerSendTextMessage(cid, 22, 'Bem vindo ' .. name .. '')

end

if sposm2.itemid > 0 then
setPlayerStorageValue(cid,trainer,2)
doTeleportThing(cid,spos)
doSendMagicEffect(spos,10)
doPlayerSendTextMessage(cid, 22, 'Bem vindo ' .. name .. '')

else
setPlayerStorageValue(cid,trainer,2)
doTeleportThing(cid,spos)
doSendMagicEffect(spos,10)
doSummonCreature(monstro,smonstro2)
doPlayerSendTextMessage(cid, 22, 'Bem vindo ' .. name .. '')

end


end

function osummon(s)

cid = s.cid
opos = s.opos
omonstro1 = s.omonstro1
omonstro2 = s.omonstro2
oposm1 = s.oposm1
oposm2 = s.oposm2
monstro = s.monstro
name = getPlayerName(cid)

if oposm1.itemid > 0 then
setPlayerStorageValue(cid,trainer,6)
doTeleportThing(cid,opos)
doSendMagicEffect(opos,10)
doPlayerSendTextMessage(cid, 22, 'Bem vindo ' .. name .. '')

else
setPlayerStorageValue(cid,trainer,6)
doTeleportThing(cid,opos)
doSendMagicEffect(opos,10)
doSummonCreature(monstro,omonstro1)
doPlayerSendTextMessage(cid, 22, 'Bem vindo ' .. name .. '')

end

if oposm2.itemid > 0 then
setPlayerStorageValue(cid,trainer,6)
doTeleportThing(cid,opos)
doSendMagicEffect(opos,10)
doPlayerSendTextMessage(cid, 22, 'Bem vindo ' .. name .. '')

else
setPlayerStorageValue(cid,trainer,6)
doTeleportThing(cid,opos)
doSendMagicEffect(opos,10)
doSummonCreature(monstro,omonstro2)
doPlayerSendTextMessage(cid, 22, 'Bem vindo ' .. name .. '')

end


end

function lsummon(s)

cid = s.cid
lpos = s.lpos
lmonstro1 = s.lmonstro1
lmonstro2 = s.lmonstro2
lposm1 = s.lposm1
lposm2 = s.lposm2
monstro = s.monstro
name = getPlayerName(cid)

if lposm1.itemid > 0 then
setPlayerStorageValue(cid,trainer,4)
doTeleportThing(cid,lpos)
doSendMagicEffect(lpos,10)
doPlayerSendTextMessage(cid, 22, 'Bem vindo ' .. name .. '')

else
setPlayerStorageValue(cid,trainer,4)
doTeleportThing(cid,lpos)
doSendMagicEffect(lpos,10)
doSummonCreature(monstro,lmonstro1)
doPlayerSendTextMessage(cid, 22, 'Bem vindo ' .. name .. '')

end

if lposm2.itemid > 0 then
setPlayerStorageValue(cid,trainer,4)
doTeleportThing(cid,lpos)
doSendMagicEffect(lpos,10)
doPlayerSendTextMessage(cid, 22, 'Bem vindo ' .. name .. '')

else
setPlayerStorageValue(cid,trainer,4)
doTeleportThing(cid,lpos)
doSendMagicEffect(lpos,10)
doSummonCreature(monstro,lmonstro2)
doPlayerSendTextMessage(cid, 22, 'Bem vindo ' .. name .. '')

end


end
Não se assuste, você so vai presisar mexer em 2 coisas

Explicação:

  • hp = 50 -- aqui é a quantidade de hp que o player vai perder quando falar Help
  • monstro = 'training monk' -- Monstro que será criado, caso não tenha nenhum
Agora vá até data/talkactions/ e abra o arquivo talkactions.xml e adicione isso:

Citação:
trainer.lua" />
trainer.lua" />
trainer.lua" />
Explicação
  • trainer.lua -- nome do arquivo que nós criamos

1 comentários:

Olimpo Otserv disse...

cara eu n consigo sair da cabine quando eu falo exit

tibia 850 download server otserv mapa como 854 para global 852 yorots tutorial otserver criar map editor comandos god vancino pokemon online com baixar criando mapas 840 sql war full bot ots fazer styller sqlite serve downloads comando studio alissow 842 editar simone editado dragon itens elfbot yourots quest servidor xtibia ball serv pra enforced mcv script sem otservers alisson npc colocar usar site slayer nukar snowz bug monster download tirar client fake servfull que account thyrania acc meu vip sprut por manager key 810 pagina gangrel sistema baixa lista luz quests completo stuff programa tibiabot elf level conta magias auto senha xdream nukando onde allisow seu player snow servidores qual mudar the uma nova char mana changer xml rme item reset pelo servers multi bugs sqlitestudio otmapeditor pvp todos cliente dos dar forgotten xvx edited versao carlin aumentar creator crack otservlist otserve verso armas lua soft lag rookgaard styler karmia 493 v11 deixar fazendo tempo colocando real nao nuker skull hackear list 100 maps scripts dbz novas atk naruto