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
- local gold_id = 2160
- local ammout = 10
- 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, 'aura') or msgcontains(msg, 'auras')) then
- selfSay('Bom.. Eu tenho algumas auras. como: {Death}, {Earth}, {Poison}, {Physical}, {Ice}, {Fire}, {Holy} e {Energy}!.', cid)
- elseif(msgcontains(msg, 'death') or msgcontains(msg, 'DEATH')) then
- if getPlayerStorageValue(cid, 99125) >= 1 then
- selfSay('Voce ja tem a aura de death.', cid)
- return true
- end
- if(doPlayerRemoveItem(cid, gold_id, ammout) == true) then
- setPlayerStorageValue(cid, 99125, 1)
- selfSay('Obrigado. Agora voce tem sua aura de death.', cid)
- doSendMagicEffect(getThingPos(cid), 17)
- else
- selfSay('Voce não tem dinheiro pra isso.', cid)
- return true
- end
- elseif(msgcontains(msg, 'earth') or msgcontains(msg, 'EARTH')) then
- if getPlayerStorageValue(cid, 99128) >= 1 then
- selfSay('Voce ja tem a aura de earth.', cid)
- return true
- end
- if(doPlayerRemoveItem(cid, gold_id, ammout) == true) then
- setPlayerStorageValue(cid, 99128, 1)
- selfSay('Obrigado. agora voce tem sua aura de earth', cid)
- doSendMagicEffect(getThingPos(cid), 45)
- else
- selfSay('Voce não tem dinheiro pra isso.', cid)
- return true
- end
- elseif(msgcontains(msg, 'fire') or msgcontains(msg, 'FIRE')) then
- if getPlayerStorageValue(cid, 99130) >= 1 then
- selfSay('Voce ja tem a aura de fire.', cid)
- return true
- end
- if(doPlayerRemoveItem(cid, gold_id, ammout) == true) then
- setPlayerStorageValue(cid, 99130, 1)
- selfSay('Obrigado. agora voce tem sua aura de fire', cid)
- doSendMagicEffect(getThingPos(cid), 15)
- else
- selfSay('Voce não tem dinheiro pra isso.', cid)
- return true
- end
- elseif(msgcontains(msg, 'ice') or msgcontains(msg, 'ICE')) then
- if getPlayerStorageValue(cid, 99123) >= 1 then
- selfSay('Voce ja tem a aura de ice.', cid)
- return true
- end
- if(doPlayerRemoveItem(cid, gold_id, ammout) == true) then
- setPlayerStorageValue(cid, 99123, 1)
- selfSay('Obrigado. agora voce tem sua aura de ice', cid)
- doSendMagicEffect(getThingPos(cid), 43)
- else
- selfSay('Voce não tem dinheiro pra isso.', cid)
- return true
- end
- elseif(msgcontains(msg, 'holy') or msgcontains(msg, 'HOLY')) then
- if getPlayerStorageValue(cid, 99124) >= 1 then
- selfSay('Voce ja tem a aura de holy.', cid)
- return true
- end
- if(doPlayerRemoveItem(cid, gold_id, ammout) == true) then
- setPlayerStorageValue(cid, 99124, 1)
- selfSay('Obrigado. agora voce tem sua aura de holy', cid)
- doSendMagicEffect(getThingPos(cid), 39)
- else
- selfSay('Voce não tem dinheiro pra isso.', cid)
- return true
- end
- elseif(msgcontains(msg, 'physical') or msgcontains(msg, 'PHYSICAL')) then
- if getPlayerStorageValue(cid, 99126) >= 1 then
- selfSay('Voce ja tem a aura de physical.', cid)
- return true
- end
- if(doPlayerRemoveItem(cid, gold_id, ammout) == true) then
- setPlayerStorageValue(cid, 99126, 1)
- selfSay('Obrigado. agora voce tem sua aura de physical', cid)
- doSendMagicEffect(getThingPos(cid), 3)
- else
- selfSay('Voce não tem dinheiro pra isso.', cid)
- return true
- end
- elseif(msgcontains(msg, 'energy') or msgcontains(msg, 'ENERGY')) then
- if getPlayerStorageValue(cid, 99127) >= 1 then
- selfSay('Voce ja tem a aura de energy.', cid)
- return true
- end
- if(doPlayerRemoveItem(cid, gold_id, ammout) == true) then
- setPlayerStorageValue(cid, 99127, 1)
- selfSay('Obrigado. agora voce tem sua aura de energy', cid)
- doSendMagicEffect(getThingPos(cid), 11)
- else
- selfSay('Voce não tem dinheiro pra isso.', cid)
- return true
- end
- elseif(msgcontains(msg, 'poison') or msgcontains(msg, 'POISON')) then
- if getPlayerStorageValue(cid, 99129) >= 1 then
- selfSay('Voce ja tem a aura de poison.', cid)
- return true
- end
- if(doPlayerRemoveItem(cid, gold_id, ammout) == true) then
- setPlayerStorageValue(cid, 99129, 1)
- selfSay('Obrigado. agora voce tem sua aura de posion', cid)
- doSendMagicEffect(getThingPos(cid), 8)
- else
- selfSay('Voce não tem dinheiro pra isso.', cid)
- return true
- end
- end
- return true
- end
- npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
- npcHandler:addModule(FocusModule:new())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement