Postado Setembro 5, 2013 11 anos Galera, venho aqui pedir um script que o npc do templo de thais 'Quentin' venda todas as bless por xxx de dinheiro.
Postado Setembro 5, 2013 11 anos Crie um arquivo chamado Quetinn.lua na pasta data/npc/scripts e cole isso local focuses = {} local function isFocused(cid) for i, v in pairs(focuses) do if(v == cid) then return true end end return false end local function addFocus(cid) if(not isFocused(cid)) then table.insert(focuses, cid) end end local function removeFocus(cid) for i, v in pairs(focuses) do if(v == cid) then table.remove(focuses, i) break end end end local function lookAtFocus() for i, v in pairs(focuses) do if(isPlayer(v)) then doNpcSetCreatureFocus(v) return end end doNpcSetCreatureFocus(0) end local price = 50000 -- Valor da bless function onCreatureSay(cid, type, msg) if(not (isFocused(cid)) and (msg == "hi" or msg == "hello")) then selfSay("Welcome, ".. getCreatureName(cid) ..". I sell {blessing}.", cid) addFocus(cid) elseif((isFocused(cid)) and (msg == "bless" or msg == "blessing")) then selfSay("Would you like buying blessing per ".. doNumberFormat(price) .." gold coins?", cid) elseif((isFocused(cid)) and (msg == "yes")) then if getPlayerMoney(cid) >= price then selfSay("Alright.", cid) doPlayerRemoveMoney(cid, price) doPlayerAddBlessing(cid, 1) doPlayerAddBlessing(cid, 2) doPlayerAddBlessing(cid, 3) doPlayerAddBlessing(cid, 4) doPlayerAddBlessing(cid, 5) doPlayerAddBlessing(cid, 6) else selfSay("You don't have enough money.", cid) end elseif((isFocused(cid)) and (msg == "bye" or msg == "goodbye" or msg == "cya")) then selfSay("Goodbye!", cid) closeShopWindow(cid) removeFocus(cid) end end function onThink() for i, focus in pairs(focuses) do if(not isCreature(focus)) then removeFocus(focus) else local distance = getDistanceTo(focus) or -1 if((distance > 4) or (distance == -1)) then selfSay("Hey, where you going?") removeFocus(focus) end end end lookAtFocus() end Configurando preço Encontre a linha "local price = 50000 -- Valor da bless" e modifique apenas os números para o valor desejado. Crie um arquivo chamado Quetinn.xml na pasta data/npc e cole isso <?xml version="1.0" encoding="UTF-8"?> <npc name="Quetinn" script="Quetinn.lua" walkinterval="2000" floorchange="0"> <health now="150" max="150" /> <look type="134" head="57" body="59" legs="40" feet="76" corpse="2212" /> </npc> Não testado. Att. Giovani Rodrigo Spoiler local config = { delrey = getPlayerCarValue(cid, DELREY), cigarro = getPlayerCancer(cid, DERBY), prostituta = getPlayerAIDS(cid, cracuda), tresOitao = getPlayerRevorvi(cid, 38) } if(delrey == "Ligado" and cigarro == "Aceso" and prostituta == "No Colo" and tresOitao == "Carregado") then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Começou o fim de semana. #PAS") end
Postado Setembro 6, 2013 11 anos Autor Crie um arquivo chamado Quetinn.lua na pasta data/npc/scripts e cole isso local focuses = {} local function isFocused(cid) for i, v in pairs(focuses) do if(v == cid) then return true end end return false end local function addFocus(cid) if(not isFocused(cid)) then table.insert(focuses, cid) end end local function removeFocus(cid) for i, v in pairs(focuses) do if(v == cid) then table.remove(focuses, i) break end end end local function lookAtFocus() for i, v in pairs(focuses) do if(isPlayer(v)) then doNpcSetCreatureFocus(v) return end end doNpcSetCreatureFocus(0) end local price = 50000 -- Valor da bless function onCreatureSay(cid, type, msg) if(not (isFocused(cid)) and (msg == "hi" or msg == "hello")) then selfSay("Welcome, ".. getCreatureName(cid) ..". I sell {blessing}.", cid) addFocus(cid) elseif((isFocused(cid)) and (msg == "bless" or msg == "blessing")) then selfSay("Would you like buying blessing per ".. doNumberFormat(price) .." gold coins?", cid) elseif((isFocused(cid)) and (msg == "yes")) then if getPlayerMoney(cid) >= price then selfSay("Alright.", cid) doPlayerRemoveMoney(cid, price) doPlayerAddBlessing(cid, 1) doPlayerAddBlessing(cid, 2) doPlayerAddBlessing(cid, 3) doPlayerAddBlessing(cid, 4) doPlayerAddBlessing(cid, 5) doPlayerAddBlessing(cid, 6) else selfSay("You don't have enough money.", cid) end elseif((isFocused(cid)) and (msg == "bye" or msg == "goodbye" or msg == "cya")) then selfSay("Goodbye!", cid) closeShopWindow(cid) removeFocus(cid) end end function onThink() for i, focus in pairs(focuses) do if(not isCreature(focus)) then removeFocus(focus) else local distance = getDistanceTo(focus) or -1 if((distance > 4) or (distance == -1)) then selfSay("Hey, where you going?") removeFocus(focus) end end end lookAtFocus() end Configurando preço Encontre a linha "local price = 50000 -- Valor da bless" e modifique apenas os números para o valor desejado. Crie um arquivo chamado Quetinn.xml na pasta data/npc e cole isso <?xml version="1.0" encoding="UTF-8"?> <npc name="Quetinn" script="Quetinn.lua" walkinterval="2000" floorchange="0"> <health now="150" max="150" /> <look type="134" head="57" body="59" legs="40" feet="76" corpse="2212" /> </npc> Não testado. Att. Giovani Rodrigo Valeu brother, me ajudou muito, REP+ pra voce!! valeu mesmo
Postado Setembro 6, 2013 11 anos Dúvida sanada, tag adicionada. Tópico movido! "O fracasso é a oportunidade de se começar de novo inteligentemente" Minhas Redes Sociais: Youtube | Página & Grupo | Steam | Discord TibiaKing
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.