Tibia Forum
Forum o Tibii.
FAQ
Szukaj
Rejestracja
Profil
Użytkownicy
Grupy
Galerie
Zaloguj się, by sprawdzić wiadomości
Zaloguj
Forum Tibia Forum Strona Główna
->
Skrypty do OTS
Napisz odpowiedź
Użytkownik
Temat
Treść wiadomości
Emotikony
Więcej Ikon
Kolor:
Domyślny
Ciemnoczerwony
Czerwony
Pomarańćzowy
Brązowy
Żółty
Zielony
Oliwkowy
Błękitny
Niebieski
Ciemnoniebieski
Purpurowy
Fioletowy
Biały
Czarny
Rozmiar:
Minimalny
Mały
Normalny
Duży
Ogromny
Zamknij Tagi
Opcje
HTML:
TAK
BBCode
:
TAK
Uśmieszki:
TAK
Wyłącz HTML w tym poście
Wyłącz BBCode w tym poście
Wyłącz Uśmieszki w tym poście
Kod potwierdzający: *
Wszystkie czasy w strefie EET (Europa)
Skocz do:
Wybierz forum
Zasady Forum
----------------
Regulamin
Ogólne
----------------
Niusy
O wszystkim i o niczym
Pomoc w Tibii
Przygody
Poradniki
Open Tibia Server
----------------
Mapy
Skrypty do OTS
Prywatne OTServery
Problemy Techniczne
Zdjęcia
----------------
Artyści
Polowania
Zabawne
Inne
Fotomontaże
Handel
----------------
Przedmioty
Postacie
Przegląd tematu
Autor
Wiadomość
Xarin
Wysłany: Wto 20:58, 07 Lis 2006
Temat postu: NPC EQ SELLER
Nie jest to mój skrypt ale mało tu skryptów więc wpisze
Wchodzimy do ots\data\npc\scripts tworzymy tam eq.lua
Dodajemy Tam
-- Respawn position set
--ox = 145
--oy = 54
--oz = 7
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) < 4 then
selfSay('Hello ' .. creatureGetName(cid) .. '! I sell crown armors(1cc)/legs(1cc 50platek) , knight armors(50 platek)/legs(1cc) , fire axes (2cc) , royal helmets(2cc) and bohy (2cc 50 platek)!')
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) .. '! I talk to you in a minute.')
end
if msgcontains(msg, 'royal helmet') and focus == cid then
buy(cid,2498,1,20000)
talk_start = os.clock()
end
if msgcontains(msg, 'knight armor') and focus == cid then
buy(cid,2476,1,5000)
talk_start = os.clock()
end
if msgcontains(msg, 'knight legs') and focus == cid then
buy(cid,2477,1,10000)
talk_start = os.clock()
end
if msgcontains(msg, 'fire axe') and focus == cid then
buy(cid,2432,1,20000)
talk_start = os.clock()
end
if msgcontains(msg, 'crown armor') and focus == cid then
buy(cid,2487,1,10000)
talk_start = os.clock()
end
if msgcontains(msg, 'crown legs') and focus == cid then
buy(cid,2488,1,15000)
talk_start = os.clock()
end
if msgcontains(msg, 'bohy') and focus == cid then
buy(cid,2195,1,25000)
talk_start = os.clock()
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('Next Please...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Good bye then.')
focus = 0
end
end
end
Teraz wchodzimy do data\npc i tworzymy tam eq seller.xml
Dodajemy Tam
<?xml version="1.0"?>
<npc name="Eq Seller" script="data/npc/scripts/eq.lua" access="3" lookdir="3">
<health now="1000" max="1000"/>
<look type="131" head="114" body="114" legs="114" feet="114"/>
</npc>
Tera wchodzimy do data\world\npc.xml
Dopisujemy Tam
<npc name="Eq Seller" x="135" y="58" z="6" dir="1"/>
fora.pl
- załóż własne forum dyskusyjne za darmo
Powered by
phpBB
© 2001, 2002 phpBB Group
Arthur Theme
Regulamin