Forum ...::[2e]::...::[2e]::...::[2e]::... Strona Główna
FAQ Szukaj Użytkownicy Grupy Profil Zaloguj się, by sprawdzić wiadomości
Forum ...::[2e]::...::[2e]::...::[2e]::... Strona Główna  Zaloguj  Rejestracja
Npc sprzedający kolorowe bp

 
Napisz nowy temat   Odpowiedz do tematu    Forum ...::[2e]::...::[2e]::...::[2e]::... Strona Główna -> Publikacje do OTS'ów
Zobacz poprzedni temat :: Zobacz następny temat  
Autor Wiadomość
Adminjacek
Administrator
Administrator



Dołączył: 28 Paź 2006
Posty: 58
Przeczytał: 0 tematów

Ostrzeżeń: 0/10

PostWysłany: Czw 21:41, 09 Lis 2006    Temat postu: Npc sprzedający kolorowe bp

Witam chcialbym przedstawic NPCa sprzedajacego wszystkie rodzaje backpackow oswiadczam ze to jest moj wlasny NPC. Bedzie on mial imie Verpan(mozna zmienic).

To wklejamy do data/npc/verpan.xml - trzeba bedzie stworzyc
Kod:

<?xml version="1.0"?>
<npc name="Verpan" script="data/npc/scripts/bag.lua" access="3">
<look type="129" head="150" body="119" legs="116" feet="76"/>
</npc>


To wklejamy do data/npc/scripts/bag.lua - trzeba bedzie strzoyc

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 (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfSay('Hello ' .. creatureGetName(cid) .. '! I sell backpacks in all colors.')
focus = cid
talk_start = os.clock()

elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.')

elseif focus == cid then
talk_start = os.clock()

if msgcontains(msg, 'backpacks') and focus == cid then
selfSay('I sell normal, yellow, gold, blue, red, purple, green and silver backpacks.')
focus = cid
talk_start = os.clock()
end

if msgcontains(msg, 'normal backpack') then
buy(cid,1988,1,25)
elseif msgcontains(msg, 'yellow backpack') then
buy(cid,1999,1,25)
elseif msgcontains(msg, 'gold backpack') then
buy(cid,2004,1,25)
elseif msgcontains(msg, 'blue backpack') then
buy(cid,2002,1,25)
elseif msgcontains(msg, 'red backpack') then
buy(cid,2000,1,25)
elseif msgcontains(msg, 'purple backpack') then
buy(cid,2001,1,25)
elseif msgcontains(msg, 'green backpack') then
buy(cid,1998,1,25)
elseif msgcontains(msg, 'silver backpack') then
buy(cid,2003,1,25)

elseif msgcontains(msg, 'bye') and focus == cid and getDistanceToCreature(cid) < 4 then
selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
focus = 0
talk_start = 0
end
end
end


function onCreatureChangeOutfit(creature)

end


function onThink()
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Next Please...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Good bye then.')
focus = 0
end
end
end





To wszystko moze malo przydatny NPC ale urozmaica OTS ktory przez to staje sie bardziej kolorowy i nasz EQ wyglada lepiej


Post został pochwalony 0 razy
Powrót do góry
Zobacz profil autora
Autor Wiadomość
darek_popek
Cichy Gaduła
Cichy Gaduła



Dołączył: 04 Lis 2006
Posty: 29
Przeczytał: 0 tematów

Ostrzeżeń: 2/10

PostWysłany: Sob 20:54, 18 Lis 2006    Temat postu:

Spoko Razz
SE wlasnei zrobie otsa chyba pod 7.81 Chetnei skorzystam z tego Dziekuje!


Post został pochwalony 0 razy
Powrót do góry
Zobacz profil autora
Autor Wiadomość
Adminjacek
Administrator
Administrator



Dołączył: 28 Paź 2006
Posty: 58
Przeczytał: 0 tematów

Ostrzeżeń: 0/10

PostWysłany: Sob 20:56, 18 Lis 2006    Temat postu:

Oka spoko

Post został pochwalony 0 razy
Powrót do góry
Zobacz profil autora
Autor Wiadomość
Adminjacek
Administrator
Administrator



Dołączył: 28 Paź 2006
Posty: 58
Przeczytał: 0 tematów

Ostrzeżeń: 0/10

PostWysłany: Śro 14:20, 29 Lis 2006    Temat postu:

No ***** piszcie coś ;/

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 ...::[2e]::...::[2e]::...::[2e]::... Strona Główna -> Publikacje do OTS'ów Wszystkie czasy w strefie CET (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
Powered by phpBB © 2001, 2002 phpBB Group
BBTech Template by © 2003-04 MDesign
Regulamin