ATUALIZAÇAO, CLIQUE NO SPOIL PARA VER O ANTIGO!
SE FOR COPIAR PARA OUTRO SITE, FAVOR AVISAR
Esse npc so funciona para quem tem o VIP System feito pelo Noobinhu (clique aqui para ver topico), ele so troca a vip por um certo "Diploma" ou outro item a sua escolha.
A minha ideia seria a seguinte:
uma quest onde ganha um certo item que pode ser trocado por VIP.
aqui esta os passos para fazer a quest e colocar o NPC em seu OTserver:
1º Passo:
abra a pasta data\npc copie qualquer arquivo renomeie para Npc VIP e coloque o seguinte conteudo, substituindo tudo o que tem la...
<?xml version="1.0"?>
<npc name="VIP Seller II" script="data/npc/scripts/vipI.lua" access="6" lookdir="2">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="266" head="114" body="119" legs="132" feet="114"/>
</npc>
2º Passo:
abra a pasta data\npc\scripts e repita o mesmo processo do passo anterior, renomeando para vipI e colocando o seguinte Code:
local focus = 0local talk_start = 0
local target = 0
local following = false
local attacking = false
local itemid = 5000 -- Item ID que o NPC vai querer
local itemtype = 1 -- Quantidade de quantos items NPC vai querer
local itemname = 'Nome do ITEM ID que o NPC vai querer' -- Não tire as aspas simples
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 VIPs for '.. itemtype ..' '.. itemname ..'.')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'vip') then
vip = getPlayerStorageValue(cid,13540)
if vip == -1 then
if doPlayerRemoveItem(cid,itemid,itemtype) then
setPlayerStorageValue(cid, 13540, 1)
selfSay('Thank\'s for buying vip.')
else
selfSay('Sorry, but you didn\'t bring me the item.')
end
else
selfSay('You are already a vip player.')
end
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()
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
Obs: Modificar Parte em azul
3º Passo: Fazendo sua quest
Abra a pasta: data\actions\scripts localise o arquivo chest se nessesario, coloque abrir com bloco de notas
insira esse code la dentro (pode ser no começo)
--- vale-vip quest
if item.uid == 9800 then
queststatus = getPlayerStorageValue(cid,9800)
if queststatus == -1 then
doPlayerSendTextMessage(cid,22,"PARABENS!, Voce acaba de ganhar um Vale VIP.")
doPlayerAddItem(cid,ID DO ITEM AQUI,1)
setPlayerStorageValue(cid,9800,1)
else
doPlayerSendTextMessage(cid,22,"Esta Vasiu.")
end
end
Legenda:
Vermelho: ID Que vc colocara no Chest em seu map editor.
Laranja: Mensagem que o player vera quando abrir o bau.
Azul: ID do item que o player Ganhará.
4º Passo:
Abra seu map editor, escolha o local onde sera feita sua quest, ou coloque seu Chest em uma quest ja pronta, como POI Anihillator...
depois de pronta a quest, voce deverá colocar uma bau (chest) no final, indo em propriedades conforme a ScreenShot:
se quiser ainda, pode adicionar seu npc no mapa, fazendo o seguinte:
4.1º Passo (adicionando npc no map)
Abra a pasta de seu map editor, localise o arquivo "Creatures" aperte ctrl+f e digite NPC
assim que localizar, cole logo acima o seguinte:
<creature looktype="266" name="VIP Seller II" head="0" body="0" legs="0" feet="127" type="npc"/>
Salve e Feche.
Pronto, npc adicionado.
agora basta selecionar o local onde ele ficará.
5º passo, salve tudo e feche, agora é so reiniciar o seu Server.
Em caso de duvidas, me mande PM.
Creditos
60% Noobinhu -- Fez os Scripts
40% Sliim -- Fez o Topico, e o pedido dos scripts.
ATUALIZAÇAO!
agora nao precisa do NPC!
1º passo:
Abra data/actions/scripts/chest.lua e EDITE o antigo ---vale-vip quest substituindo por esse:
--- VIP quest
if item.uid == 9800 then
queststatus = getPlayerStorageValue(cid,13540)
if queststatus == -1 then
doPlayerSendTextMessage(cid,22,"Parabens, agora vc é um Player VIP.")
setPlayerStorageValue(cid,13540,1)
else
doPlayerSendTextMessage(cid,22,"Voce ja e um player VIP.")
end
end
pode excuir o NPC, e so ficar com a quest, muito mais simples nao?
mas atençao! ESSE SISTEMA SO FUNCIONA PARA O SISTEMA VIP DO YUNIE~
Duvidas, reclamaçoes, sujestoes... me mandem PM (Private Message).
Sliim~