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

CreatureEvent Promote vocation on first login

Hiromath

New Member
Joined
Jul 22, 2012
Messages
29
Reaction score
4
Hello, here is a simple script I made which will promote players when they first login or if you add this to the server later when they login without the upgraded vocation.

Create a file in
Code:
/data/creaturescripts/scripts
Name it "PromoteVoc.lua" and put this in it:
Code:
-- Promotes Vocation On Login
-- Created by Hiromath

function onLogin(cid)
	local accountManager = getPlayerAccountManager(cid)
		if(accountManager == MANAGER_NONE) then
			if getPlayerPromotionLevel(cid) ~= 1 then
			setPlayerPromotionLevel(cid, 2)
			end	
		end	
	return true
end

Now save this and open
Code:
/data/creaturescripts/creaturescripts.xml
Put
Code:
<event type="login" name="PromoteVocation" event="script" value="PromoteVoc.lua"/>
somewhere in there.

Save it and reload creaturescripts/restart the server, the script should promote every new character to a higher vocation.


Please feel free to leave a response and to report and bugs.


Hiromath
 
Back
Top