Warper NPC: Create Job Restriction

OmarAcero

New member
Messages
173
Points
0
Location
Lima-Perú
Github
https://github.com/OmarAcero
Emulator
Friends,  How can I enable access for only trans classes?

I want create a restrict access to all jobs other than Jobs Trans.

My Idea : Warper

Code:
function Restrict {
//	if ((getarg(0) == "RE" && !RENEWAL) || (getarg(0) == "Pre-RE" && RENEWAL)) {
//	if ((getarg(0) == BaseLevel > 89) || (getarg(0) == BaseLevel < 90)) {
	if ((getarg(0) == Upper > 3 ) || (getarg(0) == Upper < 3 )) {
		if (getarg(1,0)) {
			@warp_block = 0;
			for (.@i = 1; .@i < getargcount(); .@i++)
				@warp_block = @warp_block | (1<<getarg(.@i));
		} else {
//			message strcharinfo(PC_NAME),"This map is not enabled in "+(RENEWAL?"":"Pre-")+"Renewal.";
			message strcharinfo(PC_NAME),"This map only is enabled for Jobs Trans.";
			end;
		}
	}
	return;
}

 
Last edited by a moderator:
Well, I think I found the solution, if someone has a better idea, I would appreciate it if you mention it.

Code:
function Restrict {
	if ( Upper == 0	&&	Upper == 2 )	goto	warp_block;
	if ( Upper == 1 )	goto	warp_enabled;
warp_block:
		message strcharinfo(PC_NAME),"This map only is enabled for Trans Jobs.";
	close;
warp_enabled:
		message strcharinfo(PC_NAME),"Enjoy your Trip.";
	return;
}

Note1: Warper with Jobs Restriction.txt

Note2:  Explained the Upper parameter of jobchange

 
Last edited by a moderator:
Back
Top