Open Tibia Server
Zapraszamy na nowy Adres http://otibias.xad.pl
FAQ
Szukaj
Użytkownicy
Grupy
Galerie
Rejestracja
Profil
Zaloguj się, by sprawdzić wiadomości
Zaloguj
Forum Open Tibia Server Strona Główna
->
Skrypty Ots
Napisz odpowiedź
Użytkownik
Temat
Treść wiadomości
Emotikony
Więcej Ikon
Kolor:
Domyślny
Ciemnoczerwony
Czerwony
Pomarańćzowy
Brązowy
Żółty
Zielony
Oliwkowy
Błękitny
Niebieski
Ciemnoniebieski
Purpurowy
Fioletowy
Biały
Czarny
Rozmiar:
Minimalny
Mały
Normalny
Duży
Ogromny
Zamknij Tagi
Opcje
HTML:
TAK
BBCode
:
TAK
Uśmieszki:
TAK
Wyłącz HTML w tym poście
Wyłącz BBCode w tym poście
Wyłącz Uśmieszki w tym poście
Kod potwierdzający: *
Wszystkie czasy w strefie CET (Europa)
Skocz do:
Wybierz forum
Forum
----------------
Otservlista
Regulamin
Accmakery
Publikacja Map
Forum
----------------
Drużyny OTS
Skrypty Ots
OTS
Pomoc
Inne
----------------
Hyde Park
Inne Gry
Real Tibia
Poradniki
Bannery
Inne strony
Pomoc-CZAT
Przegląd tematu
Autor
Wiadomość
Defozo
Wysłany: Pon 14:46, 15 Sty 2007
Temat postu: [7.6][npc] Npc sprzedający bp i bagi
Npc sprzedający bp i bagi
Ten Skrypt został zrobiony na życzenie ;d
bp.lua
Kod:
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('Do widzenia.')
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('Siema, ' .. creatureGetName(cid) .. '! Sprzedaje kolorowe plecaki po 20 jesli chesz kupic kolorwoy plecak napisz (zielony plecak itd.:) gps i kolorowe worki po 10 gps jesli chesz kupic worek napisz(czerwony worek).')
focus = cid
talk_start = os.clock()
elseif string.find(msg, '(%a*)hi(%a*)') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Przepraszam, ' .. creatureGetName(cid) .. '! Porozmawiam z toba za minute.')
elseif msgcontains(msg, 'zwykly plecak') and focus == cid then
buy(cid,1988,1,20)
talk_start = os.clock()
elseif msgcontains(msg, 'zielony plecak') and focus == cid then
buy(cid,1998,1,20)
talk_start = os.clock()
elseif msgcontains(msg, 'zolty plecak') and focus == cid then
buy(cid,1999,1,20)
talk_start = os.clock()
elseif msgcontains(msg, 'czerwony plecak') and focus == cid then
buy(cid,2000,1,20)
talk_start = os.clock()
elseif msgcontains(msg, 'fioletowy plecak') and focus == cid then
buy(cid,2001,1,20)
talk_start = os.clock()
elseif msgcontains(msg, 'niebieski plecak') and focus == cid then
buy(cid,2002,1,20)
talk_start = os.clock()
elseif msgcontains(msg, 'szary plecak') and focus == cid then
buy(cid,2003,1,20)
talk_start = os.clock()
elseif msgcontains(msg, 'zloty plecak') and focus == cid then
buy(cid,2004,1,20)
talk_start = os.clock()
elseif msgcontains(msg, 'zielony worek') and focus == cid then
buy(cid,1991,1,10)
talk_start = os.clock()
elseif msgcontains(msg, 'zolty worek') and focus == cid then
buy(cid,1992,1,10)
talk_start = os.clock()
elseif msgcontains(msg, 'czerwony worek') and focus == cid then
buy(cid,1993,1,10)
talk_start = os.clock()
elseif msgcontains(msg, 'fioletowy worek') and focus == cid then
buy(cid,1994,1,10)
talk_start = os.clock()
elseif msgcontains(msg, 'niebieski worek') and focus == cid then
buy(cid,1995,1,10)
talk_start = os.clock()
elseif msgcontains(msg, 'szary worek') and focus == cid then
buy(cid,1996,1,10)
talk_start = os.clock()
elseif msgcontains(msg, 'zloty worek') and focus == cid then
buy(cid,1997,1,10)
talk_start = os.clock()
elseif msgcontains(msg, 'zwykly worek') and focus == cid then
buy(cid,2791,1,10)
talk_start = os.clock()
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('Do widzenia.')
focus = 0
end
end
end
BP.xml
Kod:
<?xml version="1.0"?>
<npc name="BP" script="data/npc/scripts/bp.lua" access="3">
<look type="129" head="76" body="114" legs="124" feet="86"/>
</npc>
To chyba tyle? ;]
fora.pl
- załóż własne forum dyskusyjne za darmo
Powered by
phpBB
© 2001, 2005 phpBB Group
Regulamin