Advertisement
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
- if(msgcontains(msg, 'outfits')) then
- selfSay('Vendo {Retro Warrior} por {20 pontos}.', cid)
- selfSay('Vendo {Retro Mage} por {20 pontos}.', cid)
- selfSay('Vendo {Retro Knight} por {20 pontos}.', cid)
- selfSay('Vendo {Retro Citizen} por {20 pontos}.', cid)
- selfSay('Vendo {Retro Hunter} por {20 pontos}.', cid)
- end
- -- [Retro Warrior Outfits]
- if(msgcontains(msg, 'Retro Warrior')) then
- selfSay('Quer mesmo comprar {Retro Warrior} por {20 pontos}? {yes}', cid)
- talkState[talkUser] = 1
- elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
- if getPoints(cid) >= 20 then
- doPlayerRemovePoints(cid, 20)
- doSendMagicEffect(getCreaturePosition(cid), 30)
- selfSay('Você recebeu {Retro Warrior}', cid)
- setPlayerStorageValue(cid,010711,1) else
- selfSay('Ops... você precisa de {20 pontos} para comprar essa outfits!', cid)
- end
- end
- -- [Retro Mage]
- if(msgcontains(msg, 'Retro Mage')) then
- selfSay('Quer mesmo comprar {Retro Mage} por {20 pontos}? {yes}', cid)
- talkState[talkUser] = 2
- elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 2) then
- if getPoints(cid) >= 20 then
- doPlayerRemovePoints(cid, 20)
- doSendMagicEffect(getCreaturePosition(cid), 30)
- selfSay('Você recebeu {Retro Mage}', cid)
- setPlayerStorageValue(cid,010811,1) else
- selfSay('Ops... você precisa de {20 pontos} para comprar essa!', cid)
- end
- end
- -- [Retro Knight]
- if(msgcontains(msg, 'Retro Knight')) then
- selfSay('Quer mesmo comprar {Retro Knight} por {20 pontos}? {yes}', cid)
- talkState[talkUser] = 3
- elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 3) then
- if getPoints(cid) >= 20 then
- doPlayerRemovePoints(cid, 20)
- doSendMagicEffect(getCreaturePosition(cid), 30)
- selfSay('Você recebeu {Retro Knight}', cid)
- setPlayerStorageValue(cid,010911,1) else
- selfSay('Ops... você precisa de {20 pontos} para comprar essa!', cid)
- end
- end
- -- [Retro Citizen]
- if(msgcontains(msg, 'Retro Citizen')) then
- selfSay('Quer mesmo comprar {Retro Citizen} por {20 pontos}? {yes}', cid)
- talkState[talkUser] = 4
- elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 4) then
- if getPoints(cid) >= 20 then
- doPlayerRemovePoints(cid, 20)
- doSendMagicEffect(getCreaturePosition(cid), 30)
- selfSay('Você recebeu {Retro Citizen}', cid)
- setPlayerStorageValue(cid,011011) else
- selfSay('Ops... você precisa de {20 pontos} para comprar essa!', cid)
- end
- end
- -- [Retro Hunter]
- if(msgcontains(msg, 'Retro Hunter')) then
- selfSay('Quer mesmo comprar {Retro Hunter} por {20 pontos}? {yes}', cid)
- talkState[talkUser] = 5
- elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 5) then
- if getPoints(cid) >= 20 then
- doPlayerRemovePoints(cid, 20)
- doSendMagicEffect(getCreaturePosition(cid), 30)
- selfSay('Você recebeu {Retro Hunter}', cid)
- setPlayerStorageValue(cid,011111,1) else
- selfSay('Ops... você precisa de {20 pontos} para comprar essa!', cid)
- end
- end
- end
- npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
- npcHandler:addModule(FocusModule:new())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement