Emistry icon

[RO] @go with level restriction 1.2

Emistry | PRO | 10/15/16 07:27:43 PM UTC | 0 ⭐ | 686 👁️ | Never ⏰ | []
text |

3.11 KB

|

None

|

0 👍

/

0 👎

// https://rathena.org/board/topic/107746-request-script-go-restrict-on-base-level/
 -	script	Sample#at_go_restrict	-1,{
	function	func_SetLevel	{
		setd( ".map_" + getarg( 0,"" ) ), getarg( 1,1 );
		return;
	}
	OnInit:
		bindatcmd( "go", strnpcinfo(3)+"::OnAtcommand" );
		bindatcmd( "warp", strnpcinfo(3)+"::OnAtcommand" );
 		func_SetLevel( "prontera",30 ); // prontera need level 30.
		func_SetLevel( "payon",99 ); // payon need level 99.
		end;
 	OnAtcommand:
		if ( !.@atcmd_numparameters ) {
			dispbottom .@atcmd_command$+" <mapname> <x> <y>";
		}
		else {
			switch( atoi( .@atcmd_parameters$[0] ) ) {
				default: 
					callsub( OnWarp, .@atcmd_parameters$[0], .@atcmd_parameters$[1], .@atcmd_parameters$[2] );
					break;
				case 0: callsub( OnWarp, "prontera",156,191 );
				case 1: callsub( OnWarp, "moroc",156,93 );
				case 2: callsub( OnWarp, "geffen",119,59 );
				case 3: callsub( OnWarp, "payon",162,233 );
				case 4: callsub( OnWarp, "alberta",192,147 );
				case 5: callsub( OnWarp, "izlude",128,146 );
				case 6: callsub( OnWarp, "aldebaran",140,131 );
				case 7: callsub( OnWarp, "xmas",147,134,3  );
				case 8: callsub( OnWarp, "comodo",209,143,3  );
				case 9: callsub( OnWarp, "yuno",157,51,3  );
				case 10: callsub( OnWarp, "amatsu",198,84,3  );
				case 11: callsub( OnWarp, "gonryun",160,120,3  );
				case 12: callsub( OnWarp, "umbala",89,157,3  );
				case 13: callsub( OnWarp, "niflheim",21,153,3  );
				case 14: callsub( OnWarp, "louyang",217,40,3  );
				case 15: callsub( OnWarp, "novice",53,111,3  );
				case 16: callsub( OnWarp, "jail",23,61,3  );
				case 17: callsub( OnWarp, "jawaii",249,127,3  );
				case 18: callsub( OnWarp, "ayothaya",151,117,3  );
				case 19: callsub( OnWarp, "einbroch",4,200,5  );
				case 20: callsub( OnWarp, "lighthalzen",158,92,3  );
				case 21: callsub( OnWarp, "einbech",70,95,5  );
				case 22: callsub( OnWarp, "hugel",96,145,3  );
				case 23: callsub( OnWarp, "rachel",130,110,3  );
				case 24: callsub( OnWarp, "veins",216,123,3  );
				case 25: callsub( OnWarp, "moscovia",223,184,3  );
				case 26: callsub( OnWarp, "midcamp",180,240,3  );
				case 27: callsub( OnWarp, "manuk",282,138,3  );
				case 28: callsub( OnWarp, "splendide",197,176,3  );
				case 29: callsub( OnWarp, "brasilis",182,239,3  );
				case 30: callsub( OnWarp, "dicastes",198,187,3  );
				case 31: callsub( OnWarp, "mora",44,151,4  );
				case 32: callsub( OnWarp, "dewata",200,180,3  );
				case 33: callsub( OnWarp, "malangdo",140,114,5  );
				case 34: callsub( OnWarp, "malaya",242,211,5  );
				case 35: callsub( OnWarp, "eclage",110,39,3  );
			}
		}
		end;
 	OnWarp:
		.@map$ = getarg( 0,"" );
		.@x = getarg( 1,0 );
		.@y = getarg( 2,0 );
 		if ( getmapusers( .@map$ ) == -1 ) {
			dispbottom "map '"+.@map$+"' doesn't exist.";
		}
		else if ( !getmapflag( .@map$,mf_town ) || getmapflag( .@map$,mf_nowarpto ) ) {
			dispbottom "you cant warp to this map.";
		}
		else if ( getd( ".map_" + .@map$ ) > BaseLevel ) {
			dispbottom "You need higher level to warp to this map.";
		}
		else {
			warp .@map$,.@x,.@y;
		}
		end;
}

Comments