graphic
graphic
Forum OTS 7.92 Pepsi Strona Główna » Skrypty do OTS » [7.8][NPC]Kawalarz
graphic
Napisz nowy temat   Odpowiedz do tematu
graphic

graphic graphic
egzekutor Temat postu: [7.8][NPC]Kawalarz


Gość



w data/npc robimy plik Kawalarz.xml a w nim:
Kod:
<?xml version="1.0"?>
<npc name="Kawalarz" script="data/npc/scripts/kawal.lua" access="3">
<look type="128" head="78" body="71" legs="82" feet="114"/>
</npc>


potem w data/npc/scripts robimy plik kawal.lua a w nim:
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('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*)')
or string.find(msg, '(%a*)siema(%a*)')
or string.find(msg, '(%a*)czesc(%a*)')
or string.find(msg, '(%a*)cze(%a*)')
or string.find(msg, '(%a*)yo(%a*)')
or string.find(msg, '(%a*)witaj(%a*)'))
and (focus == 0)) and getDistanceToCreature(cid) < 4 then

rsay = math.random(1,4)
if rsay == 1 then says = 'Waazzuup'
elseif rsay == 2 then says = 'Siema'
elseif rsay == 3 then says = 'Czesc'
elseif rsay == 4 then says = 'Witaj'
end


selfSay(says .. ' ' .. creatureGetName(cid) .. '! Opowiedziec ci kawal?')
focus = cid
talk_start = os.clock()
end

if (string.find(msg, '(%a*)hi(%a*)')
or string.find(msg, '(%a*)siema(%a*)')
or string.find(msg, '(%a*)czesc(%a*)')
or string.find(msg, '(%a*)yo(%a*)')
or string.find(msg, '(%a*)cze(%a*)')
or string.find(msg, '(%a*)witaj(%a*)')) and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Spadaj do kolejki ' .. creatureGetName(cid) .. '!')
end

if msgcontains(msg, 'tak') and focus == cid then

rsay = math.random(1,18)
if rsay == 1 then
selfSay('Co maja wspólnego UFO i inteligentna blondynka? \n - Ciagle o nich slyszysz, ale nigdy nie widziales.')
elseif rsay == 2 then
selfSay('- Co to jest: czerwone, grube i jak wchodzi to sprawia przyjemnosc? \n - Swiety Mikolaj.')
elseif rsay == 3 then
selfSay('A wiesz, co to jest: lata po pokoju i robi yzb, yzb, yzb... \n - Mucha na wstecznym biegu.')
elseif rsay == 4 then
selfSay('- Sasiedzie! Dokupilem sobie 10 hektarów pola! \n - Wiem. Panski kon powiesil sie za stodola.')
elseif rsay == 5 then
selfSay('Czym róznia sie od siebie dlugopis, trumna i prezerwatywa? \n Wkladem.')
elseif rsay == 6 then
selfSay('Jak sie nazywa po japonsku sekretarka? \n Nagasuka.')
elseif rsay == 7 then
selfSay('Jak sie nazywa po japonsku kibel? \n Nasikojtu.')
elseif rsay == 8 then
selfSay('Jak sie nazywaja po czesku golebie? \n Srajdachówki.')
elseif rsay == 9 then
selfSay('Jak sie nazywa po francusku kibel? \n Lejnamur.')
elseif rsay == 10 then
selfSay('Jak sie nazywa po chinsku pilkarz? \n Kiwajakotako.')
elseif rsay == 11 then
selfSay('Co robi dyrektor z bezpartyjna sekretarka? \n Wciaga ja na czlonka.')
elseif rsay == 12 then
selfSay('Kto byl pierwszym lotnikiem? \n Adam, bo przelecial Ewe.')
elseif rsay == 13 then
selfSay('Co to jest: idzie to spiewa, stoi to smierdzi? \n Pielgrzymka do Czestochowy.')
elseif rsay == 14 then
selfSay('Dlaczego Swiety Mikolaj nie moze miec dzieci? \n Bo ma krzywa laske, wór na plecach i spuszcza sie przez komin.')
elseif rsay == 15 then
selfSay('Idzie baba do lekarza a lekarz też baba.')
elseif rsay == 16 then
selfSay('Siedza dwa golebie na galezi. \n jeden grucha a drugi jablko.')
elseif rsay == 17 then
selfSay('Spi lesniczy w lesniczowce, nagle słyszy strzaly w szafie. Otwiera ja... \n a tam marynarka wojenna.')
elseif rsay == 18 then
selfSay('Spi lesnicz w lesniczowce, nagle slyszy pukanie do drzwi. Otwiera, patrzy... \n a to mu praca efekty przyniosla
end

selfSay('hahaha :D jeszcze jeden?')
talk_start = os.clock()
end


if (string.find(msg, '(%a*)bye(%a*)') or string.find(msg, '(%a*)nara(%a*)') or string.find(msg, '(%a*)nie(%a*)') or string.find(msg, '(%a*)narazie(%a*)')) and focus == cid and getDistanceToCreature(cid) < 4 then

rsay = math.random(1,4)
if rsay == 1 then says = 'Nara'
elseif rsay == 2 then says = 'Narazie'
elseif rsay == 3 then says = '3maj sie'
elseif rsay == 4 then says = 'CYA'
end

selfSay(says .. ' ' .. creatureGetName(cid) .. '!')
focus = 0
talk_start = 0
end
end

-- script by ostry

function onCreatureChangeOutfit(creature)

end


function onThink()
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Nastepny...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Nara!')
focus = 0
end
end
if focus == 0 then
cx, cy, cz = selfGetPosition()
randmove = math.random(1,10)
if randmove == 1 then
nx = cx + 1
end
if randmove == 2 then
nx = cx - 1
end
if randmove == 3 then
ny = cy + 1
end
if randmove == 4 then
ny = cy - 1
end
if randmove >= 5 then
nx = cx
ny = cy
end
moveToPosition(nx, ny, cz)
end
end
PostWysłany:Pon 14:28, 05 Mar 2007
graphic
Top of page
graphic

graphic graphic
Matiis Temat postu:


Administrator
Dołączył: 03 Mar 2007
Posty: 63
Przeczytał: 0 tematów

Ostrzeżeń: 0/100
Skąd: Prosto z forum tibia.org.pl

Nieźle ale to wzięte z Armii Podkarpackiego OTSa. Tam był od dawna Andy który mówił żarty (dokładnie takie same). Znowu nie twój artykuł.
6/10
PostWysłany:Pią 21:00, 23 Mar 2007

Post został pochwalony 0 razy
graphic
Zobacz profil autora Top of page
graphic

graphic
Napisz nowy temat   Odpowiedz do tematu
graphic
Forum OTS 7.92 Pepsi Strona Główna » Skrypty do OTS
graphic
   
graphic

graphic graphic
Wyświetl posty z ostatnich:   
Skocz do:  
Zobacz poprzedni temat :: Zobacz następny temat


Strona 1 z 1
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
graphic graphic


fora.pl - załóż własne forum dyskusyjne za darmo
KDM2 template v1.0.1 © jasidog.com
Powered by phpBB © 2001, 2002 phpBB Group
Obecny czas to Wto 21:01, 23 Kwi 2024. Wszystkie czasy w strefie EET (Europa)
Regulamin