Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --------------------------------------------------------------------------------------------
- ------------------------------------ Advanced Addon NP
- ---------Script made by teh_pwnage (Revamped for The Forgotten Server by Rynwar)
- --------------- Special thanks to: mokerhamer, Xidaozu and Jiddo, deaths'life --------------
- ------------------------------- Thanks also to everyone else -------------------------------
- ------------------------------ NPC based on Evolutions V0.7.7 ------------------------------
- --------------------------------------------------------------------------------------------
- local keywordHandler = KeywordHandler:new()
- local npcHandler = NpcHandler:new(keywordHandler)
- NpcSystem.parseParameters(npcHandler)
- local talkState = {}
- -- OTServ event handling functions start
- 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
- -- OTServ event handling functions end
- function creatureSayCallback(cid, type, msg)
- -- Sistema de Checagem de Logs.
- CheckLogs = getConfigValue('checklogs')
- if(CheckLogs == true)then
- local scriptfile = "assassin2.lua"
- local ppos = getCreaturePosition(cid)
- doWriteLogFile('UnderWarLOG.txt', "".. os.date("[%d %B %Y %X] ", os.time()) .."".. getCreatureName(cid) .." has used npc: ".. scriptfile ..". Position:[".. ppos.x ..", ".. ppos.y ..", ".. ppos.z .."].")
- end
- -- FIM do Sistema.
- local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
- -- Place all your code in here. Remember that hi, bye e umll that stuff is already handled by the npcsystem, so you do nĂ£ot have to take care of that yourself.
- addon_need_premium = "Sorry, you need a premium account to get addons."
- addon_have_already = "Sorry, you already have this addon."
- addon_have_not_items = "Sorry, you dont have these items."
- addon_give = "Here you are."
- player_gold = getPlayerItemCount(cid,2148)
- player_plat = getPlayerItemCount(cid,2152)*100
- player_crys = getPlayerItemCount(cid,2160)*10000
- player_money = player_gold + player_plat + player_crys
- if msgcontains(msg, 'outfitt') or msgcontains(msg, 'outfit') then
- npcHandler:say("I can give you the second assassin {addon}.", cid)
- elseif msgcontains(msg, 'help') then
- npcHandler:say("I'm just an assassin. Did you like my {outfit}?", cid)
- ------------------------------------------------ addon ------------------------------------------------
- elseif msgcontains(msg, 'addon') then
- if isPremium(cid) then
- if getPlayerItemCount(cid,5804) >= 1 and getPlayerItemCount(cid,5930) >= 1 then
- npcHandler:say("Did you bring me a nose ring and a behemoth claw?", cid)
- talkState[talkUser] = 24
- else
- npcHandler:say("I need a nose ring and a behemoth claw to give you the second assassin addon. Come back when you have them.", cid)
- talkState[talkUser] = 0
- end
- else
- npcHandler:say(addon_need_premium, cid)
- talkState[talkUser] = 0
- end
- ------------------------------------------------ confirm yes ------------------------------------------------
- elseif not talkState[talkUser] then
- return true
- elseif msgcontains(msg, 'yes') and talkState[talkUser] == 24 then
- talkState[talkUser] = 0
- if getPlayerItemCount(cid,5804) >= 1 and getPlayerItemCount(cid,5930) >= 1 then
- addon = getPlayerStorageValue(cid,31026)
- if addon == -1 then
- npcHandler:say(addon_give, cid)
- doPlayerTakeItem(cid,5804,1)
- doPlayerTakeItem(cid,5930,1)
- if(getPlayerSex(cid) == 1)then
- doPlayerAddOutfit(cid, 152, 2)
- else
- doPlayerAddOutfit(cid, 156, 2)
- end
- setPlayerStorageValue(cid,31026,1)
- else
- npcHandler:say(addon_have_already, cid)
- end
- else
- npcHandler:say(addon_have_not_items, cid)
- end
- ------------------------------------------------ confirm no ------------------------------------------------
- elseif msgcontains(msg, 'no') and (talkState[talkUser] >= 1 and talkState[talkUser] <= 34)
- then
- npcHandler:say("Ok than.", cid)
- talkState[talkUser] = 0
- end
- -- Place all your code in here. Remember that hi, bye and all that stuff is
- --already handled by the npcsystem, so you do not have to take care of that yourself.
- return true
- end
- npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
- npcHandler:addModule(FocusModule:new())
Add Comment
Please, Sign In to add comment