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

hi problem npc king tibianus version 8.60 TFS 0.3.6

Xanadu123

New Member
Joined
May 11, 2014
Messages
45
Reaction score
4
Hi, I have a problem with the NPC King Tibianus. It only gives me promotion, but I'd like to add it so it gives me premium. How can I do that? Can someone help me with this problem, please? It's for TFS 0.3.6 version 8.60.

LUA:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="King Tibianus" script="data/npc/scripts/King Tibianus.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="332" head="21" body="87" legs="107" feet="95" addons="0"/>
<parameters>
       <parameter key="message_greet" value="I greet thee, my loyal subject |PLAYERNAME|."/>
        <parameter key="message_farewell" value="Good bye, |PLAYERNAME|"/>
        <parameter key="message_walkaway" value="Good bye, |PLAYERNAME|" />
        <parameter key="module_keywords" value="1" />
        <parameter key="keywords" value="job;king;" />
        <parameter key="keyword_reply1" value="I am your sovereign, King Tibianus III, and it's my duty to uphold justice and provide guidance for my subjects." />
         <parameter key="keyword_reply2" value="I am the king, so watch what you say!" />
    </parameters>

</npc>

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

local node1 = keywordHandler:addKeyword({'promot'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to be promoted in your vocation for 20000 gold?'})
    node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 20000, level = 20, promotion = 1, text = 'Congratulations! You are now promoted.'})
    node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})
--[[
local node2 = keywordHandler:addKeyword({'epic'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can epicize you for 200000 gold coins. Do you want me to epicize you?'})
    node2:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 200000, level = 120, promotion = 2, text = 'Congratulations! You are now epicized.'})
    node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})
]]--

npcHandler:addModule(FocusModule:new())
 
Try this one!

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 addPremium(cid, message, keywords, parameters, node)
    if(cid ~= npcHandler.focus) then
        return false
    end
    
    local cost = parameters.cost
    id = parameters.id
              if doPlayerRemoveMoney(cid, cost) == TRUE then
            doPlayerAddPremiumDays(cid, days)
            npcHandler:say('Great!')
        else
    end

    keywordHandler:moveUp(1)
    return true
end

local node0 = keywordHandler:addKeyword({'premium'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Are you sure?'})
    node0:addChildKeyword({'yes'}, addPremium, {cost = 7000, days = 7})
    node0:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Maybe next time.'})
    
local node1 = keywordHandler:addKeyword({'promot'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to be promoted in your vocation for 20000 gold?'})
    node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 20000, level = 20, promotion = 1, text = 'Congratulations! You are now promoted.'})
    node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})
    
--[[
local node2 = keywordHandler:addKeyword({'epic'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can epicize you for 200000 gold coins. Do you want me to epicize you?'})
    node2:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 200000, level = 120, promotion = 2, text = 'Congratulations! You are now epicized.'})
    node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})
]]--



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