• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction !promote

Shawak

Intermediate OT User
Joined
Sep 11, 2008
Messages
1,986
Solutions
2
Reaction score
121
Location
Germany
GitHub
Shawak
Realase / shorter, more configurable.

This Script promote your Character. :thumbup:

data/talkactions/scripts/promote.lua
Code:
function onSay(cid, words, param, channel)

	sorcerer = {
	cost = 200000,
	level = 20,
	text = "Promoted to Master Sorcerer",
	}
	druid = {
	cost = 200000,
	level = 20,
	text = "Promoted to Elder Druid",
	}
	paladin = {
	cost = 200000,
	level = 20,
	text = "Promoted to Royal Paladin",
	}
	knight = {
	cost = 200000,
	level = 20,
	text = "Promoted to Elite Knight",
	}

	if getPlayerVocation(cid) == 1 then
		voc = sorcerer
	elseif getPlayerVocation(cid) == 2 then
		voc = druid
	elseif getPlayerVocation(cid) == 3 then
		voc = paladin
	elseif getPlayerVocation(cid) == 4 then
		voc = knight
	else
		voc = nil
	end
	if voc ~= nil then
		if getPlayerLevel(cid) >= voc.level then
			if doPlayerRemoveMoney(cid,voc.cost) == TRUE then
				setPlayerPromotionLevel(cid, 1)
				doSendMagicEffect(getCreaturePosition(cid),14)
				doSendAnimatedText(getCreaturePosition(cid),voc.text,49)
			else
				doPlayerSendTextMessage(cid,18,"You need "..voc.cost.." to promote.")
			end
		else
			doPlayerSendTextMessage(cid,18,"You need level "..voc.level.." to promote.")
		end
	else
		doPlayerSendTextMessage(cid,18,"You already promoted.")
	end
	return TRUE
end

data/talkactions/talkactions.xml
HTML:
	<talkaction words="!promote" event="script" value="promote.lua"/>

Now you can use !promote.
You can change the Settings in the config.

Tested (TFS 0.3.4.), all works fine.

I hope you like it :thumbup:.

Regards,
Shawak
 
Last edited:
And why it works? :D
I wrote
Code:
doPlayerSetVocation(cid,(getPlayerVocation(cid)+4))

"(getPlayerVocation(cid)+4)", your math note? xD

Regards,
Shawak
 
if you lg out then it will back to normal one.(before talkaction !promote)

you should use this:

PHP:
setPlayerPromotionLevel(cid, level)
 
@up
no.. it is still bugged.

Promotion Level = 1 means to make player ED,RP,MS or EK.
Promotion Level = 2 means to make player 1 promotiom higher than previous one.

You should place over here id = 1 :)
 
My friend tested it and it works, but if you mean (lol).

Updated, and fixed.

Regards,
Shawak
 
Of courese it worked cuz ur friend didn't have any higher promotion than 1, and it automatially set to closer one ;)

:) it is not like that i don't like you xD you are doing great work, but better is to fix everything on begining, instead gettind 1500100900 pvt messages with "no work plax!" or more topics on forum ;)

QuaS~
 
Back
Top