Ir para conteúdo
  • 0

Pergunta

Tava precisando de um NPC de bar, que vendesse bebidas. Ai, achei esse script aqui no XTibia, só que ele não funciona, da erro no script no console <Unknown script file> e o NPC não responde.

Alguém saberia como resolver? REP +.

 

 

NPC

 

Dude.xml

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Dude" script="data/npc/scripts/drinks.lua" autowalk="25" floorchange="0" access="5" level="1" maglevel="1">
<health now="150" max="150"/>
<look type="160" head="20" body="100" legs="50" feet="99" corpse="2212"/>
<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|. Im the bar guy." />
<parameter key="message_needmoremoney" value="You do not have enough money." />
<parameter key="message_decline" value="Is |TOTALCOST| gold coins too much for you?" />
</parameters>
</npc>

 

Script

 

drinks.lua

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

-- OTServ event handling functions start
function onCreatureAppear(cid)  npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
-- OTServ event handling functions end
local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)
shopModule:addBuyableItem({'lemonade', 'lemondrink'}, 2006, 10, 5, 'lemonade')
shopModule:addBuyableItem({'fruit juice', 'fruitjuice'}, 2006, 10, 21, 'fruit juice')
shopModule:addBuyableItem({'beer', 'b_e_e_r'}, 2006, 10, 3, 'beer')
shopModule:addBuyableItem({'milk', 'm_i_l_k'}, 2006, 10, 6, 'milk')
shopModule:addBuyableItem({'coconut', 'c_o_c_o_n_u_t'}, 2006, 10, 14, 'coconut milk')
shopModule:addBuyableItem({'wine', 'w_i_n_e'}, 2006, 10, 15, 'wine')
shopModule:addBuyableItem({'rum', 'r_u_m'}, 2006, 10, 27, 'rum')
npcHandler:addModule(FocusModule:new())

Editado por NewAge
Link para o comentário
https://xtibia.com/forum/topic/202209-npc-que-vende-bebidas/
Compartilhar em outros sites

3 respostass a esta questão

Posts Recomendados

  • 0

area incorreta.

area correta é pedidos e duvidas de scripting.

topico Fechado!

 

Cara , O Certo era reportar o tópico para moverem.

Editado por Krhiegen
Link para o comentário
https://xtibia.com/forum/topic/202209-npc-que-vende-bebidas/#findComment-1420204
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...