Autor Wiadomość
Torba
PostWysłany: Sob 14:55, 03 Lut 2007    Temat postu: DiAlOgI NpC`ków

Jezeli ktos ma OTS i chce by tylko Polscy gracze na nim grali, a obcokrajowcom WON to proponuje latwy sposob na odganianie leszczy z podowrka :p a mianowicie zmiana dialogu npc z Angielskiego na Polski.

Wiec czas zacząc... Przedstaawie wam pewnego dosc nietypowego npc Pirata Jacka. Na początek wchodzimy do OTS/data/npc/scripts nastepnie wybieramy jack i pokazuje nam sie ustawienia dialogu wybranego npc. Zostawiamy te linijki w spokoju

-- the id of the creature we are attacking, following, etc.

focus = 0
talk_start = 0
target = 0
following = false
attacking = false

function onThingMove(creature, thing, oldpos, oldstackpos)

end


function onCreatureAppear(creature)

end

Potem mamy kolejne linijki w ktorych mozna cos zmienic :p



function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Good bye then.')
focus = 0
talk_start = 0
end
end

a dokladniej w miejscu Good bye Then wpisujemy np. NarQua Smieciu xD ;]

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

to zostawiamy w pokoju. A z koleji tutaj wstawiamy co chcemy a dokladniej w miejsce hello i sell beer and wine for 10gp . PAMIETAJCIE ZMIENIAJCIE TYLKO TO CO JEST W CUDZYSLOWIACH INACZEJ CALY PLIK ZOSTANIE ZNISZCZONY PRZEZ MOJą BABCIE !!!!


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 beer and wine for 10 gp.')
focus = cid
talk_start = os.clock()
end

if string.find(msg, '(%a*)hi(%a*)') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Leave us alone, ' .. creatureGetName(cid) .. '!')
end if msgcontains(msg, 'buy beer') and focus == cid then
buy(cid,2006,3,10)
talk_start = os.clock()

Jezeli umiecie angielski i wiecie o co chodzi to poprstu przetlumaczcie sobie wszystkie gadki npc. Powinniescie sie domyslec co mowi npc a co gracz


w tych l;inijkach nic nie zmieniamy jakby ktos nie kumal to co w nawiasie mowi gracz


if msgcontains(msg, 'buy wine') and focus == cid then
buy(cid,2006,15,10)
talk_start = os.clock()
end


THE END nie ebde wiecej podawal powinniescie sami zrozumiec o co chodzi ja tu tylko tlumacze, ale dal niekumatych juz totalnie podam przyklad zrobionego npceka




-- the id of the creature we are attacking, following, etc.

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('NarQua.')
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('Siemka lumpie, ' .. creatureGetName(cid) .. '! Sprzedaje piwo i wino za 10 gp.')
focus = cid
talk_start = os.clock()
end

if string.find(msg, '(%a*)hi(%a*)') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Odwal sie imprezowy chloptasiu, ' .. creatureGetName(cid) .. '!')
end if msgcontains(msg, 'piwo') and focus == cid then
buy(cid,2006,3,10)
talk_start = os.clock()
end

if msgcontains(msg, 'wino') and focus == cid then
buy(cid,2006,15,10)
talk_start = os.clock()
end

if msgcontains(msg, 'quest') and focus == cid then
talk_start = os.clock()
queststatus = getPlayerStorageValue(cid,5019)

if queststatus == -1 then
selfSay('Kiedy uciekalem ze statku, w jednej z beczek ukrylem kosztowny artefakt . Moglbys przyniesc go dla mnie?.')
else
selfSay('Cholerni poszukiwacze przygod!! Zawsze szukaja klopotow!')
end
end

if msgcontains(msg, 'statek') and focus == cid then
selfSay('Moj statek znajduje sie na pustyni. Nie Wyglada najlepiej ale dalej mozna nim plywac. Oczywiscie jezeli wiesz jak nim sterowac.')
talk_start = os.clock()
end

if msgcontains(msg, 'sterowanie') and focus == cid then
talk_start = os.clock()
queststatus = getPlayerStorageValue(cid,5019)

if queststatus == -1 then
selfSay('Jesli chcesz sie nauczyc sterowac, przynies mi artefakt ze statku.')
else
selfSay('Wiesz juz wszystko Przysiegam.')
end
end

if msgcontains(msg, 'artefakt') and focus == cid then
talk_start = os.clock()
queststatus = getPlayerStorageValue(cid,5019)

if queststatus == -1 then
itemstatus = doPlayerRemoveItem(cid,2342)

if itemstatus == -1 then
selfSay('Jest w jednej z beczek, szukaj pod pokladem.')
else
setPlayerStorageValue(cid,5019,1)
selfSay('DZieki Zioom! Zeby poplynac poprostu kliknij na ster.')
end
else
selfSay('Ten helm nalerzy do mnie.')
end
end

if string.find(msg, '(%a*)bye(%a*)') and focus == cid and getDistanceToCreature(cid) < 4 then
selfSay('NarQa, ' .. 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('Smyraj.')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('NarX.')
focus = 0
end
end
end




POZDRO TIBIA ROXX !!!



Twisted Evil

Powered by phpBB © 2001,2002 phpBB Group