Primeiramente, não sei se está na área correta, por favor, se não estiver, movam.
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.
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('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 ' .. creatureGetName(cid) .. '! I sell VIP Account.')
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('Do you want to buy 30 days of VIP for 150 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
selfSay('/premium '.. creatureGetName(cid) ..', 100')
if doPlayerRemoveItem(cid,2157,150) == 0 then
selfSay('You have 30 days of VIP!')
else
selfSay('Next Please....')
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('Good bye then.')
focus = 0
end
end
end
agora é só mudar.
rosa MC = Mell Coins, é o tipo de moeda VIP que eu desenvolvi.
vermelho 2157 é o ID do item no caso este é o IP do Gold Nugget, no meu caso os Mell Coins.
azul 150 é a quantidade de moedas vips que irá custar o VIP.
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!