Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local focus = 0
- local talk_start = 0
- local target = 0
- local following = false
- local attacking = false
- function onThingMove(creature, thing, oldpos, oldstackpos)
- end
- function onCreatureAppear(creature)
- end
- function onCreatureDisappear(cid, pos)
- if focus == cid then
- selfSay('?????.')
- 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('Hello. If you ready I can "renascer" you.')
- focus = cid
- talk_start = os.clock()
- elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
- selfSay('Sorry, ' .. getCreatureName(cid) .. '! Hey!.')
- elseif focus == cid then
- talk_start = os.clock()
- if msgcontains(msg, 'renascer') and getPlayerStorageValue(cid,30023) == 4 then
- selfSay('desculpe, você ja renasceu.')
- focus = 0
- talk_start = 0
- elseif msgcontains(msg, 'reborn') and getPlayerLevel(cid) < 250 and getPlayerStorageValue(cid,30023) ~= 4 then
- selfSay('Hehe, I say If you READY. You do not have 250 level.')
- elseif msgcontains(msg, 'renascer') then
- selfSay('Are you sure?')
- talk_state = 2
- elseif msgcontains(msg, 'yes') and talk_state ==2 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 21 then
- doPlayerSetVocation(cid, 22)
- setPlayerStorageValue(cid,30025,4)
- talk_state = 0
- elseif msgcontains(msg, 'yes') and talk_state == 2 then
- selfSay('Sorry, ' .. getCreatureName(cid) .. '! Você não pode mais evoluir.')
- elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
- selfSay('Good bye.')
- focus = 0
- talk_start = 0
- end
- end
- end
- function onThink()
- doNpcSetCreatureFocus(focus)
- if (os.clock() - talk_start) > 45 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
Advertisement
Add Comment
Please, Sign In to add comment