• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

NPCS that gives addons. tfs 1.0

vingo

Active Member
Joined
Oct 27, 2012
Messages
464
Reaction score
43
First npc that doesn't work



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

obeggar        = 22028
fbeggar        = 22029
sbeggar        = 22030
pssimon        = 60134

newaddon    = 'Ah, right! The beggar beard or beggar dress! Here you go.'
noitems        = 'You do not have all the required items.'
noitems2    = 'You do not have all the required items or you do not have the outfit, which by the way, is a requirement for this addon.'
already        = 'It seems you already have this addon, don\'t you try to mock me son!'

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

    if(not npcHandler:isFocused(cid)) then
        return false
    end
        if getPlayerStorageValue(cid,pssimon) == -1 then
        setPlayerStorageValue(cid,pssimon, 1)
            npcHandler:say('Good! Come back to me once you have retrieved my staff. Good luck.', cid)
    else
        npcHandler:say('I alrealy give you information about mine staff.')

    end

end


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

    if(not npcHandler:isFocused(cid)) then
        return false
    end
   
    local player_gold    = getPlayerItemCount(cid,2148)
    local player_plat    = getPlayerItemCount(cid,2152)*100
    local player_crys    = getPlayerItemCount(cid,2160)*10000
    local player_money    = player_gold + player_plat + player_crys

    if isPremium(cid) then
    if getPlayerStorageValue(cid,fbeggar) == -1 then
        if getPlayerItemCount(cid,5883) >= 100 and player_money >= 20000 then
        if doPlayerRemoveItem(cid,5883,100) and doPlayerRemoveMoney(cid,20000) then
            npcHandler:say('Ah, right! The beggar beard or beggar dress! Here you go.')
            doSendMagicEffect(getCreaturePosition(cid), 13)
            setPlayerStorageValue(cid,fbeggar,1)
            if getPlayerSex(cid) == 1 then
            doPlayerAddOutfit(cid, 153, 1)
            elseif getPlayerSex(cid) == 0 then
            doPlayerAddOutfit(cid, 157, 1)
        end   
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end

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

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

    if isPremium(cid) then
    if getPlayerStorageValue(cid,sbeggar) == -1 then   
        if getPlayerItemCount(cid,6107) >= 1 then
        if doPlayerRemoveItem(cid,6107,1) then
            npcHandler:say('Ah, right! The Beggar Staff! Here you go.')           
            doSendMagicEffect(getCreaturePosition(cid), 13)
            setPlayerStorageValue(cid,sbeggar,1)
            if getPlayerSex(cid) == 1 then
            doPlayerAddOutfit(cid, 153, 2)
            elseif getPlayerSex(cid) == 0 then
            doPlayerAddOutfit(cid, 157, 2)
        end   
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end

function key(cid, message, keywords, parameters, node)
  if(not npcHandler:isFocused(cid)) then
        return false
    end
   
    local player_gold    = getPlayerItemCount(cid,2148)
    local player_plat    = getPlayerItemCount(cid,2152)*100
    local player_crys    = getPlayerItemCount(cid,2160)*10000
    local player_money    = player_gold + player_plat + player_crys
   
        if player_money >= 800 then
        if doPlayerRemoveMoney(cid,800) then
            npcHandler:say('Here, take the key!', cid)
            local playerID = getPlayerGUID(cid)
                local item = doPlayerAddItem(cid, 2087, 1)
            doSetItemActionId(item, 3940)
        end
        else
            npcHandler:say('You don\'t have enough money for the key!', cid)
    end
end   




