• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Helmet of the ancients npc

I've searched but didn't found something so maybe somebody have one and wanna share here :s

@ryandometal
I have a quest for each item and need npc for exchange.

Ah... okay.
I think it should work:
Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

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 AncientHelmet(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

        if getPlayerItemCount(cid,2335) >= 1 and getPlayerItemCount(cid,2336) >= 1 and getPlayerItemCount(cid,2337) >= 1 and getPlayerItemCount(cid,2338) >= 1 and getPlayerItemCount(cid,2339) >= 1 and getPlayerItemCount(cid,2340) >= 1 and getPlayerItemCount(cid,2341) >= 1 then
        if doPlayerRemoveItem(cid,2335,1) and doPlayerRemoveItem(cid,2336,1) and doPlayerRemoveItem(cid,2337,1) and doPlayerRemoveItem(cid,2338,1) and doPlayerRemoveItem(cid,2339,1) and doPlayerRemoveItem(cid,2340,1) and doPlayerRemoveItem(cid,2341,1) then
            npcHandler:say('Here is your helmet of the ancients!', cid)
            doPlayerAddItem(cid,2342,1)
        end
        else
            npcHandler:say('You don\'t have these items!', cid)

   end

end

keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can change 7 pieces of damaged helmet for a helmet of the ancients."})

local node1 = keywordHandler:addKeyword({'helmet of the ancients'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to trade 7 pieces of damaged helmet for a helmet of the ancients?'})
    node1:addChildKeyword({'yes'}, AncientHelmet, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got the neccessary items.', reset = true})

npcHandler:addModule(FocusModule:new())

If it help you, don't forget rep+ me :p
 
Back
Top