Olá galera.
Venho aqui hoje apresentar á vocês um novo jeito de vender items VIP.
Para aqueles servidores com rates altas, que sempre tem um sistema vip, bem precário!
Sem mais delongas, vamos ao HardWork. :construction:
Primeiramente, é presciso saber que neste tutorial você irá aprender:
1 - Criando uma moeda VIP.
2 - Criando um NPC para vender as moedas VIP.
Parte I - Criando uma moeda VIP
<div align="center">Vá até a pasta DATA e entre na pasta ITEMS.(Se for 8.40 vai estar na pasta XML)
Vamos usar o Sprite da GOLD NUGGET. Que é um item impossivel de ser obtido(dependendo do seu servidor.)
Na pasta items, localize o arquivo ITEMS.XML e Abra-o com o bloco de notas.
No Bloco de notas, com o arquivo aberto aperte CTRL+F e digite o tipo de moeda que você queira modificar(No nosso caso, GOLD NUGGET)
<div style="margin:0px 0px 0px 0px">
Renomei-o para VIP Coin, com o plural VIP COINS.
Pronto!
Sua Moeda vip estará feita. Mas Kakilo, espera ae! Eu vou ter de ficar sumonando toda hora que o player quiser comprar uma? Não, para isso vamos aprender como por á venda no próximo capítulo.
Parte II - Criando um NPC para vender as moedas VIP
<div align="center">
Bom, a moeda nós ja criamos, agora só falta coloca-las a venda!
Chega de tralálá e vamos por a mão na massa. Lembrando que o sistema de NPC que eu irei apresentar só servirá para 8.10. Se algum bom scripter poder criar para mim um bom npc de 8.40, concerteza irei ficar muito grato.
Vá até a pasta NPC, copie algum arquivo.xml cole na mesma e renomei-o para coinseller.xml
Abra o arquivo que você criou, coinseller.xml.
Dentro dele, apague tudo e cole isto:
<?xml version="1.0"?>
<npc name="Nyn" script="data/npc/scripts/coins.lua" access="3" lookdir="3">
<health now="1" max="1">
<look type="130" head="19" body="102" legs="52" feet="99">
</npc>
Salve e feche. Ainda dentro da pasta NPC, vá até a pasta SCRIPTS, copie algum arquivo.lua
e renomei-o para coins.lua. Abra-o, dentro dele e apague tudo oque estiver dentro, cole isso:
<div style="margin:0px 0px 0px 0px">
-- Walking --
max_x = 1 -- change the max x here. Means the NPC wont walk more to east or west as the number which is set here.
max_y = 1 --change the max y here. Means the NPC wont walk more to north or south as the number which is set here.
current_x = 0 --do nothing change here
current_y = 0 --do nothing change here
max_x = max_x - 1 --do nothing change here
max_y = max_y - 1 --do nothing change here
-- End Walking--
local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Ate mais..')
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('Olá ' .. creatureGetName(cid) .. '! Eu vendo VIP ')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Aguarde, ' .. creatureGetName(cid) .. '! Falo com você em alguns minutos.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'vip coin') then
buy(cid,2157,1,50000)
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Até mais, ' .. creatureGetName(cid) .. '!')
focus = 0
talk_start = 0
end
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
-- Walking --
if focus == 0 and max_x >= 0 and max_y >= 0 then
cx, cy, cz = selfGetPosition()
randmove = math.random(1,20)
if randmove == 4 and current_x <= max_x then
nx = cx + 1
current_x = current_x + 1
elseif randmove == 8 and current_x >= (max_x - (max_x * 2)) then
nx = cx - 1
current_x = current_x - 1
elseif randmove == 12 and current_y <= max_y then
ny = cy + 1
current_y = current_y + 1
elseif randmove == 16 and current_y >= (max_y - (max_y * 2)) then
ny = cy - 1
current_y = current_y - 1
elseif randmove <= 20 then
nx = cx
ny = cy
end
moveToPosition(nx, ny, cz)
end
-- End Walking --
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Proximo, por favor...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Vejo voce por ai, amigo..')
focus = 0
end
end
end
Vermelho - Coloque o preço que você deseja vender as vip coins. 10000 = 10k.
Para aprender a integrar o NPC no mapa, clique aqui.(Agradecimentos GM Volcano).
Preços sugeridos para as VIP COINS.
• Loot rate 1 = 10k cada.
• Loot rate 2 = 15k cada.
• Loot rate 3 = 17k cada.
• Loot rate 4 = 25k cada.
• Loot rate 5+ = 40k cada.
Salve, feche-o, abra seu servidor e veja o resultado.
Para sumonar a VIP Coin. digite /n vip coin 1 ou /i 2157.
Bom galera, é isso aí, mais um tutorial do Kakilo.
Críticas e sugestões serão sempre bem-vindas.
ERROS FAVOR COMUNICAR-ME URGENTE!
Creditos:
• Kakilo - 99% Tutorial Completo.
• GM Volcano - Tutorial de como colocar npcs no mapa.
Abraços.
~~ Kakilo