Luisko Admin
Cantidad de envíos : 1907 Edad : 30 Localización : Donde haya rock, sexo y minas Fecha de inscripción : 16/12/2007
| Tema: Guia de NPC que vende BP's de Runas Mar Mar 04, 2008 4:25 pm | |
| Bueno, 1º que nada abren la carpeta del OTserv en data/NPC, ahi copian cualquier NPC, luego de eso le ponen editar. Borran todo y copian esto - Citación :
- <npc name="BP Runer" script="data/npc/scripts/BP Of Rune.lua" autowalk="25" floorchange="0" access="5" level="1" maglevel="1">
<health now="150" max="150"/> <look type="194" head="114" body="121" legs="121" feet="57" corpse="2212"/> <parameters> <parameter key="message_greet" value="Hello |PLAYERNAME|. I sell BPs of runes." /> <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> El nombre si quieren lo cambian al igual que el outfit. Luego de eso van a data/NPC/scripts, copian cualquier archivo, lo abren, borran todo y pegan lo siguiente - Citación :
- 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)
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) local msg = string.lower(msg)
if msgcontains(msg, 'hi') and focus == 0 and getDistanceToCreature(cid) < 4 then selfSay('Hello ' .. creatureGetName(cid) .. '! I sell BPs of runes.') 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, 'runes') then selfSay('I sell BPs of HMM (80gps), UH (100gps), Manarune (200gps), Big Mana Rune (500gps), GFB (120gps), Explosion (160gps), SD (200gps).')
elseif msgcontains(msg, 'bp hmm') then buyContainer(cid,1998,2311,100,8000)
elseif msgcontains(msg, 'bp uh') then buyContainer(cid,2002,2273,100,50000)
elseif msgcontains(msg, 'bp gfb') then buyContainer(cid,1988,2304,100,9200)
elseif msgcontains(msg, 'bp explosion') then buyContainer(cid,2001,2313,100,16000)
elseif msgcontains(msg, 'bp sd') then buyContainer(cid,2003,2268,100,100000)
elseif msgcontains(msg, 'bp manarune') then buyContainer(cid,5949,2298,100,50000)
elseif msgcontains(msg, 'bp big mana rune') then buyContainer(cid,5926,2297,100,100000)
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then selfSay('Good bye, ' .. creatureGetName(cid) .. '!') focus = 0 talk_start = 0 end end end
function onCreatureChangeOutfit(creature)
end
function onThink() doNpcSetCreatureFocus(focus) 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
Si quieres agregar mas runas, aqui esta lo que debes saber: elseif msgcontains( msg, 'bp hmm') then buyContainer(cid, 1998, 2311, 100, 8000) Este es lo que el player debe decir para comprar la BP de runas [Va entre las comillas].Este es el ID del BP que recibira.Este es el ID de la runa.Este es de cuantas cargas seran las runas dentro del BP.Este es de cuantos GPs valdra la BPY eso es todo, ya tienes tu Vendedor de BPs de runas hecho. Guia por Ziren. | |
|