Ir para conteúdo

Novo Sistema De Vip Com Npc


Killua

Posts Recomendados

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 premium

freepremium = "yes"

Ou algo do tipo. Mude oque esta em vermelho para no assim

-- do you want everyone to have premium

freepremium = "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!

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

fala cara to com 1 problema no seu npc aeww..

ele nao ta respondendo os player =/

 

ex: player fala hi

 

ele nao diz nada...

 

e no console do ot aparece erro 'creatureGetName'

 

consegue arrumar isso??

 

fora isso adorei seu npc, bastante gente tava atras de um npc assim!!

 

Aprovado :button_ok:

 

 

 

Link para o comentário
Compartilhar em outros sites

  • 4 weeks later...
  • 4 weeks later...

Cara, pelo geito do seu script, acho que você possa me ajudar no meu npc.

Em vez de vip account, precisava de npc q vendia os itens vip.

 

Preciso de um Npc que venda os itens vip do meu ot, com as Coin vip que eu criei.

- Já tentei de tudu, acho que nao to sabendo editar o script certinho.

Em vez de criar, eu to tentando editar aquele famoso a sweaty cyclops, mais ainda nao tive sucesso. Caso for mais facil criar um igual você fez, agradeço.

Porem precisamos criar juntus, pois os id's estão comigo. hehe

Valeu.

Se puder, tem como da uma olhada nos meus posts?

 

Valeu.

Crocodile Server

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...