JoaQuiN7 Moderador
Cantidad de envíos : 17 Fecha de inscripción : 01/07/2008
| Tema: npc cantinero/vende Rum : Ron/ Wine : Vino/milk:leche/beer:cerveza/coconut milk:leche de coco/lemonade:limonada Mar Jul 01, 2008 11:15 am | |
| bueno pues aqui les mando un npc cantinero metanse a data/npc. y copien un archivo xml y abranlo (ctrl,clic derecho,editar) pongale: - Código:
-
<npc name="Bar Dude" script="data/npc/scripts/drinks.lua" autowalk="25" floorchange="0" access="5" level="1" maglevel="1"> <health now="150" max="150"/> <look type="128" 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> en esa misma carpeta de npc busque la carpeta (scripts) copien un archivo lua peguelo abralo y pongale de nombre (drinks) y pongan esto: - Código:
-
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()) bueno esperando que les haya servido saludos | |
|