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

[Script] Promotion script

fredde3436

Member
Joined
Jul 6, 2009
Messages
226
Reaction score
7
Instead of talking to an NPC i need a script, When you use a lever you will pay X money and you must be a specific voc to pull lever!

Thank

/Fredde3436
 
Lua:
local vocations = (1,4)

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerVocation(cid) == vocations then
		if getPlayerVocation(cid) == 1 then
			setPlayerVocation(cid) == 5
			setPlayerStorageValue(cid,3547,1)
			doSendMagicEffect(getThingPos(cid), 31)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have been promoted from a sorcerer to a master sorcerer!")
		end
		if getPlayerVocation(cid) == 2 then
			setPlayerVocation(cid) == 6 
			setPlayerStorageValue(cid,3547,1)
			doSendMagicEffect(getThingPos(cid), 31)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have been promoted from a druid to an elder druid!")
		end
		if getPlayerVocation(cid) == 3 then
			setPlayerVocation(cid) == 7
			setPlayerStorageValue(cid,3547,1)
			doSendMagicEffect(getThingPos(cid), 31)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have been promoted from a paladin to a royal paladin!")
		end
		if getPlayerVocation(cid) == 4 then
			setPlayerVocation(cid) == 8
			setPlayerStorageValue(cid,3547,1)
			doSendMagicEffect(getThingPos(cid), 31)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have been promoted from a knight to an elite knight!")
		end
	end
	return TRUE
end
REP++ ME IF I HELPED YOU :D
 
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerPromotionLevel(cid) == 0 then
		local id = getPlayerVocation(cid)
		doPlayerSetPromotionLevel(cid, 1)
		doSendMagicEffect(getThingPos(cid), CONST_ME_STUN)
		doCreatureSay(cid, 'You have been promoted from ' .. getVocationInfo(voc).description .. ' to ' .. getVocationInfo(getVocationInfo(voc).promotedVocation).description .. '!', TALKTYPE_ORANGE_1)
	else
		doCreatureSay(cid, 'You are already promoted!', TALKTYPE_ORANGE_1, false, cid)
	end
	return true
end
 
Back
Top