FAQFAQ   SzukajSzukaj   UżytkownicyUżytkownicy   GrupyGrupy   GalerieGalerie www.generationforum.fora.pl 
 ProfilProfil   Zaloguj się, by sprawdzić wiadomościZaloguj się, by sprawdzić wiadomości   ZalogujZaloguj 
 
projekt miasto pelne zycia

 
Napisz nowy temat   Odpowiedz do tematu    Forum www.generationforum.fora.pl Strona Główna -> Scripts

Faden
Moderator



Dołączył: 01 Paź 2008
Posty: 41
Przeczytał: 0 tematów

Pomógł: 1 raz
Ostrzeżeń: 0/5
Skąd: Lublin

PostWysłany: Nie 10:33, 26 Paź 2008    Temat postu: projekt miasto pelne zycia
 
Witajcie wszyscy zainteresowani projektem Miasto Pelne Zycia.
W tym temacie będe zamieszczał NPC TYLKO swojej produkcji.
Chce stworzyć miasto, w którym npc będą mniej schematyczni niż w Ots'ach czy nawet w prawdziwej Tibi.

Pierszym owocem mojej pracy jest Npc targujący się.
Idealna postać do questu do umieszczenia w bocznej uliczce Pustynnego miasta. Ma on na sprzedarz klucz i chce za niego 30000 sztuk złota, jednak może sprzedać TANIEJ , jesli sie potargujemy.


focus = 0
talk_start = 0
target = 0
following = false
attacking = false
surv = false
inf = false
dund = false
jungle = false


function onThingMove(creature, thing, oldpos, oldstackpos)

end


function onCreatureAppear(creature)

end


function onCreatureDisappear(id, stackpos)
if id == focus then
focus = 0
surv = false
inf = false
dund = false
jungle = false
selfSay("Wiec odejdz butny bohaterze.")
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) < 3 then
selfSay('Aa.., ' .. creatureGetName(cid) .. ',Co taki ubogi handlarz jak ja moze ci zaoferowac ?')
focus = cid
talk_start = os.clock()
end


if msgcontains(msg, 'klucz') and focus == cid then
selfSay('Mam taki jeden klucz... Prowadzi ponoc do legendarnego skarbca, co ty na to ?')
talk_start = os.clock()
end


if msgcontains(msg, 'buy klucz') and focus == cid then
selfSay('Ah., ' .. creatureGetName(cid) .. '. Jak dla ciebie szlachetny panie tylko 30000sztuk zlota.')
talk_start = os.clock()
surv = true
end

if msgcontains(msg, 'potargujmy sie') and focus == cid then
selfSay('Hm..., ' .. creatureGetName(cid) .. '. Nie zejde ponizej 25000.')
talk_start = os.clock()
inf = true
surv = false
end

if msgcontains(msg, 'za duzo') and focus == cid then
selfSay('Chcesz mnie okrasc ?, ' .. creatureGetName(cid) .. '. 20000 Nie ustapie')
talk_start = os.clock()
jungle = true
inf = false
end

if msgcontains(msg, 'jeszcze mniej') and focus == cid then
selfSay('Ty synu karalucha !!!, 10000 NIE MNIEJ')
talk_start = os.clock()
dund = true
jungle = false
end



if ((string.find(msg, '(%a*)yes(%a*)')) and (focus == cid)) and surv == true then
buy(cid,2419,1,30000)
selfSay('Oto twoj klucz.To uczciwa cena.')
focus = 0
survival = false
inf = false
dund = false
jungle = false

talk_start = 0
end

if ((string.find(msg, '(%a*)yes(%a*)')) and (focus == cid)) and inf == true then
buy(cid,2419,1,25000)
selfSay('POlecam sie.')
focus = 0
survival = false
inf = false
dund = false

jungle = false
talk_start = 0
end

if ((string.find(msg, '(%a*)yes(%a*)')) and (focus == cid)) and jungle == true then
buy(cid,2419,1,20000)
selfSay('Oto twoj klucz.')
focus = 0
survival = false
inf = false
dund = false
jungle = false
talk_start = 0
end

if ((string.find(msg, '(%a*)yes(%a*)')) and (focus == cid)) and dund == true then
buy(cid,2419,1,10000)
selfSay('Dobry z ciebie negocjator.')
focus = 0
survival = false
inf = false
dund = false
jungle = false
talk_start = 0
end






if string.find(msg, '(%a*)bye(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 then
selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
focus = 0
surv = false
inf = false
dund = false
jungle = false
talk_start = 0
end


end


function onCreatureChangeOutfit(creature)

end


function onThink()
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Hmm... Namysl sie a ja tu popracuje')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Odejdz wiec...')
focus = 0
end
end
if focus == 0 then
cx, cy, cz = selfGetPosition()
randmove = math.random(1,20)
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)
--summons = 30
--summons2 = 30
end

end


Post został pochwalony 0 razy
Powrót do góry
Zobacz profil autora
Napisz nowy temat   Odpowiedz do tematu    Forum www.generationforum.fora.pl Strona Główna -> Scripts
Strona 1 z 1

Wyświetl posty z ostatnich:   
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

 
Skocz do:  


fora.pl - załóż własne forum dyskusyjne za darmo
Skin Created by: Sigma12
Powered by phpBB © 2001, 2002 phpBB Group
Regulamin