function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Zegnaj.')
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')
elseif msgcontains(msg, 'quest') then
if getPlayerStorageValue(cid,1091) == 3 then
selfSay('Juz wykonales zadanie.')
else
if getPlayerStorageValue(cid,1091) == 2 then
if doPlayerRemoveItem(cid,2347,1) == 0 then
selfSay('Nie masz dla mnie marchewek!')
else
selfSay('Dziekuje Ci! Wzamian przenosze cie na inna wyspe.')
setPlayerStorageValue(cid,1091,3)
doTeleportThing(cid,{x=1040, y=1070, z=7})
end
else
end
end
end
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Nastepny!')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Zegnaj.')
focus = 0
end
end
end