Forum TIBIA!OTS! i nie tylko! Strona Główna
  Obecny czas to Pon 2:38, 25 Lis 2024   

Forum TIBIA!OTS! i nie tylko! Strona Główna -> Scrypty

Wiecej Food :D

  Autor    Temat Napisz nowy temat Odpowiedz do tematu
Alfons II
Stały Gość



Dołączył: 17 Lis 2005
Posty: 59 Przeczytał: 0 tematów

Ostrzeżeń: 1/10
Skąd: KRAKÓW !!!

Wiecej Food :D

Postanowilem ze porawie npc sprzedajacego food w yurots i dodam mu wszystkie food jakie są w tibii!!!
To wklejcie do <.../data/npc/scripts/food.lua

focus = 0
talk_start = 0
target = 0
following = false
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 ((string.find(msg, '(%a*)hi(%a*)')) and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfSay('Hello ' .. creatureGetName(cid) .. '! I sell all food!.')
focus = cid
talk_start = os.clock()
end

if string.find(msg, '(%a*)hi(%a*)') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.')
end

if msgcontains(msg, 'brown bread') and focus == cid then
buy(cid,3540,100,80)
talk_start = os.clock()
end

if msgcontains(msg, 'ham') and focus == cid then
buy(cid,3520,100,80)
talk_start = os.clock()
end

if msgcontains(msg, 'carrot') and focus == cid then
buy(cid,3533,100,80)
talk_start = os.clock()
end

if msgcontains(msg, 'meat') and focus == cid then
buy(cid,3515,100,80)
talk_start = os.clock()
end

if msgcontains(msg, 'apple') and focus == cid then
buy(cid,3523,100,800)
talk_start = os.clock()
end

if msgcontains(msg, 'brown mushroom') and focus == cid then
buy(cid,3660,100,800)
talk_start = os.clock()
end

if msgcontains(msg, 'egg') and focus == cid then
buy(cid,3544,100,800)
talk_start = os.clock()
end

if msgcontains(msg, 'orange') and focus == cid then
buy(cid,3524,100,150)
talk_start = os.clock()

end

if msgcontains(msg, 'banana') and focus == cid then
buy(cid,3525,100,150)
talk_start = os.clock()
end

if msgcontains(msg, 'melon') and focus == cid then
buy(cid,3531,1,20)
talk_start = os.clock()
end

if msgcontains(msg, 'tomato') and focus == cid then
buy(cid,3534,100,800)
talk_start = os.clock()
end

if msgcontains(msg, 'cheese') and focus == cid then
buy(cid,3545,1,)
talk_start = os.clock()
end

if msgcontains(msg, 'dragon ham') and focus == cid then
buy(cid,3521,100,1000)
talk_start = os.clock()
end

if msgcontains(msg, 'bread') and focus == cid then
buy(cid,3538,100,40)
talk_start = os.clock()
end

if msgcontains(msg, 'salmon') and focus == cid then
buy(cid,3517,100,200)
talk_start = os.clock()
end

if msgcontains(msg, 'fish') and focus == cid then
buy(cid,3516,100,800)
talk_start = os.clock()
end

if msgcontains(msg, 'pear') and focus == cid then
buy(cid,3522,100,100)
talk_start = os.clock()
end

if msgcontains(msg, 'blueberry') and focus == cid then
buy(cid,3526,100,80)
talk_start = os.clock()
end

if msgcontains(msg, 'strawberry') and focus == cid then
buy(cid,3529,100,200)
talk_start = os.clock()
end

if msgcontains(msg, 'flour') and focus == cid then
buy(cid,3541,100,800)
talk_start = os.clock()
end

if msgcontains(msg, 'candy cane') and focus == cid then
buy(cid,3537,100,2000)
talk_start = os.clock()
end

if msgcontains(msg, 'coconut') and focus == cid then
buy(cid,3527,100,5000)
talk_start = os.clock()
end

if msgcontains(msg, 'corncob') and focus == cid then
buy(cid,3535,100,80)
talk_start = os.clock()
end

if msgcontains(msg, 'grapes') and focus == cid then
buy(cid,3530,100,1000)
talk_start = os.clock()
end

if msgcontains(msg, 'flour') and focus == cid then
buy(cid,3541,100,80)
talk_start = os.clock()
end


if string.find(msg, '(%a*)bye(%a*)') and focus == cid and getDistanceToCreature(cid) < 4 then
selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
focus = 0
talk_start = 0
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
end



Download link:Wklej to w <.../data/npc/scripts [link widoczny dla zalogowanych]


Post został pochwalony 0 razy

Post Czw 21:48, 17 Lis 2005 
 Zobacz profil autora    
  Wyświetl posty z ostatnich:      
Napisz nowy temat Odpowiedz do tematu

Skocz do:  


Last Thread | Next Thread  >

Zasady:
Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach

 

fora.pl - załóż własne forum dyskusyjne za darmo
Powered by phpBB Š 2001 phpBB Group

phpBB Template by Vereor.

Web Templates
Web Design Templates Š