Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local keywordHandler = KeywordHandler:new()
- local npcHandler = NpcHandler:new(keywordHandler)
- NpcSystem.parseParameters(npcHandler)
- local talkState = {}
- function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
- function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
- function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
- function onThink() npcHandler:onThink() end
- function creatureSayCallback(cid, type, msg)
- if(not npcHandler:isFocused(cid)) then
- return false
- end
- local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
- local money = getPlayerItemCount(cid,2160)*10
- local pos = {x=1012,y=1014,z=7}
- local pos1 = getCreaturePosition(cid)
- if msgcontains(msg, 'primeira fase') or msgcontains (msg, 'first') then
- selfSay('Voce quer participar da primeira fase?')
- talkState[talkUser] = 1
- elseif talkState[talkUser] == 1 then
- if msgcontains(msg, 'yes') then
- selfSay('Bora jogar !.', cid)
- doTeleportThing(cid,pos)
- doPlayerSendTextMessage(cid,21,"Boa-Sorte a primeira fase")
- doSendMagicEffect(pos1,2)
- talkState[talkUser] = 0
- elseif msgcontains(msg, 'segunda fase') or msgcontains (msg, 'segunda') then
- if getPlayerStorageValue(uid, 210000) then
- selfSay('Voce quer participar da segunda fase?')
- talkState[talkUser] = 2
- else
- selfSay('Voce nao completou a primeira fase', cid)
- talkState[talkUser] = 0
- end
- elseif talkState[talkUser] == 2 then
- if msgcontains(msg, 'yes') then
- selfSay('Bora jogar !.', cid)
- doPlayerSendTextMessage(cid,21,"Boa-Sorte a segunda fase")
- talkState[talkUser] = 2
- end
- return true
- end
- end
- end
- npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
- npcHandler:addModule(FocusModule:new())
Advertisement
Add Comment
Please, Sign In to add comment