Ir para conteúdo

Saffari Zone


eliasjunior157

Posts Recomendados

  • 2 weeks later...

Vou Tentar Ajudar. É Meio Grande São Vários Scrpts.As Partes Coloridas Serão Aonde Você Terá Que Modificar Conserteza Lá Em Baixo irá Ter a Descrição de Cada Cor e o Que Deve Mudar. Espero Não Ajudar Só Você, Mas Todos do XTibia.

Vamos Lááá:

 

1º Passo:Va para a pasta data/npc/scripts e crie um arquivo chamado Safariin.lua dentro coloque isto.

 

 

local zone = {x=, y=, z=} --- Change it to the Entry of Your safari Zone.

local storage = 20000 ---The Storage That you Check the Steps, The same Storage That The Npc, The Movement and Te Talkation Would Have.

local steps = 600 ---the number of steps that the player have to be in safari zone.

local cost = 20 ---Prize for Each Step.

---------------------------------------End Config--------------------------------------

local pay = cost * steps ---Do Not Edit This

local focus = 0 -- Do Not Edit This

local talk_start = 0 -- Do Not Edit This

local target = 0 -- Do Not Edit This

local following = false -- Do Not Edit This

local attacking = false --Do Not Edit This

 

function getPlayerMoney(cid)

gold = getPlayerItemCount(cid,2148)

plat = getPlayerItemCount(cid,2152)*100

crys = getPlayerItemCount(cid,2160)*10000

money = gold + plat + crys

return money

end

 

function onThingMove(creature, thing, oldpos, oldstackpos)

end

 

function onCreatureAppear(creature)

end

 

function onCreatureDisappear(cid, pos)

if focus == cid then

selfSay('Good bye then.')

focus = 0

talk_start = 0

end

end

 

function onCreatureTurn(creature)

end

 

 

function msgcontains(txt, str)

return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))

end

 

function onCreatureSay(cid, type, msg)

msg = string.lower(msg)

 

if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then

selfSay('Hello ' .. getPlayerName(cid) .. '! I can take you to the safari zone.')

focus = cid

talk_start = os.clock()

 

elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then

selfSay('Sorry, ' .. getPlayerName(cid) .. '! I talk to you in a minute.')

 

elseif focus == cid then

talk_start = os.clock()

 

if msgcontains(msg, 'safari') then

selfSay('Do you want buy ' .. steps ..' Steps in the safari zone for ' .. pay ..' gold coins?')

talk_state = 1

 

 

elseif talk_state == 1 then

if msgcontains(msg, 'yes') then

if getPlayerMoney(cid) >= pay then

setPlayerStorageValue(cid,storage,0)

doTeleportThing(cid, zone)

doSendMagicEffect(zone,10)

doPlayerRemoveMoney(cid,pay)

 

else

selfSay('Sorry, you don\'t have enough money.')

end

end

talk_state = 0

 

 

elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then

selfSay('Good bye, ' .. getPlayerName(cid) .. '!')

focus = 0

talk_start = 0

end

end

end

 

 

function onCreatureChangeOutfit(creature)

end

 

function onThink()

doNpcSetCreatureFocus(focus)

if (os.clock() - talk_start) > 30 then

if focus > 0 then

selfSay('Next Please...')

end

focus = 0

end

if focus ~= 0 then

if getDistanceToCreature(focus) > 5 then

selfSay('Good bye then.')

focus = 0

end

end

end

 

 

 

Depois vá a pasta data/npc e crie um novo arquivo xml com *este código* dentro

 

 

<?xml version="1.0" encoding="UTF-8"?>

<npc name="Saffari " script="data/npc/scripts/Safariin.lua" access="3" lookdir="2" autowalk="25">

<health now="150" max="150"/>

<look type="171" head="115" body="114" legs="0" feet="114" corpse="2212"/>

<parameters>

<parameter key="module_travel" value="1"/>

<parameter key="message_greet" value="Hi |PLAYERNAME|. Bem Vindo a Saffari Zone Para Entrar Diga Saffari."/>

<parameter key="Saffari_destinations" value="Saffari,1185,1300,7,100000"/>

</parameters>

</npc>

 

 

 

 

