Witam wszystkichh
mam takie pytanie, co jest tutaj ?le zrobione, ?e jak pisze do NPC to rozpisuje mi sie tylko na temat pacc oraz czary, ale np jak napisz sorc, knight , domki albo cos innego to juz nie trybi :vroam:
[LUA]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('Siemanko ' .. creatureGetName(cid) .. '! Co bys chcial wiedziec na temat servera? /n "pacc" /n "czary /n "przedmioty" /n "przedzial" /n "domki". ')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Przykro mi, ' .. creatureGetName(cid) .. '! Musisz chwileczke zaczekac.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'pacc') then
selfSay('Witaj! Pacc runa (60h) kosztuje sms 3.76 zl /n Pacc runa (180h) kosztuje sms 11.07 zl. /n Jezeli jestesmy w posiadaniu PACCa to mamy dostep do nowych potworow, przedmiotow, questow oraz czarow, a takze mozemy kupowac domki.')
elseif msgcontains(msg, 'czary') then
selfSay('Aby korzystac z nowych czarow, trzeba posiadac PACC! Czary dla jakiej profesji Cie interesuja? "Sorc" , "Druid" , "Pall" , "Knight" .')
elseif msgcontains(msg, 'Sorc') then
selfSay('Death sio "nick od 45 poziomu magicznego.')
elseif msgcontains(msg, 'Druid') then
selfSay('Druid posiada dostep do run paralizujacych (od 35 poz. magicznego) oraz z tzw. "krzakow" (od 35 poz. magicznego) . /n Rowniez posiada czar Death sio "nick od 45 poziomu magicznego.')
elseif msgcontains(msg, 'Pall') then
selfSay('Exura San (od 13 poz. mag.) /n Exura Gran San (od 23 poz. mag.) /n Utamo Tempo San (od 15 poz. mag.) /n Exevo Mas San (od 20 poz. mag.) /n Poison sio "nick ( od 17 poz. mag.) .')
elseif msgcontains(msg, 'Knight') then
selfSay('Exana Mort (od 3 poz. mag.) /n Utani Tempo Hur (od 5 poz. mag) /n Exori mas (od 4 poz. mag.) Exori Gran (od 7 poz. mag.) /n Explosion sio"nick (od 4 poz. mag.).')
elseif msgcontains(msg, 'Przedmioty') then
selfSay('Na serverze sa przedmioty, ktore dodaja mane/hp, rowniez sa nowe bronie, ktorych moc sie nie konczy! Sa rowniez pierscienie, ktore daja 2x wiecej expa, ale nic nie przebije EQ, ktore redukuje 25% zadawanych obrazen i drugie 25% dodaje do atakow !!')
elseif msgcontains(msg, 'Przedzial') then
selfSay('Server posiada bramki PvP /n 1-50, /n 51-100, /n 101-150, /n 151-200, /n 201-300, /n 301-500, /n 501+ .')
elseif msgcontains(msg, 'Domki') then
selfSay('Domku kupujemy komenda !buyhouse. Aby kupic domek musimy posiadac pacc, jak i zarowno setny poziom.')
elseif string.find(msg, '(%a*)bye(%a*)') and getDistanceToCreature(cid) < 4 then
selfSay('Powodzenia, ' .. 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('Zobaczymy czy wam sie uda...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Good bye then.')
focus = 0
end
end
end
[/LUA]
mam takie pytanie, co jest tutaj ?le zrobione, ?e jak pisze do NPC to rozpisuje mi sie tylko na temat pacc oraz czary, ale np jak napisz sorc, knight , domki albo cos innego to juz nie trybi :vroam:
[LUA]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('Siemanko ' .. creatureGetName(cid) .. '! Co bys chcial wiedziec na temat servera? /n "pacc" /n "czary /n "przedmioty" /n "przedzial" /n "domki". ')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Przykro mi, ' .. creatureGetName(cid) .. '! Musisz chwileczke zaczekac.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'pacc') then
selfSay('Witaj! Pacc runa (60h) kosztuje sms 3.76 zl /n Pacc runa (180h) kosztuje sms 11.07 zl. /n Jezeli jestesmy w posiadaniu PACCa to mamy dostep do nowych potworow, przedmiotow, questow oraz czarow, a takze mozemy kupowac domki.')
elseif msgcontains(msg, 'czary') then
selfSay('Aby korzystac z nowych czarow, trzeba posiadac PACC! Czary dla jakiej profesji Cie interesuja? "Sorc" , "Druid" , "Pall" , "Knight" .')
elseif msgcontains(msg, 'Sorc') then
selfSay('Death sio "nick od 45 poziomu magicznego.')
elseif msgcontains(msg, 'Druid') then
selfSay('Druid posiada dostep do run paralizujacych (od 35 poz. magicznego) oraz z tzw. "krzakow" (od 35 poz. magicznego) . /n Rowniez posiada czar Death sio "nick od 45 poziomu magicznego.')
elseif msgcontains(msg, 'Pall') then
selfSay('Exura San (od 13 poz. mag.) /n Exura Gran San (od 23 poz. mag.) /n Utamo Tempo San (od 15 poz. mag.) /n Exevo Mas San (od 20 poz. mag.) /n Poison sio "nick ( od 17 poz. mag.) .')
elseif msgcontains(msg, 'Knight') then
selfSay('Exana Mort (od 3 poz. mag.) /n Utani Tempo Hur (od 5 poz. mag) /n Exori mas (od 4 poz. mag.) Exori Gran (od 7 poz. mag.) /n Explosion sio"nick (od 4 poz. mag.).')
elseif msgcontains(msg, 'Przedmioty') then
selfSay('Na serverze sa przedmioty, ktore dodaja mane/hp, rowniez sa nowe bronie, ktorych moc sie nie konczy! Sa rowniez pierscienie, ktore daja 2x wiecej expa, ale nic nie przebije EQ, ktore redukuje 25% zadawanych obrazen i drugie 25% dodaje do atakow !!')
elseif msgcontains(msg, 'Przedzial') then
selfSay('Server posiada bramki PvP /n 1-50, /n 51-100, /n 101-150, /n 151-200, /n 201-300, /n 301-500, /n 501+ .')
elseif msgcontains(msg, 'Domki') then
selfSay('Domku kupujemy komenda !buyhouse. Aby kupic domek musimy posiadac pacc, jak i zarowno setny poziom.')
elseif string.find(msg, '(%a*)bye(%a*)') and getDistanceToCreature(cid) < 4 then
selfSay('Powodzenia, ' .. 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('Zobaczymy czy wam sie uda...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Good bye then.')
focus = 0
end
end
end
[/LUA]