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

Second Promotion

Status
Not open for further replies.

Marilyekon

New Member
Joined
Feb 23, 2010
Messages
47
Reaction score
0
Hello! I have a bug that I don't seem to be able to solt. That's why i ask you guys for help. The thing is when i klick on my epic brain 8the item which makes me go to promotion nr 2) I get the promotion. It says that I'm a Epic master Sorcerer. But when i log out and in again, I'm just a master Sorcerer. What do you think that the broblem can be? Her's the promotion script:


PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerVocation(cid) == 5 then
		doPlayerSetVocation(cid, 9)
		doCreatureSay(cid, "You are now a Epic Master Sorcerer!", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid, 1)
	elseif getPlayerVocation(cid) == 6 then
		doPlayerSetVocation(cid, 10)
		doCreatureSay(cid, "You are now a Epic Elder Druid!", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid, 1)
	elseif getPlayerVocation(cid) == 7 then
		doPlayerSetVocation(cid, 11)
		doCreatureSay(cid, "You are now a Epic Royal Paladin!", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid, 1)
	elseif getPlayerVocation(cid) == 8 then
		doPlayerSetVocation(cid, 12)
		doCreatureSay(cid, "You are now a Epic Elite Knight!", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid, 1)
	else
		doPlayerSendCancel(cid,"You need to be promoted in order to use this item.")
	end
end
And i ofcause I've added it to vocations.xml :p
 
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local a = getPlayerPromotionLevel(cid)
	if a == 0 then
		doPlayerSendCancel(cid, 'You need to be promoted in order to use this item.')
	elseif a == 2 then
		doPlayerSendCancel(cid, 'Your\'re already promoted!')
	else
		doPlayerSetPromotionLevel(cid, 2)
		doCreatureSay(cid, 'You are now ' .. getVocationInfo(getPlayerVocation(cid)).description .. '!', TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid)
	end
	return true
end
 
One more question. On the webside. How do I make is say Epic promotion on the profession?
 
replace doCreatureSay with
doBroadcastMessage
????
 
Cykotitan, I have a problem... The script is working great but, in my database it says that I still am a sorcerer - Vocation id = 1...
But ingame i am a Master Sorcerer.
I have the third vocation too. (i fixed the script so it works with the 3th) - But it still says that my vocation id = 1.. ;/
 
it's ok, it increases your promotion level (promotion column in db)
 
Status
Not open for further replies.
Back
Top