Obecny czas to Śro 9:09, 24 Kwi 2024 | Zaloguj się, by sprawdzić wiadomości
Zobacz posty bez odpowiedzi
Forum Forum prywatnego serwera Black-Hole pod TIBIE 7.6 Strona GłównaForum Forum prywatnego serwera Black-Hole pod TIBIE 7.6 Strona Główna
Użytkownicy Grupy Rejestracja Zaloguj

npc
Napisz nowy temat   Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi    Forum Forum prywatnego serwera Black-Hole pod TIBIE 7.6 Strona Główna » HYDEPARK
Zobacz poprzedni temat | Zobacz następny temat  
Autor Wiadomość
Magic`ian



Dołączył: 20 Gru 2006
Posty: 12
Przeczytał: 0 tematów

Ostrzeżeń: 0/5
Skąd: Przeważnie z Edron

PostWysłany: Pon 16:10, 25 Gru 2006    Temat postu: npc

tu daje 1 npc

Santa Claus by Devoy (edit by Siwek Wink

Witam. Chociaż święta już minęły to i tak zapewne na OTS chcieli byście nadal mieć świętego mikołajam który na dodatek chodzi Very Happy Tak więc postanowiłem go tutaj umieścić Laughing Po 1 skypt nie jest mój lecz jednego z użytkowiników forum [link widoczny dla zalogowanych] który robi świetne skypty Devoya Very Happy

Więc tak:
Wchodzimy w data/npc
Tworzymy plik Santa Claus.xml
Otwieramy go notatnikiem i wklejamy ten oto kod:
Cytat:
<?xml version="1.0"?>
<npc name="Santa Claus" script="data/npc/scripts/santa.lua" access="3" lookdir="2">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="160" head="0" body="94" legs="0" feet="94"/>
</npc>


Następnie w folderze NPC wchodzimy w scripts i tworzymy tam plik santa.lua i jego treść powinna być następująca:
Cytat:
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('Merry Christmas!')
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('Merry Christmas ' .. creatureGetName(cid) .. '!')
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) .. '! Please wait.')
end

if string.find(msg, '(%a*)present(%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('Sorry, I dont have more presents for you.')
end
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('Merry Christmas!')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 3 then
selfSay('Merry Christmas!')
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,6)
if rand == 1 then
item = 2930
elseif rand == 2 then
item = 2129
elseif rand == 3 then
item = 3187
elseif rand == 4 then
item = 3194
elseif rand == 5 then
item = 3200
else
item = 3537
end
end

if focus == 0 then
randsay = math.random(1,75)
if randsay == 1 then
selfSay('Hmmhmm...')
end
if randsay == 2 then
selfSay('Hoho...')
end
end
end



Jedyne co poprawiłem to zmieniłem po prostu numer ID prezentów, które rozdaje święty mikołaj Wink


Post został pochwalony 0 razy
...
Zobacz profil autora
Powrót do góry
Napisz nowy temat   Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi    Forum Forum prywatnego serwera Black-Hole pod TIBIE 7.6 Strona Główna » HYDEPARK
Wyświetl posty z ostatnich:   
 
 
Wszystkie czasy w strefie EET (Europa)
Skocz do:  

Strona 1 z 1


Możesz pisać nowe tematy
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, 2002 phpBB Group

Theme created OMI of Kyomii Designs for BRIX-CENTRAL.tk.