node1 = keywordHandler:addKeyword({'addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'For the small fee of 20000 gold pieces I will help you mix this potion. Just bring me 100 pieces of ape fur, which are necessary to create this potion. ...Do we have a deal?'})
node1:addChildKeyword({'yes'}, BeggarFirst, {})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

node2 = keywordHandler:addKeyword({'dress'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'For the small fee of 20000 gold pieces I will help you mix this potion. Just bring me 100 pieces of ape fur, which are necessary to create this potion. ...Do we have a deal?'})
node2:addChildKeyword({'yes'}, BeggarFirst, {})
node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

node3 = keywordHandler:addKeyword({'staff'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To get beggar staff you need to give me simon the beggar\'s staff. Do you have it with you?'})
node3:addChildKeyword({'yes'}, BeggarSecond, {})
node3:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

node4 = keywordHandler:addKeyword({'key'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To get the fibula key you need to give me 800 gold coins, do you have them with you?'})
node4:addChildKeyword({'yes'}, key, {})
node4: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())




I want npc Sandra


That gives a lottery ticket for every 500 potions you use OR when you leave 100 empty vials, whatever is fine. if you get a winning lottery ticket from ur lottery ticket you can then trade in for female summoner fluid belt or male mage fluid belt


Thanks, hope someone can help me
 
You have this storage?
Code:
if getPlayerStorageValue(cid,fbeggar) == -1 then
 
PHP:
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

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, "recruitment")) then
        if(getPlayerStorageValue(cid, 900) == 1) then
            npcHandler:say("We are hiring people to fight in our so called Bigfoot company against the foes of gnomekind. Are you interested in joining?", cid)
            talkState[talkUser] = 1
        end

    -- TEST
    elseif(msgcontains(msg, "test")) then
        if(getPlayerStorageValue(cid, 900) == 2) then
            if(talkState[talkUser] ~= 1 and talkState[talkUser] < 2) then
                npcHandler:say({"Imagine, during your travels you come upon a rare and unknown mushroom. Would you {A}) note down its specifics and location and look for a gnome to take care of it. ...",
                                "Or would you {B}) smash it to an unrecognisable pulp. Or would you {C}) pluck it to take it with you for further examination. Or would you {D}) try to become friends with the mushroom by singing questionable bar-room songs?"}, cid)
                setPlayerStorageValue(cid, 900, 0)
                talkState[talkUser] = 2
            elseif(talkState[talkUser] == 3) then
                npcHandler:say({"Imagine you wake up one morning and discover you have forgotten how to knot your shoelaces. Would you {A}) admit defeat and go to bed once more. ...",
                                "{B}) look for a gnome that can remind you how to do it. {C}) Despite the risk of injuring yourself, try to figure it out on your own. {D}) Use some pottery instead of shoes."}, cid)
                talkState[talkUser] = 4
            elseif(talkState[talkUser] == 5) then
                npcHandler:say({"Now let us assume you see a gnome in danger. Would you {A}) not care because you must be imagining things. {B}) Save the gnome despite all odds and risk to your own life. ...",
                                "{C}) Inspire the gnome by singing the gnomish national anthem. {D}) Hide and loot his corpse if he dies."}, cid)
                talkState[talkUser] = 6
            elseif(talkState[talkUser] == 7) then
                npcHandler:say({"Imagine you were participating in a gnome-throwing competition. Would you {A}) do some physical calculations in advance to increase your chances of winning. ...",
                                "{B}) throw the gnome as safely as you can to ensure his safety. {C}) Sabotage the throwing gnomes of your competitors. {D}) Never participate in such an abominable competition."}, cid)
                talkState[talkUser] = 8
            elseif(talkState[talkUser] == 9) then
                npcHandler:say({"Now imagine you were given the order to guard a valuable and unique mushroom. You guard it for days and no one shows up to release you and you grow hungry. ...",
                                "Would you {A}) eat your boots. {B}) eat the mushroom. {C}) eat a bit of the mushroom. {D}) stick to your duty and continue starving."}, cid)
                talkState[talkUser] = 10
            elseif(talkState[talkUser] == 11) then
                npcHandler:say("What do you think describes gnomish society best? {A}) Ingenuity {B}) Bravery {C}) Humility {D}) All of the above.", cid)
                talkState[talkUser] = 12
            elseif(talkState[talkUser] == 13) then
                npcHandler:say({"How many bigfoot does it take to change a light crystal? {A}) Only one since it's a piece of mushroom cake. {B}) Light crystals are delicate products of gnomish science and should only be handled by certified gnomish experts. ...",
                                "{C}) Three. One to hold the crystal and two to turn him around. {D}) Five. A light crystal turner, a light crystal picker, a light crystal exchanger, a light crystal changing manager and finally a light crystal changing manager assistant."}, cid)
                talkState[talkUser] = 14
            elseif(talkState[talkUser] == 15) then
                npcHandler:say({"What is a pollyfluxed quantumresonator? {A}) Something funny. {B}) Something important. {C}) Something to be destroyed. ...",
                                "{D}) Sadly I am not a gnome and lack the intelligence and education to know about even the simplest of gnomish inventions."}, cid)
                talkState[talkUser] = 16
            elseif(talkState[talkUser] == 17) then
                npcHandler:say({"If your mushroom patch is infested with cave worms, would you {A}) place some green light crystals to drive them away. {B}) place some disharmonic crystals to drive them away. ...",
                                "{C}) burn everything down. {D}) switch your diet to cave worms."}, cid)
                talkState[talkUser] = 18
            elseif(talkState[talkUser] == 19) then
                npcHandler:say("What is the front part of a spear? Is it {A}) the pointed one. {B}) The blunt one. {C}) Whatever causes the most damage {D}) A spear is no weapon but a fruit that grows on surface trees.", cid)
                talkState[talkUser] = 20
            elseif(talkState[talkUser] == 21) then
                npcHandler:say({"On a military campaign what piece of equipment would you need most? ...",
                                "Is it {A}) some tasty mushroom beer to keep the morale high. {B}) A large backpack to carry all the loot. {C}) A mighty weapon to vanquish the foes. {D}) Mushroom earplugs to be spared of the cries of agony of your opponents?"}, cid)
                talkState[talkUser] = 22
            elseif(talkState[talkUser] == 23) then
                npcHandler:say("What comes first? {A}) safety {B}) I {C}) duty {D}) George", cid)
                talkState[talkUser] = 24
            elseif(talkState[talkUser] == 25) then
                npcHandler:say("In case of emergency {A}) break glass {B}) break a leg {C}) have a break {D}) call a gnome?", cid)
                talkState[talkUser] = 26
            elseif(talkState[talkUser] == 27) then
                npcHandler:say("The greatest disaster I can imagine is ... {A}) to fail the gnomes {B}) a ruined mushroom pie {C}) accidentally hammering my finger {D}) having some work to do", cid)
                talkState[talkUser] = 28
            elseif(talkState[talkUser] == 29) then
                npcHandler:say("What would your favourite pet be? {A}) A Krazzelzak of course. {B}) An Uxmoff to be honest. {C}) Montpiffs were always my favourite. {D}) A Humdrella and nothing else!", cid)
                talkState[talkUser] = 30
            elseif(talkState[talkUser] == 31) then
                npcHandler:say("Why do you want to become a bigfoot? {A}) To become rich and famous. {B}) To become famous and rich. {C}) To become rich or famous. {D}) To serve the gnomish community in their struggle?", cid)
                talkState[talkUser] = 32
            end
        end




Attempt to perform arithmetic on field "?" In function __add Line 18 function callback, Npchandler in function oncreaturesay and on line 13 in function <filename>



Couldnt post whole npc file but removed the answers to the quiz
 
Back
Top