• 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 Problem, Promotion not working properly!

2sexy

New Member
Joined
Nov 25, 2007
Messages
18
Reaction score
0
TFS Saving? Why not command?

Hello

The promotion is fixed now and it works properly,
Thankz all for the help!

My POST WAS NOT FINISHED YET! SO DONT CLOSE THIS!


Ok Last question Here Why Is there not any /save Command in TFS ,
SO u can Save more often then 1 time in 1 day ;)
 
Last edited:
Here my promotion NPC works fine. And is the same script that your.

Maybe the problem isnt on NPC, look at ur vocations.xml if ur promoted vocation is there tag fromvoc="ID".


My npc script is that, if u want check it.
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

local node1 = keywordHandler:addKeyword({'promotion'}, 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 = 20000, level = 20, text = 'Congratulations! You are now promoted.'})
	node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Allright then. Come back when you are ready.', reset = true})

npcHandler:addModule(FocusModule:new())
 
Hello

Ok well i gott this problem, When i go to my Promotion npc, who goes by the name King, I try to buy promotion but i doesent work, Iv looked after different script but im wondering if it can be a bug or something!

When i say "Hi" he asks me if i want to buy promotion but when i tell him yes, he says that i allready have promotion , but i dont!

i use TFS 0.2.8

Somebody know whats causing the problem? help me then xD
Would need help as soon as possibly! ;=)

My POST WAS NOT FINISHED YET! SO DONT CLOSE THIS!

Here is the script if anybody wants to have a look!

PHP:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="King" script="data/npc/scripts/promotion.lua" autowalk="1" floorchange="0">
    <health now="100" max="100"/>
    <look type="133" head="20" body="39" legs="45" feet="7"/>
</npc>

Lua.

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
 
local node1 = keywordHandler:addKeyword({'promot'}, 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 = 20000, level = 20, text = 'Congratulations! You are now promoted.'})
    node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Allright then. Come back when you are ready.', reset = true})
 
npcHandler:addModule(FocusModule:new())

THIS IS URGENT PLEASE GET ME SOME HELP;)
thankz!

check the player storage ...
tfs 0.28 changed the promotion system

in data/npc/lib/npcsystem/modules.lua
Code:
  local promotedVoc = getPromotedVocation(getPlayerVocation(cid))
  if([COLOR=red]getPlayerStorageValue(cid, 30018)[/COLOR] == TRUE) then
   selfSay('You are already promoted!')
  elseif(getPlayerLevel(cid) < parameters.level) then
   selfSay('I am sorry, but I can only promote you once you have reached level ' .. parameters.level .. '.')
  elseif(doPlayerRemoveMoney(cid, parameters.cost) ~= TRUE) then
   selfSay('You do not have enough money!')
  else
   doPlayerSetVocation(cid, promotedVoc)
   selfSay(parameters.text)
  end
  npcHandler:resetNpc()
  return true
 end
you can change the storagevalue or check if you using this storage 30018 on another quest .. or whatever..
 
Thx for the reply, hmm i looked it upp and there is no fromvoc"ID", so i will fix that and look if it works then ;)


thanks




Here my promotion NPC works fine. And is the same script that your.

Maybe the problem isnt on NPC, look at ur vocations.xml if ur promoted vocation is there tag fromvoc="ID".


My npc script is that, if u want check it.
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

local node1 = keywordHandler:addKeyword({'promotion'}, 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 = 20000, level = 20, text = 'Congratulations! You are now promoted.'})
	node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Allright then. Come back when you are ready.', reset = true})

npcHandler:addModule(FocusModule:new())
 
Thank you for the reply but its fixed now;) fromvoc was the problem ;) hehe =)

Answer my next question if u can ;)



check the player storage ...
tfs 0.28 changed the promotion system

in data/npc/lib/npcsystem/modules.lua
Code:
  local promotedVoc = getPromotedVocation(getPlayerVocation(cid))
  if([COLOR=red]getPlayerStorageValue(cid, 30018)[/COLOR] == TRUE) then
   selfSay('You are already promoted!')
  elseif(getPlayerLevel(cid) < parameters.level) then
   selfSay('I am sorry, but I can only promote you once you have reached level ' .. parameters.level .. '.')
  elseif(doPlayerRemoveMoney(cid, parameters.cost) ~= TRUE) then
   selfSay('You do not have enough money!')
  else
   doPlayerSetVocation(cid, promotedVoc)
   selfSay(parameters.text)
  end
  npcHandler:resetNpc()
  return true
 end
you can change the storagevalue or check if you using this storage 30018 on another quest .. or whatever..
 
!save - it will save at this moment.

!save "minutes - saving by AddEvent, it will save every minutes setted as parameter. !save "10 - will save every 10 minutes ;)
 
@Slawkens, Thx for reply. hehe

@Babalow, As i have this thread, I tought i could bring this question upp, instead of wasting more threads on the forum. And yes i use the Search function more then u think, as i always turn to search before i post threads etc, well hope u understand ;)
 
Back
Top Bottom