Esse topico tem como finalidade ajudar os usuários que tem duvidas quando a alguns sistemas de potion.
Primeiro, vá na pasta NPC, copie qualquer arquivo, e cole com o seguinte nome: desbugador.xml
Dentro dele, cole isto:
<?xml version="1.0"?>
<npc name="O Tirador de bugs" script="data/npc/scripts/desbugger.lua" access="3" lookdir="2" autowalk="25">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="251" head="0" body="114" legs="96" feet="76" addons="3"/>
</npc>
Explicando.
Verde: Nome de seu npc.
Vermelho: Skin de seu npc(roupa). OBS: Caso não seja experiente nem mecha nisso.
Após isso, vá na pasta Scripts, copie qualquer arquivo e cole com nome de desbugger.lua e coloque o seguinte conteudo:
local focus = 0local 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('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('Hiho ' .. getCreatureName(cid) .. ' Eu posso desbugar seu char do exhausted da potion, se quiser diga "bug".')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Pera, ' .. getCreatureName(cid) .. '! Ja to desbugando um noob')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'bug') then
selfSay('Eu vou desbugar seu char. para isso diga :desbug')
elseif msgcontains(msg, 'desbug') then
if getPlayerStorageValue(cid,4862) == -1 then
selfSay('Desculpe, seu BUG nao pode ser resolvido')
else
selfSay('Desugged!')
if getPlayerSex(cid) == 0 then
setPlayerStorageValue(cid,4862,-1)
else
setPlayerStorageValue(cid,4862,-1)
talk_state = 1
end
end
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Tchau, ' .. getCreatureName(cid) .. '! volte logo...')
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('Proximo...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Tchauzinho!')
focus = 0
end
end
end
Explicando:
Marrom: Mensagens que o npc diz OBS: se não for experiente não mude nada
Rosa: Esse é o storagevalue que as potions deixam, o padrão é 4862, caso não dê certo, va em data/actions/scripts e procura por ghp ou great health potion, ao abrir o arquivo, procure uma linha assim:
getPlayerStorageValue(cid,numero_que_vc_subsituira)
ao achar o numero, substitua pelos que estão em rosa.
Atenciosamente
//Chain~