• 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!

Solved Trade npc is messed up

MadMOOK

Hoo
Joined
Apr 20, 2011
Messages
802
Reaction score
43
Only the first one works..the helmet then armor and legs below it dont work..
When i say level up armor or legs, it asks the correct question but does not replace the 7 items for the one like it does for helmet..

EDIT:

If i have 7 armors and say "level up helmet".. it will take the armors and give armor lol -.-

EDIT:

it also takes item off body before it takes it out of backpak...

10.10 0.3.7

Code:
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

-- by qento --

function helmetlevel(cid, message, keywords, parameters, node)
    if(not npcHandler:isFocused(cid)) then
        return false
    end
        if getPlayerItemCount(cid,18398) >= 7 then
        if doPlayerRemoveItem(cid,18398,7) then
            npcHandler:say('Here is your item!', cid)
            doPlayerAddItem(cid,18403,1)
        end
        else
            npcHandler:say('you do not have all 7 peices!', cid)
   end
end

function levelarmor(cid, message, keywords, parameters, node)
    if(not npcHandler:isFocused(cid)) then
        return false
    end
        if getPlayerItemCount(cid,18399) >= 7 then
        if doPlayerRemoveItem(cid,18399,7) then
            npcHandler:say('Here is your item!', cid)
            doPlayerAddItem(cid,18404,1)
        end
        else
            npcHandler:say('you do not have all 7 peices!', cid)
   end
end

function dolegs(cid, message, keywords, parameters, node)
    if(not npcHandler:isFocused(cid)) then
        return false
    end
        if getPlayerItemCount(cid,18400) >= 7 then
        if doPlayerRemoveItem(cid,18400,7) then
            npcHandler:say('Here is your item!', cid)
            doPlayerAddItem(cid,18405,1)
        end
        else
            npcHandler:say('you do not have all 7 peices!', cid)
   end
end

-- by qento --

keywordHandler:addKeyword({'trade'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "7 overlord set pieces will get you next tier!'"})

local node1 = keywordHandler:addKeyword({'level up helmet'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to trade for a new helmet??'})
    node1:addChildKeyword({'yes'}, helmetlevel, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Sorry.', reset = true})
 
local node2 = keywordHandler:addKeyword({'level up armor'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to trade for a new armor??'})
    node1:addChildKeyword({'yes'}, levelarmor, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Sorry.', reset = true})
 
local node3 = keywordHandler:addKeyword({'level up legs'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to trade for a new legs??'})
    node1:addChildKeyword({'yes'}, dolegs, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Sorry.', reset = true})

npcHandler:addModule(FocusModule:new())
 
Last edited:
Back
Top