2ºPasso:Vá para a pasta data/movements/scripts e crie um arquivo chamado safari.lua dentro coloque isso.

 

 

 

local storage = 20000 ---The Storage That you Check the Steps, The same Storage That The Npc, The Movement and Te Talkation Would Have.

local out = {x=, y=, z=} --- Change it to the Exit of Your safari Zone

local steps = 600 ---the number of steps that the player have to be in safari zone.

------------------------------------------------End Config-------------------------------------------------

function onStepIn(cid, item, pos)

if isPlayer(cid) == 1 then

stepleft = getPlayerStorageValue(cid,storage)

if stepleft <= steps and stepleft >= 0 then

setPlayerStorageValue(cid,storage,stepleft+1)

elseif stepleft >= steps then

setPlayerStorageValue(cid,storage,-1)

doTeleportThing(cid, out)

doSendMagicEffect(out,10)

doPlayerSendTextMessage(cid,22,"The Time in The Safari Zone is Over, Come Back Soon.")

elseif stepleft == -1 then

doTeleportThing(cid, out)

doSendMagicEffect(out,10)

doPlayerSendTextMessage(cid,22,"You Are Not Allowed To be in The Safari Zone.")

end

end

end

 

 

 

Esta parte é importante, vocêdeve selecionar um tipo de 'chão' que você NÃO tem em parte alguma do seu mapa.

 

em data/movements/movements.xml insida esta linha

 

 

 

 

 

<movevent event="StepIn" itemid="XXXX" script="safari.lua" />

 

 

 

 

 

Altere o XXXX para o ID do 'chão' selecionado

 

 

 

3ºPasso:Vá para pasta data/talkactions/scripts e crie um novo arquivo chamado safari.lua dentro coloque isso.

 

 

 

 

local storage = 20000 ---The Storage That you Check the Steps, The same Storage That The Npc, The Movement and Te Talkation Would Have.

local out = {x=, y=, z=} --- Change it to the Exit of Your safari Zone

--------------------------------------------------------------------------------------------------------------------------

function onSay(cid, words, param)

inzone = getPlayerStorageValue(cid,storage)

if inzone == -1 then

doPlayerSendTextMessage(cid,22,"You Are not In The Safari Zone.")

elseif inzone > -1 then

doTeleportThing(cid,out)

doPlayerSendTextMessage(cid,22,"You Have Left the Safari Zone, Come Back Soon.")

setPlayerStorageValue(cid,storage,-1)

doSendMagicEffect(out,10)

end

end

 

 

 

 

 

Vá para a pasta data/talkactions/scripts e crie um novo arquivo chamado safaristeps.lua e dentro coloque isso.

 

 

 

 

 

local storage = 20000 ---The Storage That you Check the Steps, The same Storage That The Npc, The Movement and Te Talkation Would Have.

local steps = 600 ---the number of steps that the player have to be in safari zone.

---------------------------------------------End Config-----------------------------------------------------------------------------

function onSay(cid, words, param)

inzone = getPlayerStorageValue(cid,storage)

left = steps - inzone

if inzone == -1 then

doPlayerSendTextMessage(cid,22,"You Are not In The Safari Zone.")

elseif inzone > -1 then

doPlayerSendTextMessage(cid,22,"You Have " .. left .. " Steps Left in the Safari Zone.")

end

end

 

 

 

 

 

Agora vá para data/talkactions/talkactions.xml e adicione estas linhas.

 

 

 

 

<talkaction words="!leave" script="safari.lua" />

<talkaction words="!safari" script="safaristeps.lua" />

 

 

 

 

Vamos às Modificações:

 

VERMELHO:É o Local Que o NPC irá te Teletransportar (PRA DENTRO DA SAFFARI ZONE)

PRETO:É o local Que o NPC irá te Teletransportar (PRA FORA DA SAFARRI ZONE)

AZUL:É Quantos Passos o Player Poderá Dar Dentro da Saffari Zone.

LARANJA:É O Id Do Piso Que você Adcionou na saffari zone e também adcionou no movements.xml

 

 

Bom Os Locais e os Passos São de Sua Preferencia.

 

 

Espero ter Ajudado Todos.

Editado por GodRaphael
Link para o comentário
Compartilhar em outros sites

  • 2 weeks later...

