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

TFS 0.X Promotion request

Joined
Apr 11, 2015
Messages
98
Reaction score
5
0.4
Helo0 guys, im here to ask for something. In my server, the player can choose 1 of 3 promotion in one vocation, i was having some issues because when the player login out
he lost his promotion. So i got another script where he can choose the promotion in one npc (it was 1 npc for each promotion) But if he chooses the promotion n• 1, he can choose the promotion n• 2 and 3 too, if he chooses the promotion n• 2, he can chooses n• 3 too, and if chooses n• 3, he cant choose another one. And i want that. When the player chooses ONE promotion, he cant choose another one. So, if the script have something like (getPlayerVocation(cid) == 1) so he can promote the player, and i have the code here, but i cant insert that part anywhere. Thats why im here.

C++:
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({'n1'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can promote you for 20000 gold coins. Do you want me to promote you?'})
    node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 5000, level = 30, 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({'n2'}, 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 = 5000, level = 30, 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})

local node3 = keywordHandler:addKeyword({'n3'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can epicize you for 200000 gold coins. Do you want me to epicize you?'})
    node3:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 5000, level = 30, promotion = 3, text = 'Congratulations! You are now epicized.'})
    node3:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})

npcHandler:addModule(FocusModule:new())


So, i just want to this npc checks if the player is already promoted. It can be a storage check.
Thank you
 
Last edited:
Back
Top