FAQ   Szukaj   Użytkownicy   Grupy   Galerie   Rejestracja   Profil   Zaloguj się, by sprawdzić wiadomości   Zaloguj     
Santa Claus (Mikolaj)

 
Napisz nowy temat   Odpowiedz do tematu    Forum www.tylkootibi.fora.pl Strona Główna :: Ots
Zobacz poprzedni temat :: Zobacz następny temat  
Autor Wiadomość
Knugi
Administrator



Dołączył: 24 Gru 2009
Posty: 5
Przeczytał: 0 tematów

Ostrzeżeń: 0/5

PostWysłany: Pon 12:22, 28 Gru 2009    Temat postu: Santa Claus (Mikolaj)

Przedstawiam wam npc Santa Claus:
Wchodzimy w
Kod:
data/npc
i tworzymy plik
Kod:
Santa Claus.xml

w ktorym wklejamy:
Kod:
<?xml version="1.0"?>
<npc name="Mikolaj" script="data/npc/scripts/mikolaj.lua" access="3">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="2105" head="0" body="94" legs="0" feet="94"/>
</npc>

Następnie wchodzimy w
Kod:
data/npc/script
i tworzymy plik
Kod:
mikolaj.lua
W którym wklejamy to:
Kod:
-- by Arthas dla tibia.net.pl
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('Wesolych swiat balwanie!')
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('Witaj ' .. creatureGetName(cid) .. '! Byles grzeczny w tym roku? Jezeli tak to tatus przyniosl ci (Prezent)')
focus = cid
talk_start = os.clock()
end
if string.find(msg, '(%a*)hi(%a*)') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Hohoh ' .. creatureGetName(cid) .. '! Czekaj.')
end
if string.find(msg, '(%a*)prezent(%a*)') and focus == cid and getDistanceToCreature(cid) < 4 then
present = getPlayerStorageValue(cid,1210)
if present == -1 then
buy(cid,item,1,0)
setPlayerStorageValue(cid,1210,1)
end
if present == 1 then
selfSay('Wzales juz swoj prezent! Nie oszukasz starego Mikolaja!')
end
end
if string.find(msg, '(%a*)bye(%a*)') and focus == cid and getDistanceToCreature(cid) < 4 then
selfSay('Wesolych swiat, ' .. 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('WESOLYCH SWIAT!')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 3 then
selfSay('WESOLYCH SWIAT!')
focus = 0
end
end
if focus == 0 then
cx, cy, cz = selfGetPosition()
randmove = math.random(1,25)
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
if focus > 0 then
rand = math.random(1,8)
if rand == 1 then
item = 4328
elseif rand == 2 then
item = 4329
elseif rand == 3 then
item = 2137
elseif rand == 4 then
item = 2349
elseif rand == 5 then
item = 2354
elseif rand == 6 then
item = 2356
elseif rand == 7 then
item = 2160
else
item = 2160
end
end
if focus == 0 then
randsay = math.random(1,80)
if randsay == 1 then
selfSay('Hohoho...')
end
if randsay == 2 then
selfSay('Merry...')
end
if randsay == 3 then
selfSay('Hoho...')
end
end
end


Post został pochwalony 0 razy
Powrót do góry
Zobacz profil autora
Wyświetl posty z ostatnich:   
Napisz nowy temat   Odpowiedz do tematu    Forum www.tylkootibi.fora.pl Strona Główna :: Ots Wszystkie czasy w strefie EET (Europa)
Strona 1 z 1

 
Skocz do:  
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
     www.tylkootibi.fora.pl: Tibia     
Powered by phpBB © 2001, 2002 phpBB Group   c3s Theme © Zarron Media
Regulamin