é galera, vcs ja devem ta cansados de me ver aqui, mas sou bem noob msm
dessa vez é assim
PRECISO MUITOOO³ do npc A Sweaty Cyclops...
Entaum eu peguei um ae mas deve ser versao velha.. 8.20 sei la
E o problema é que ele ta sempre ocupado, soh da pra falar uma vez com ele, depois ele nao fala mais, diz que ta ocupado e tals...
e tb ele nao fala pelo chat NPCs por ser de uma versão mais velha, alguêm me ajuda ? xS
Script:
local focus = 0 local 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('Olá ' .. creatureGetName(cid) .. '! Eu sou um ferreiro .. Tem algo para mim??') 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, 'crown armor') or msgcontains(msg,'piece of royal steel') then selfSay('Você quer trocar a Crown Armor pela Piece of royal steel ?') talk_state = 1 elseif msgcontains(msg, 'boh') or msgcontains(msg,'enchanted chicken wings') then selfSay('Você quer trocar a Boh pela Enchanted chicken wings ??') talk_state = 2 elseif msgcontains(msg, 'fighting spirit') or msgcontains(msg, 'royal helmet') then selfSay('Você quer trocar 2 Royal Helmet por Fighting spirit ??') talk_state = 3 elseif msgcontains(msg, 'warriors sweat') or msgcontains(msg,'warrior helmet') then selfSay('Você quer trocar 4 warrior helmet por warriors sweat ??') talk_state = 4 elseif msgcontains(msg, 'spool of yarn') or msgcontains(msg,'giant spider silk') then selfSay('Você quer trocar 10 giant spider silk por Spool of yarn ??') talk_state = 5 elseif msgcontains(msg, 'crude iron') or msgcontains(msg,'giant sword') then selfSay('Você quer trocar uma giant sword por um crude iron ??') talk_state = 6 elseif msgcontains(msg, 'devil helmet') or msgcontains(msg,'piece of hell steel') then selfSay('Você quer trocar um devil helmet por um piece of hell steel ??') talk_state = 7 elseif msgcontains(msg, 'dragon shield') or msgcontains(msg,'piece of draconian steel') then selfSay('Você quer trocar um dragon shield por um piece of draconian steel ??') talk_state = 8 elseif talk_state == 1 then if msgcontains(msg, 'yes') then itemstatus = doPlayerRemoveItem(cid,2487,1) if itemstatus == 0 then selfSay('Sorry, you not have items.') else doPlayerAddItem(cid,5887,1) selfSay('Obrigado !!') end end talk_state = 0 elseif talk_state == 2 then if msgcontains(msg, 'yes') then itemstatus = doPlayerRemoveItem(cid,2195,1) if itemstatus == 0 then selfSay('Sorry, you not have items.') else doPlayerAddItem(cid,5891,1) selfSay('Thanks for items.') end end talk_state = 0 elseif talk_state == 3 then if msgcontains(msg, 'yes') then itemstatus = doPlayerRemoveItem(cid,2498,2) if itemstatus == 0 then selfSay('Sorry, you not have items.') else doPlayerAddItem(cid,5884,1) selfSay('Thanks for items.') end end talk_state = 0 elseif talk_state == 4 then if msgcontains(msg, 'yes') then itemstatus = doPlayerRemoveItem(cid,2475,4) if itemstatus == 0 then selfSay('Sorry, you not have items.') else doPlayerAddItem(cid,5885,1) selfSay('Thanks for items.') end end talk_state = 0 elseif talk_state == 5 then if msgcontains(msg, 'yes') then itemstatus = doPlayerRemoveItem(cid,5879,10) if itemstatus == 0 then selfSay('Sorry, you not have items.') else doPlayerAddItem(cid,5886,1) selfSay('Thanks for items.') end end talk_state = 0 elseif talk_state == 6 then if msgcontains(msg, 'yes') then itemstatus = doPlayerRemoveItem(cid,2393,1) if itemstatus == 0 then selfSay('Sorry, you not have items.') else doPlayerAddItem(cid,5892,1) selfSay('Thanks for items.') end end talk_state = 0 elseif talk_state == 7 then if msgcontains(msg, 'yes') then itemstatus = doPlayerRemoveItem(cid,2462,1) if itemstatus == 0 then selfSay('Sorry, you not have items.') else doPlayerAddItem(cid,5888,1) selfSay('Thanks for items.') end end talk_state = 0 elseif talk_state == 8 then if msgcontains(msg, 'yes') then itemstatus = doPlayerRemoveItem(cid,2516,1) if itemstatus == 0 then selfSay('Sorry, you not have items.') else doPlayerAddItem(cid,5889,1) selfSay('Thanks for items.') end end elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then selfSay('Good bye, ' .. creatureGetName(cid) .. '!') focus = 0 talk_start = 0 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 end end if focus ~= 0 then if getDistanceToCreature(focus) > 5 then selfSay('Good bye then.') focus = 0 end end
Npc:
<?xml version="1.0"?> <npc name="A Sweaty Cyclops" script="data/npc/scripts/cyc.lua" access="3" lookdir="2" walkinterval="2000"> <mana now="800" max="800"/> <health now="200" max="200"/> <look type="22" head="20" body="30" legs="40" feet="50" /> </npc>
Ficarei Grato se conseguirem arumar pra ele falar pelo NPCs Channel, mas o principal é ele falar com o próximo