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

Wayfarer addon

Zool

Banned User
Joined
Jun 9, 2009
Messages
742
Reaction score
5
Location
Poland/St Wola
Were is error ?
14:16 Zool [100]: first wayfarer addon
npc dont say nothing :(
Code:
-- Wayfarer START --

function WayfarerFirst(cid, message, keywords, parameters, node)



    if(not npcHandler:isFocused(cid)) then

        return false

    end



    if isPremium(cid) then

    addon = getPlayerStorageValue(cid,wayfarer)
	cc = 400
    if addon == -1 then

        if getPlayerItemCount(cid,2160) >= cc then

        if doPlayerRemoveItem(cid,2160,cc) then
            npcHandler:say('Here you go!', cid)

             

            doSendMagicEffect(getCreaturePosition(cid), 13)

            doPlayerAddOutfit(cid, 366, 1)

            doPlayerAddOutfit(cid, 367, 1)

            setPlayerStorageValue(cid,wayfarer,1)

        end

        else

            npcHandler:say('You do not have all the required items.', cid)

        end

    else

        npcHandler:say('You have already earned this addon!', cid)

    end

    end



end



function wayfarerSecond(cid, message, keywords, parameters, node)



    if(not npcHandler:isFocused(cid)) then

        return false

    end



    if isPremium(cid) then

    addon = getPlayerStorageValue(cid,wayfarer+1)
	cc = 650
    if addon == -1 then

        if getPlayerItemCount(cid,2160) >= cc then

        if doPlayerRemoveItem(cid,2160,cc) then

            npcHandler:say('Here you go!', cid)

             

            doSendMagicEffect(getCreaturePosition(cid), 13)

            doPlayerAddOutfit(cid, 366, 2)

            doPlayerAddOutfit(cid, 367, 2)

            setPlayerStorageValue(cid,wayfarer+1,1)

        end

        else

            npcHandler:say('You do not have all the required items.', cid)

        end

    else

        npcHandler:say('You have already earned this addon!', cid)

    end

    end



end

-- Wayfarer END --

Storage id
wayfarer = 22004
-- wayfarer
cc_way_f = 400
cc_way_s = 650
 
d

dont error i have now :

14:46 Zool [100]: first wayfarer addon
14:46 Varkhal: To achieve the first wayfarer addon you need to give me 400 crystal coins. Do you have them with you?
14:46 Zool [100]: yes

Nothing

Code:
node46 = keywordHandler:addKeyword({'first wayfarer addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the first wayfarer addon you need to give me  '.. cc_way_f ..' crystal coins. Do you have them with you?'})

    node44:addChildKeyword({'yes'}, WayfarerFirst, {})

    node44:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

Idk :|
in outfits have wayfarer...
 
Use Script!

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

-- Storage IDs --
local wayfarer    = 10046  


local newaddon    = 'Here you are, enjoy your brand new addon!'
local noitems        = 'You do not have all the required items.'
local noitems2    = 'You do not have all the required items or you do not have the first addon, which by the way, is a requirement for this addon.'
local already        = 'It seems you already have this addon, don\'t you try to mock me son!'
        
-- WAYFARER START --
function WayfarerFirst(cid, message, keywords, parameters, node)

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

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,wayfarer)
    if addon == -1 then
        if getPlayerItemCount(cid,2160) >= 40 then
        if doPlayerRemoveItem(cid,2160,40) then
            selfSay(newaddon)
             
            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 366, 1)
            doPlayerAddOutfit(cid, 367, 1)
            setPlayerStorageValue(cid,wayfarer,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end

function WayfarerSecond(cid, message, keywords, parameters, node)

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

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,wayfarer+1)
    if addon == -1 then
        if getPlayerItemCount(cid,2160) >= 40 then
        if doPlayerRemoveItem(cid,2160,40) then
            selfSay(newaddon)
             
            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 366, 2)
            doPlayerAddOutfit(cid, 367, 2)
            setPlayerStorageValue(cid,wayfarer+1,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end
-- WAYFARER END --

keywordHandler:addKeyword({'addons'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you first & second addons of the Wayfarer outfit."})
keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "What you do is that you type 'first wayfarer addon' or 'second wayfarer addon'. Assuming that you already collected all the required pieces, say 'yes' and voíla - you got yourself an addon!"})


local node1 = keywordHandler:addKeyword({'first wayfarer addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the first wayfarer addon you need to give me 30 beholder eyes, 10 red dragon scales, 30 lizard scales, 20 fish fins, 20 vampire dusts, 10 demon dusts and Warrior\'s sweat. Do you have them with you?'})
    node1:addChildKeyword({'yes'}, AssassinFirst, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

local node2 = keywordHandler:addKeyword({'second wayfarer addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the second wayfarer addon you need to give me 50 blue piece of cloth, 50 green piece of cloth, 50 red piece of cloth, 50 brown piece of cloth, 50 yellow piece of cloth, 50 white piece of cloth and 10 spider silk yarns. Do you have them with you?'})
    node2:addChildKeyword({'yes'}, AssassinSecond, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

npcHandler:addModule(FocusModule:new())

Hugs Kojiiro:thumbup:​
 
Back
Top