Tibia Forum Tibia Forum
Forum o Tibii.
Tibia Forum
FAQFAQ  SzukajSzukaj  RejestracjaRejestracja  ProfilProfil  UżytkownicyUżytkownicy  GrupyGrupy  GalerieGalerie  Zaloguj się, by sprawdzić wiadomościZaloguj się, by sprawdzić wiadomości  ZalogujZaloguj 

NPC EQ SELLER

 
Odpowiedz do tematu    Forum Tibia Forum Strona Główna -> Skrypty do OTS
Zobacz poprzedni temat :: Zobacz następny temat  
Autor Wiadomość
Xarin
Nowy



Dołączył: 07 Lis 2006
Posty: 19
Przeczytał: 0 tematów

Ostrzeżeń: 0/10
Skąd: Poland

PostWysł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 Smile

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"/>


Post został pochwalony 0 razy
Powrót do góry
Zobacz profil autora
Wyświetl posty z ostatnich:   
Odpowiedz do tematu    Forum Tibia Forum Strona Główna -> Skrypty do OTS Wszystkie czasy w strefie EET (Europa)
Strona 1 z 1

 
Skocz do:  
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

Arthur Theme
Regulamin