Vai que algum player se sente encomodado com a sujeira de seu server e você não está presente, e só ele falar com o NPC Ottho e pronto!
Vá na pasta data/npc copie qualquer arquivo e renomeie para Clean.
Abra, apague tudo que tem dentro e adicione isso:
<?xml version="1.0"?><npc name="Ottho" script="data/npc/scripts/clean.lua" access="3" lookdir="2" autowalk="25">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="266" head="78" body="113" legs="114" feet="0"/>
</npc>
Depois vá em data/npc/scripts copie qualquer arquivo e renomeie para clean.lua!
Abra, apague tudo que tem dentro e adicione isso:
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('Oi ' .. creatureGetName(cid) .. 'Eu fui programado para executar clean quando você pedir!')
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, 'clean') then
selfSay("/clean")
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Faloww, ' .. 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('Próximo por favor')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Faloowws.')
focus = 0
end
end
end