Gente por favor...
Tanto em alguns NPCs que vendem ADDONs
Quanto nos capitães de barcos, eu chego e falo:
HI
O capitão responde
Hello, PLAYER...
Ai se eu falo por exemplo
Aramunhra (nome de uma cidade)
Ele não responde e sai no .exe essa linha:
Esse é o script:
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 ((string.find(msg, '(%a*)hi(%a*)')) and (focus == 0)) and getDistanceToCreature(cid) < 4 then
if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
if getPlayerPremium(cid) then
selfSay('Welcome ' .. creatureGetName(cid) .. '! I can take you to Aramunhra (250gps), Livingstar (220gps), Molour (200gps), Menutis (250gps), Seruse Bay (300gps), Amazonia (330gps) and that the hellish world of Draconia! (520gps)... Where do you want to go?')
focus = cid
talk_start = os.clock()
else
selfSay('Sorry, only premium players can travel by boat.')
focus = 0
talk_start = 0
end
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, 'aramunhra') and focus == cid then
if pay(cid,250) then
selfSay('Let\'s go!')
travel(cid, 1080, 488, 6)
focus = 0
talk_start = 0
else
selfSay('Sorry, you don\'t have enough money.')
talk_start = os.clock()
end
end
if msgcontains(msg, 'livingstar') and focus == cid then
if pay(cid,220) then
selfSay('Let\'s go!')
travel(cid, 1483, 2834, 6)
focus = 0
talk_start = 0
else
selfSay('Sorry, you don\'t have enough money.')
talk_start = os.clock()
end
end
if msgcontains(msg, 'molour') and focus == cid then
if pay(cid,200) then
selfSay('Let\'s go!')
travel(cid, 732, 640, 6)
focus = 0
talk_start = 0
else
selfSay('Sorry, you don\'t have enough money.')
talk_start = os.clock()
end
end
if msgcontains(msg, 'menutis') and focus == cid then
if pay(cid,250) then
selfSay('Let\'s go!')
travel(cid, 1608, 470, 6)
focus = 0
talk_start = 0
else
selfSay('Sorry, you don\'t have enough money.')
talk_start = os.clock()
end
end
if msgcontains(msg, 'seruse bay') and focus == cid then
if pay(cid,300) then
selfSay('Let\'s go!')
travel(cid, 1532, 1012, 6)
focus = 0
talk_start = 0
else
selfSay('Sorry, you don\'t have enough money.')
talk_start = os.clock()
end
end
if msgcontains(msg, 'amazonia') and focus == cid then
if pay(cid,330) then
selfSay('Let\'s go!')
travel(cid, 1137, 880, 6)
focus = 0
talk_start = 0
else
selfSay('Sorry, you don\'t have enough money.')
talk_start = os.clock()
end
end
if msgcontains(msg, 'ice island') and focus == cid then
if pay(cid,480) then
selfSay('Let\'s go!')
travel(cid, 1521, 1380, 6)
focus = 0
talk_start = 0
else
selfSay('Sorry, you don\'t have enough money.')
talk_start = os.clock()
end
end
if msgcontains(msg, 'draconia') and focus == cid then
if pay(cid,520) then
selfSay('Let\'s go!')
travel(cid, 781, 181, 6)
focus = 0
talk_start = 0
else
selfSay('Sorry, you don\'t have enough money.')
talk_start = os.clock()
end
end
if msgcontains(msg, 'evento') and focus == cid then
if pay(cid,100) then
selfSay('Let\'s go!')
travel(cid, 649, 361, 6)
focus = 0
talk_start = 0
else
selfSay('Sorry, you don\'t have enough money.')
talk_start = os.clock()
end
end
if string.find(msg, '(%a*)bye(%a*)') and focus == cid 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