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

Max level

frigo

New Member
Joined
Apr 10, 2009
Messages
359
Reaction score
0
Location
Lithuania
I need a script so when you reach level 750, you can't get experience until you get a new promotion (voc ids 9,10,11,12)..
Anyone knows how to do it? :o
 
Quick written, not tested.

creatureevent:
LUA:
local config = {
			str = "You need a promotion to level higher!"
			};

function onAdvance(cid, skill, oldLevel, newLevel)
		if getPlayerLevel(cid) > 750 and getPlayerVocation(cid) < 9 then
				doPlayerAddLevel(cid, -1)
				DoPlayerSendTextMessage(cid, STATUS_CONSOLE_MESSAGE_BLUE, (config.str))
		end
		return TRUE
end
 
LUA:
function onAdvance(cid, skill, oldLevel, newLevel)
	if skill == SKILL__LEVEL and newLevel > 750 and getPlayerVocation(cid) < 9 then
		doPlayerSendTextMessage(cid, STATUS_CONSOLE_MESSAGE_BLUE, "You need a higher promotion!")
	end
	return false
end

First def. won't work, this might though.
 
Code:
function onAdvance(cid, skill, oldLevel, newLevel)
	if skill == SKILL__LEVEL and newLevel > 750 and getPlayerPromotionLevel(cid) < 2 then
		return not doPlayerSendTextMessage(cid, STATUS_CONSOLE_MESSAGE_BLUE, "You need a higher promotion!")
	end
	return true
end
 
Wait, what do I add to creaturescripts.xml?Tried:
<event type="promo" name="promo" script="promo.lua"/>
Gave an error:
[23/04/2010 14:54:13] [Error - CreatureEvent::configureEvent] No valid type for creature event.promo
[23/04/2010 14:54:13] [Warning - BaseEvents::loadFromXml] Cannot configure an event
 
Back
Top