
Nie tylko o Tibii i OTS...

jest ten sam NPC co u niego różdżki kupujesz, i runy... tyle ze musisz mieć w config.lua zeby Ci kupował czary;P
Offline
Masz npc np:
<?xml version="1.0"?>
<npc name="Malak" script="data/npc/scripts/runes.lua" access="3" lookdir="1">
<health now="1000" max="1000"/>
<look type="130" head="132" body="116" legs="116" feet="76"/>
</npc>No to po 1 w npc musisz mieć data/npc/scripts/runes.lua<-----------szukasz tego i w tym powinno byc :
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 runes, wands and rods.')
selfSay('Focus before greeting: '.. focus ..'.')
focus = cid
selfSay('Focus after greeting: '.. focus ..'.')
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 hmms (50gps), uhs (150gps), gfbs (100gps), explosions (150gps), sds (200gps), Mana Runes (20k) and blank runes (5gps).')
elseif msgcontains(msg, 'wands') then
selfSay('I sell wand of inferno (15k), plague (5k), cosmic energy (10k), vortex (500gp) and dragonbreath (1k).')
elseif msgcontains(msg, 'rods') then
selfSay('I sell quagmire (10k), snakebite (500gp), tempest (15k), volcanic (5k) and moonlight rod (1k).')
elseif msgcontains(msg, 'inferno') then
buy(cid,2187,1,15000)
elseif msgcontains(msg, 'plague') then
buy(cid,2188,1,5000)
elseif msgcontains(msg, 'cosmic energy') then
buy(cid,2189,1,10000)
elseif msgcontains(msg, 'vortex') then
buy(cid,2190,1,500)
elseif msgcontains(msg, 'dragonbreath') then
buy(cid,2191,1,1000)
elseif msgcontains(msg, 'quagmire') then
buy(cid,2181,1,10000)
elseif msgcontains(msg, 'snakebite') then
buy(cid,2182,1,500)
elseif msgcontains(msg, 'tempest') then
buy(cid,2183,1,15000)
elseif msgcontains(msg, 'volcanic') then
buy(cid,2185,1,5000)
elseif msgcontains(msg, 'moonlight') then
buy(cid,2186,1,1000)
elseif msgcontains(msg, 'hmm') then
buy(cid,2311,getCount(msg),40)
elseif msgcontains(msg, '100 mana rune') then
buy(cid,2281,10,20000)
elseif msgcontains(msg, '10 mana rune') then
buy(cid,2281,10,2000)
elseif msgcontains(msg, 'mana rune') then
buy(cid,2281,1,200)
elseif msgcontains(msg, '100 uh') then
buy(cid,2273,100,4000)
elseif msgcontains(msg, '10 uh') then
buy(cid,2273,10,400)
elseif msgcontains(msg, 'uh') then
buy(cid,2273,1,40)
elseif msgcontains(msg, '100 gfb') then
buy(cid,2304,100,2000)
elseif msgcontains(msg, '10 gfb') then
buy(cid,2304,10,200)
elseif msgcontains(msg, 'gfb') then
buy(cid,2304,3,60)
elseif msgcontains(msg, '100 explosion') then
buy(cid,2313,100,2000)
elseif msgcontains(msg, '10 explosion') then
buy(cid,2313,10,200)
elseif msgcontains(msg, 'explosion') then
buy(cid,2313,3,60)
elseif msgcontains(msg, '100 sd') then
buy(cid,2268,100,9000)
elseif msgcontains(msg, '10 sd') then
buy(cid,2268,10,900)
elseif msgcontains(msg, 'sd') then
buy(cid,2268,1,90)
elseif msgcontains(msg, 'blank') then
buy(cid,2260,100,5)
elseif string.find(msg, '(%a*)bye(%a*)') and getDistanceToCreature(cid) < 4 then
selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
focus = 0
talk_start = 0
end
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
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Good bye then.')
focus = 0
end
end
endi np blank runa którą masz podaną wyzej:
elseif msgcontains(msg, 'blank') then<----(msg,'blank')<----to za pomocą jakiego słowa ją kupisz może np. być (msg,'nic') i w tedy w rozmowie z npc piszesz buy nic i kupujsz blank rune (cid,2260<----to jest ip runy,100,<---a to w jakiej ilości ma byc sprzedawana,5<--ta ostatnia liczba to cena w jakiej ma byc sprzedawana. Tłumaczenie by JaroSS
Ostatnio edytowany przez JaroSS (2008-01-18 12:51:53)
Offline
Ja nie umie tego zrobic ja jestem żółty w tych sprawach;/musial bym miec juz gotowy skrypt:P
Ostatnio edytowany przez dark camo (2008-01-18 17:40:04)
Offline