Vou Tentar Ajudar. É Meio Grande São Vários Scrpts.As Partes Coloridas Serão Aonde Você Terá Que Modificar Conserteza Lá Em Baixo irá Ter a Descrição de Cada Cor e o Que Deve Mudar. Espero Não Ajudar Só Você, Mas Todos do XTibia.

Vamos Lááá:

 

1º Passo:Va para a pasta data/npc/scripts e crie um arquivo chamado Safariin.lua dentro coloque isto.

 

 

local zone = {x=, y=, z=} --- Change it to the Entry of Your safari Zone.

local storage = 20000 ---The Storage That you Check the Steps, The same Storage That The Npc, The Movement and Te Talkation Would Have.

local steps = 600 ---the number of steps that the player have to be in safari zone.

local cost = 20 ---Prize for Each Step.

---------------------------------------End Config--------------------------------------

local pay = cost * steps ---Do Not Edit This

local focus = 0 -- Do Not Edit This

local talk_start = 0 -- Do Not Edit This

local target = 0 -- Do Not Edit This

local following = false -- Do Not Edit This

local attacking = false --Do Not Edit This

 

function getPlayerMoney(cid)

gold = getPlayerItemCount(cid,2148)

plat = getPlayerItemCount(cid,2152)*100

crys = getPlayerItemCount(cid,2160)*10000

money = gold + plat + crys

return money

end

 

function onThingMove(creature, thing, oldpos, oldstackpos)

end

 

function onCreatureAppear(creature)

end

 

function onCreatureDisappear(cid, pos)

if focus == cid then

selfSay('Good bye then.')

focus = 0

talk_start = 0

end

end

 

function onCreatureTurn(creature)

end

 

 

function msgcontains(txt, str)

return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))

end

 

function onCreatureSay(cid, type, msg)

msg = string.lower(msg)

 

if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then

selfSay('Hello ' .. getPlayerName(cid) .. '! I can take you to the safari zone.')

focus = cid

talk_start = os.clock()

 

elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then

selfSay('Sorry, ' .. getPlayerName(cid) .. '! I talk to you in a minute.')

 

elseif focus == cid then

talk_start = os.clock()

 

if msgcontains(msg, 'safari') then

selfSay('Do you want buy ' .. steps ..' Steps in the safari zone for ' .. pay ..' gold coins?')

talk_state = 1

 

 

elseif talk_state == 1 then

if msgcontains(msg, 'yes') then

if getPlayerMoney(cid) >= pay then

setPlayerStorageValue(cid,storage,0)

doTeleportThing(cid, zone)

doSendMagicEffect(zone,10)

doPlayerRemoveMoney(cid,pay)

 

else

selfSay('Sorry, you don\'t have enough money.')

end

end

talk_state = 0

 

 

elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then

selfSay('Good bye, ' .. getPlayerName(cid) .. '!')

focus = 0

talk_start = 0

end

end

end

 

 

function onCreatureChangeOutfit(creature)

end

 

function onThink()

doNpcSetCreatureFocus(focus)

if (os.clock() - talk_start) > 30 then

if focus > 0 then

selfSay('Next Please...')

end

focus = 0

end

if focus ~= 0 then

if getDistanceToCreature(focus) > 5 then

selfSay('Good bye then.')

focus = 0

end

end

end

 

 

 

Depois vá a pasta data/npc e crie um novo arquivo xml com *este código* dentro

 

 

<?xml version="1.0" encoding="UTF-8"?>

<npc name="Saffari " script="data/npc/scripts/Safariin.lua" access="3" lookdir="2" autowalk="25">

<health now="150" max="150"/>

<look type="171" head="115" body="114" legs="0" feet="114" corpse="2212"/>

<parameters>

<parameter key="module_travel" value="1"/>

<parameter key="message_greet" value="Hi |PLAYERNAME|. Bem Vindo a Saffari Zone Para Entrar Diga Saffari."/>

<parameter key="Saffari_destinations" value="Saffari,1185,1300,7,100000"/>

</parameters>

</npc>

 

 

 

 

2ºPasso:Vá para a pasta data/movements/scripts e crie um arquivo chamado safari.lua dentro coloque isso.

 

 

 

