Forum O OTS 75 i 76 Strona Główna  
 FAQ  •  Szukaj  •  Użytkownicy  •  Grupy •  Galerie   •  Rejestracja  •  Profil  •  Zaloguj się, by sprawdzić wiadomości  •  Zaloguj
 Tali Zobacz następny temat
Zobacz poprzedni temat
Napisz nowy tematOdpowiedz do tematu
Autor Wiadomość
Miki
Administrator



Dołączył: 26 Lut 2006
Posty: 17 Przeczytał: 0 tematów

Ostrzeżeń: 0/3

PostWysłany: Nie 14:27, 26 Lut 2006 Powrót do góry

Witajcie znowu
Przedstawiam wam NPC który sprzedaje np. Talony, Różne diamenty :], min. Teddy Beara
A więc zaczynajmy :]

Robimy plik Tali.xml w data/npc i wklejamy to:

Kod:
¤Code By Ryder¤
<npc name="Tali" script="data/npc/scripts/tali.lua" access="3" lookdir="1">
<health now="1000" max="1000"/>
<look type="63" head="20" body="30" legs="40" feet="50" corpse="4095"/>
</npc>

Następnie robimy Tali.lua w data/npc/scripts i wklejamy to:

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*)')) and (focus == 0)) and getDistanceToCreature(cid) < 3 then
selfSay('Whats Good, ' .. creatureGetName(cid) .. '! Choose a category for your choices: gems, big gems, spellwands, and misc. Everyone is 100k')
focus = cid
talk_start = os.clock()
elseif string.find(msg, '(%a*)hi(%a*)') and (focus ~= cid) and getDistanceToCreature(cid) < 3 then
selfSay('Omfg, ' .. creatureGetName(cid) .. '! Wait a fucking minute.')
elseif msgcontains(msg, 'talons') and focus == cid then
buy(cid,2972,50,100000)
talk_start = os.clock()
elseif msgcontains(msg, 'small sapphires') and focus == cid then
buy(cid,2967,50,100000)
talk_start = os.clock()
elseif msgcontains(msg, 'small rubies') and focus == cid then
buy(cid,2968,50,100000)
talk_start = os.clock()
elseif msgcontains(msg, 'small emeralds') and focus == cid then
buy(cid,2970,50,100000)
talk_start = os.clock()
elseif msgcontains(msg, 'white pearls') and focus == cid then
buy(cid,2964,50,100000)
talk_start = os.clock()
elseif msgcontains(msg, 'black pearls') and focus == cid then
buy(cid,2965,50,100000)
talk_start = os.clock()
elseif msgcontains(msg, 'small diamonds') and focus == cid then
buy(cid,2966,50,100000)
talk_start = os.clock()
elseif msgcontains(msg, 'small amethysts') and focus == cid then
buy(cid,2971,50,100000)
talk_start = os.clock()
elseif msgcontains(msg, 'gems') then
selfSay('I sell small sapphires, rubies, emeralds, diamonds, amethysts, white pearls and black pearls.')
elseif msgcontains(msg, 'violet gem') and focus == cid then
buy(cid,2974,1,100000)
talk_start = os.clock()
elseif msgcontains(msg, 'yellow gem') and focus == cid then
buy(cid,2975,1,100000)
talk_start = os.clock()
elseif msgcontains(msg, 'blue gem') and focus == cid then
buy(cid,2979,1,100000)
talk_start = os.clock()
elseif msgcontains(msg, 'red gem') and focus == cid then
buy(cid,2977,1,100000)
talk_start = os.clock()
elseif msgcontains(msg, 'big gems') then
selfSay('I sell blue gem, red gem, violet gem, yellow gem')
elseif msgcontains(msg, 'red spellwand') and focus == cid then
buy(cid,3013,1,100000)
talk_start = os.clock()
elseif msgcontains(msg, 'blue spellwand') and focus == cid then
buy(cid,3012,1,100000)
talk_start = os.clock()
elseif msgcontains(msg, 'yellow spellwand') and focus == cid then
buy(cid,3011,1,100000)
talk_start = os.clock()
elseif msgcontains(msg, 'green spellwand') and focus == cid then
buy(cid,3010,1,100000)
talk_start = os.clock()
elseif msgcontains(msg, 'spellwands') then
selfSay('I sell blue spellwand, red spellwand, green spellwand, yellow spellwand.')
elseif msgcontains(msg, 'blood herb') and focus == cid then
buy(cid,3669,1,100000)
talk_start = os.clock()
elseif msgcontains(msg, 'coconut') and focus == cid then
buy(cid,3527,25,100000)
talk_start = os.clock()
elseif msgcontains(msg, 'snowball') and focus == cid then
buy(cid,2930,25,100000)
talk_start = os.clock()
elseif msgcontains(msg, 'teddy bear') and focus == cid then
buy(cid,2931,1,100000)
talk_start = os.clock()
elseif msgcontains(msg, 'misc') then
selfSay('I sell blood herbs, coconut, snowball, and teddy bear')
elseif string.find(msg, '(%a*)bye(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 then
selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
focus = 0
talk_start = 0
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
if (os.clock() - talk_start) > 10 then
if focus > 0 then
selfSay('Next Please...')
end
focus = 0
end
end

Teraz otwieramy data/world/npc i wklejamy to i zmieniamy pozycje:

Kod:
<npc name="Tali" x="[Tutaj pozycje X]" y="[Tutaj pozycje Y]" z="[Tutaj pozycje Z]"/>


Post został pochwalony 0 razy
Zobacz profil autora
GrzYbeK(Axell)
Gość





PostWysłany: Pią 15:42, 02 Cze 2006 Powrót do góry

A jesli zrobie to wszystko co podales to co zrobic zeby ona sie pokazala zresetowac serva? :D
Sasuke132




Dołączył: 19 Cze 2007
Posty: 53 Przeczytał: 0 tematów

Pomógł: 2 razy
Ostrzeżeń: 0/3
Skąd: Białystok

PostWysłany: Śro 14:32, 20 Cze 2007 Powrót do góry

up@
Zawsze jak coś robisz z otsem to trzeba reseta Very Happy


Post został pochwalony 0 razy
Zobacz profil autora
Gość






PostWysłany: Pią 3:12, 08 Lut 2008 Powrót do góry

Ello
Zapraszam na OTS: Tibia 7.92
OTS Pod Hamachi:
Nazwa Sieci: OTSy
Hasło Sieci: tibia

Mega Faste Atack
Wielkie TP ROOM
24/7 OTS RUNING

OTS Runing 24/7 Serv OTS Na Odzielny Kompie
Kontakt na gg: 10599931
Pisac Wink
Wyświetl posty z ostatnich:      
Napisz nowy tematOdpowiedz do tematu


 Skocz do:   



Zobacz następny temat
Zobacz poprzedni temat
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/3 phpBB Group :: FI Theme :: Wszystkie czasy w strefie CET (Europa)