Nie tylko o Tibii i OTS...
Zbanowany
Wchodzimy w data\npc i tworzymy nowy plik o nazwie Lodziarz.
Wpisujemy w nim:
<?xml version="1.0"?> <npc name="Lodziarz" script="data/npc/scripts/lodu.lua" access="3"> <look type="251" head="0" body="0" legs="0" feet="0"/> </npc>
następnie wchodzimy w data\npc\scripts i tworzymy plik lodu.lua następnie wpisujemy w nim:
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) msg = string.lower(msg) if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then selfSay('Witaj W Lodziarni' .. creatureGetName(cid) .. '! Sprzedaje rzezbiator, ice cube, lody z wisienka, lody cytrynowe, lody truskawkowe, lody malinowe, lody jablkowe and lody smerfowe (everything for 100 gps).') 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, 'rzezbiator') or msgcontains(msg, 'rzezbiator')then count = getCount(msg) price = count*1 buy(cid,7437,count,price) elseif msgcontains(msg, 'ice cube') or msgcontains(msg, 'ice cube')then count = getCount(msg) price = count*1 buy(cid,7441,count,price) elseif msgcontains(msg, 'lody z wisienka') or msgcontains(msg, 'lody z wisienka') then count = getCount(msg) price = count*1 buy(cid,7372,count,price) elseif msgcontains(msg, 'lody cytrynowe') or msgcontains(msg, 'lody cytrynowe')then count = getCount(msg) price = count*1 buy(cid,7373,count,price) elseif msgcontains(msg, 'lody truskawkowe') or msgcontains(msg, 'lody truskawkowe')then count = getCount(msg) price = count*1 buy(cid,7374,count,price) elseif msgcontains(msg, 'lody malinowe') or msgcontains(msg, 'lody malinowe')then count = getCount(msg) price = count*1 buy(cid,7375,count,price) elseif msgcontains(msg, 'lody jablkowe') or msgcontains(msg, 'lody jablkowe')then count = getCount(msg) price = count*1 buy(cid,7376,count,price) elseif msgcontains(msg, 'lody smerfowe') or msgcontains(msg, 'lody smerfowe')then count = getCount(msg) price = count*1 buy(cid,7377,count,price) elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then selfSay('Zapraszam ponownie ' .. 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('Nastepny prosze...') end focus = 0 end if focus ~= 0 then if getDistanceToCreature(focus) > 5 then selfSay('Good bye then.') focus = 0 end end end
Od tej pory możemy kupować lody u npc. :)
Offline
juz widzialem to na jakims ots
Offline
Zbanowany
sam go zrobiłem i dałem kumplom na ots-y potem nie wiem co z nim (NPC) sie stało....
Offline
Zbanowany
przydalo mi sie ) pozdro 10/10
Offline
Sułtan łechtaczek
To pod 8.0 no nie ??
Za sam skrypt 10/10. Moge uwierzyć że to twoje nic trudnego w tym npc
Offline
hmm.. Mi się przyda
Offline
Offline