- Fórum
- OTServ
- Recursos
- Scripting
- Actions e Talkactions
- Trainer Offline [8.54 Até 8.60] V1.0
TO
action
Trainer Offline [8.54 Até 8.60] V1.0
Por tonynamoral, 02 de nov. de 2012 em Actions e Talkactions
otserv
tibia
script
1
1.5k
Por tonynamoral, 02 de nov. de 2012 em Actions e Talkactions
info
Grupo: Visconde
Registrado: 21/09/10
Posts: 319
Reputação: +27
Char no Tibia: lest sarif
Olá galera do xtibia , eu tava sem nada p fzer e peguei a ideia do 9.6 de criar um Trainer Offline para o 8.54/8.60 ...
Como é a versao 1.0 , eu nao fiz muita coisa
Tipo o script funciona assim
O Carinha vai na statua e clica , ai ele é teleportado para uma area de trainer , com trainers monk e talz.
Ele pod sair , clicando na statua ou espera o tempo acabar que ele ja é teleportado para fora da area
Não se esqueça , que dentro da area do trainer , precisa ser preenxida com "No-Logout Toll"
Porém , nao está atacando o monk sozinho !! , na Versao 2.0 eu irei fazer isso .
Entãão vamos instalar o Script em Seu OTSERV !
Em > data/actions/actions.xml .... Adicione
Em > data/actions/scripts .... Crie um arquivo .lua , renomeio para traineroff e dentro adicione :
--- Script By: Tony PlySon ---
function onUse(cid,item,item2,frompos,pos,topos)
--- Config
pos1 = {x= 123,y= 321,z= 7} -- Posiçao Para que o player vai ser teleportado
pos2 = {x= 321,y= 123,z= 7} -- Posiçao para que o player vai ser teleportando quando ele sair da arena
needPremium = false -- true/false
money = 1000 -- Para que nao remova money , é so por o valor 0
storage = 18214 -- VALOR , é melhor nao mexer !
min = 1 -- Quantos Minutos o Player vai ficar no OFFLINE Trainer
--- End
function onExit(cid)
doTeleportThing(cid,pos2)
end
if(needPremium == true) and not isPremium(cid) then
if(doPlayerRemoveMoney(cid,money) == true) and getPlayerStorageValue(cid,storage) >= 0 then
doPlayerSendCancel(cid,"Sorry, You need premium account.")
elseif(doPlayerRemoveMoney(cid,money) == false) then
doPlayerSendCancel(cid,"Sorry, You no have "..money.." gold coins.")
end
end
if(needPremium == true) and isPremium(cid) then
if(doPlayerRemoveMoney(cid,money) == true) and getPlayerStorageValue(cid,storage) >= 0 then
setPlayerStorageValue(cid,storage,1)
doTeleportThing(cid,pos1)
addEvent(onExit,min*1000*60,cid)
doPlayerSendTextMessage(cid,27,"Wellcome to Offline Trainer.")
elseif(doPlayerRemoveMoney(cid,money) == false) then
doPlayerSendCancel(cid,"Sorry , You no have "..money.." gold coins.")
elseif getPlayerStorageValue(cid,storage) <= 1 then
doTeleportThing(cid,pos2)
setPlayerStorageValue(cid,storage,-1)
end
end
if(needPremium == false) and isPremium(cid) then
if(doPlayerRemoveMoney(cid,money) == true) and getPlayerStorageValue(cid,storage) >= 0 then
setPlayerStorageValue(cid,storage,1)
doTeleportThing(cid,pos1)
addEvent(onExit,min*1000*60,cid)
doPlayerSendTextMessage(cid,27,"Wellcome to Offline Trainer.")
elseif(doPlayerRemoveMoney(cid,money) == false) then
doPlayerSendCancel(cid,"Sorry , You no have "..money.." gold coins.")
elseif getPlayerStorageValue(cid,storage) <= 1 then
doTeleportThing(cid,pos2)
setPlayerStorageValue(cid,storage,-1)
end
end
if(needPremium == false) and not isPremium(cid) then
if(doPlayerRemoveMoney(cid,money) == true) and getPlayerStorageValue(cid,storage) >= 0 then
setPlayerStorageValue(cid,storage,1)
doTeleportThing(cid,pos1)
addEvent(onExit,min*1000*60,cid)
doPlayerSendTextMessage(cid,27,"Wellcome to Offline Trainer.")
elseif(doPlayerRemoveMoney(cid,money) == false) then
doPlayerSendCancel(cid,"Sorry , You no have "..money.." gold coins.")
elseif getPlayerStorageValue(cid,storage) <= 1 then
doTeleportThing(cid,pos2)
setPlayerStorageValue(cid,storage,-1)
end
return true
end
end
Boom , é isso ai galera , até a versao 2.0
OBS : Qualquer duvida ou error é so comentar!