Bom eu criei um sistema de VIP pro meu OT, e como já ví várias dúvidas e pedidos em relação a isto, resolvi postar aqui. Creditos meus. (Eu sou o GOD Mell oks :positive: )
Começando, eu vou faser o seguinte, a premmium account será a nova VIP.
COMO?
]Para começar vá na pasta spells/spells.xml. Aperte Ctrl+F e digite prem="1" Exemplo
<instant name="Magic Rope" words="exani tera" soul="0" selftarget="1" aggressive="0" lvl="9" maglv="1" exhaustion="1" prem="1"enabled="1" script="magic rope.lua"></instant>
em seguida, apague o que esta em vermelho e coloque 0, assim
<instant name="Magic Rope" words="exani tera" soul="0" selftarget="1" aggressive="0" lvl="9" maglv="1" exhaustion="1" prem="0"enabled="1" script="magic rope.lua">
faça isso em todas as magias. Desta forma as magias serão liberadas para todos, ou seja, nimguem vai precisar ser premmium.
Depois vá na config.lua e onde estiver escrito
-- do you want everyone to have premiumfreepremium = "yes"
Ou algo do tipo. Mude oque esta em vermelho para no assim
.-- do you want everyone to have premiumfreepremium = "no"
Pronto, agora nimguem começará com premmium account, você tambem pode acrescentar alguns benefícios aos VIP's, ex: magias, áreas etc :smile_positivo:
Bom, agora vamos fazer um NPC que possa vender esta nossa "nova premmium" ou VIP.
Primeiro vá até a pasta data/npc copie algum arquivo, apague oque estiver dentro, renomeie para VIP Seller e escreva:
<?xml version="1.0"?><npc name="VIP Seller" script="data/npc/scripts/vip.lua" access="5" level="1" maglevel="1" lookdir="1" autowalk="25">
<look type="266" head="0" body="114" legs="114" feet="94" addons="3"/>
</npc>
Em seguida vá até data/npc/scripts copie um arquivo existente, apague oque estiver dentro, renomei para vip.lua e escreva:
-- NPC VIP by (amoeba13)
local focus = 0
local talk_start = 0
local target = 0
local days = 0
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Tchau seu mau educado!')
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, oque vai querer?')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Relaxa, ' .. creatureGetName(cid) .. '! Jaja eu falo com vc.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'promotion') or msgcontains(msg, 'promote') then
if getPlayerVocation(cid) > 4 then
selfSay('Sorry, you are already promoted.')
talk_state = 0
elseif getPlayerLevel(cid) < 50 then
selfSay('Sorry, you need level 50 to buy promotion.')
talk_state = 0
elseif not isPremium(cid) then
selfSay('Sorry, you must be premium to buy promotion.')
talk_state = 0
else
selfSay('Do you want to buy promotion for 150k?')
talk_state = 1
end
elseif msgcontains(msg, 'vip') or msgcontains(msg, 'vip account') then
selfSay('Voce quer comprar 30 dias de VIP por 200 MC?')
talk_state = 2
elseif talk_state == 1 then
if msgcontains(msg, 'yes') then
if pay(cid,150000000) then
doPlayerSetVocation(cid, getPlayerVocation(cid)+4)
selfSay('You are now promoted!')
else
selfSay('Sorry, you do not have enough money.')
end
end
talk_state = 0
elseif talk_state == 2 then
if msgcontains(msg, 'yes') then
if doPlayerRemoveItem(cid,2157,200) == 0 then
selfSay('Isso nao e o suficiente!')
addon_state = 0
else
selfSay('/premium '.. creatureGetName(cid) ..', 30')
selfSay('You have 30 days of VIP!')
talk_start = 0
end
end
talk_state = 0
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Good bye, ' .. creatureGetName(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('Tchau senhor Mal educado!')
focus = 0
end
end
end
agora é só mudar.
Roxo claro MC = Mell Coins, é o tipo de moeda VIP que eu desenvolvi.
Rosa 2157 é o ID do item no caso este é o IP do Gold Nugget, no meu caso os Mell Coins.
Laranja claro 200 é a quantidade de moedas vips(MC) que irá custar o VIP.
Vermelho 30 = Quantidade em dias de VIP que o player receberá.
POR FAVOR APROVEM e POSTEM. Meu primero topico demorei pra caramba pra fazer.
bugs ou qualquer problemas me avisem que tentarei arrumar.
todos os créditos a mim!
<-----Edit----->
Gente, arrumei um BUG que tinha no NPC, antes mesmo o player nao tendo as moedas VIP o NPC dava VIP...Agora ta tudo certinho!