local storage = 20000 ---The Storage That you Check the Steps, The same Storage That The Npc, The Movement and Te Talkation Would Have.

local out = {x=, y=, z=} --- Change it to the Exit of Your safari Zone

local steps = 600 ---the number of steps that the player have to be in safari zone.

------------------------------------------------End Config-------------------------------------------------

function onStepIn(cid, item, pos)

if isPlayer(cid) == 1 then

stepleft = getPlayerStorageValue(cid,storage)

if stepleft <= steps and stepleft >= 0 then

setPlayerStorageValue(cid,storage,stepleft+1)

elseif stepleft >= steps then

setPlayerStorageValue(cid,storage,-1)

doTeleportThing(cid, out)

doSendMagicEffect(out,10)

doPlayerSendTextMessage(cid,22,"The Time in The Safari Zone is Over, Come Back Soon.")

elseif stepleft == -1 then

doTeleportThing(cid, out)

doSendMagicEffect(out,10)

doPlayerSendTextMessage(cid,22,"You Are Not Allowed To be in The Safari Zone.")

end

end

end

 

 

 

Esta parte é importante, vocêdeve selecionar um tipo de 'chão' que você NÃO tem em parte alguma do seu mapa.

 

em data/movements/movements.xml insida esta linha

 

 

 

 

 

<movevent event="StepIn" itemid="XXXX" script="safari.lua" />

 

 

 

 

 

Altere o XXXX para o ID do 'chão' selecionado

 

 

 

3ºPasso:Vá para pasta data/talkactions/scripts e crie um novo arquivo chamado safari.lua dentro coloque isso.

 

 

 

 

local storage = 20000 ---The Storage That you Check the Steps, The same Storage That The Npc, The Movement and Te Talkation Would Have.

local out = {x=, y=, z=} --- Change it to the Exit of Your safari Zone

--------------------------------------------------------------------------------------------------------------------------

function onSay(cid, words, param)

inzone = getPlayerStorageValue(cid,storage)

if inzone == -1 then

doPlayerSendTextMessage(cid,22,"You Are not In The Safari Zone.")

elseif inzone > -1 then

doTeleportThing(cid,out)

doPlayerSendTextMessage(cid,22,"You Have Left the Safari Zone, Come Back Soon.")

setPlayerStorageValue(cid,storage,-1)

doSendMagicEffect(out,10)

end

end

 

 

 

 

 

Vá para a pasta data/talkactions/scripts e crie um novo arquivo chamado safaristeps.lua e dentro coloque isso.

 

 

 

 

 

local storage = 20000 ---The Storage That you Check the Steps, The same Storage That The Npc, The Movement and Te Talkation Would Have.

local steps = 600 ---the number of steps that the player have to be in safari zone.

---------------------------------------------End Config-----------------------------------------------------------------------------

function onSay(cid, words, param)

inzone = getPlayerStorageValue(cid,storage)

left = steps - inzone

if inzone == -1 then

doPlayerSendTextMessage(cid,22,"You Are not In The Safari Zone.")

elseif inzone > -1 then

doPlayerSendTextMessage(cid,22,"You Have " .. left .. " Steps Left in the Safari Zone.")

end

end

 

 

 

 

 

Agora vá para data/talkactions/talkactions.xml e adicione estas linhas.

 

 

 

 

<talkaction words="!leave" script="safari.lua" />

<talkaction words="!safari" script="safaristeps.lua" />

 

 

 

 

Vamos às Modificações:

 

VERMELHO:É o Local Que o NPC irá te Teletransportar (PRA DENTRO DA SAFFARI ZONE)

PRETO:É o local Que o NPC irá te Teletransportar (PRA FORA DA SAFARRI ZONE)

AZUL:É Quantos Passos o Player Poderá Dar Dentro da Saffari Zone.

LARANJA:É O Id Do Piso Que você Adcionou na saffari zone e também adcionou no movements.xml

 

 

Bom Os Locais e os Passos São de Sua Preferencia.

 

 

Espero ter Ajudado Todos.

 

 

Ajudei? Rep+.

 

 

 

Equipe Pokemon Shiny.

 

Vlw Cara REP++

Link para o comentário
Compartilhar em outros sites

  • 2 weeks later...
×
×
  • Criar Novo...