Jump to content
  • 0

Set a player's lvl only in one map?


Draculle

Question


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  3
  • Reputation:   0
  • Joined:  07/28/15
  • Last Seen:  

Hello guys!
 
I would like to know how to create a PvP map where all players were lvl 99 it.
 
For example, a player low lvl when entering the map, him lvl would be set to 99, but when he leave it, he back to the original character level.
 
The player's status points can be reset if is necessary...
 
Sorry for my english and thanks in advance smile.png

Solved:

-	script	PVP_LEVEL_UP	-1,{
	OnInit:
		setarray .maps$, "izlude", "pvp2", "pvp3";
		setarray .minLevel, 99;
		
		for( .@i = 0; .@i < getarraysize( .maps$ ); .@i++ )
			setmapflag .maps$[ .@i ], mf_loadevent;
	end;
	
 
	OnPCLoadMapEvent:
		getmapxy( .@map$, .@x, .@y, 0 );
		if( !compare( implode( .maps$, ":" ), .@map$ ) ) end;
		
		if( BaseLevel < .minLevel ) {
			PVPLP_TRUE_LEVEL = BaseLevel;
			atcommand "@blvl " + (.minLevel - BaseLevel);
		}
	end;
	
	OnPCLogoutEvent:
		callfunc( "PVPLP_revertLevel" );
	end;
}
 
function	script	PVPLP_revertLevel	{
	setarray .@maps$, "izlude", "pvp2", "pvp3";
	getmapxy( .@map$, .@x, .@y, 0 );
	if( !compare( implode( .@maps$, ":" ), .@map$ ) ) end;
 
	atcommand "@blvl " + (PVPLP_TRUE_LEVEL - BaseLevel);
}

 

Thank you :D

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  283
  • Reputation:   31
  • Joined:  07/08/14
  • Last Seen:  

If you don't mind, can I ask you two questions? ^^

 

Why do you use a function for setting the level back to normal?

Why don't you replace this

if( !compare( implode( .maps$, ":" ), .@map$ ) ) end;

by this?

if( !compare( implode( .maps$, ":" ), .@map$ ) ) { callfunc( "PVPLP_revertLevel" ) ; end;}

so that players can get their level back when they leave the map instead of having to disconnect.

 

Also make sure players loose their stat points when their level is set to a lower value because I don't think it recalculates it automatically.

Edited by Kurofly
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  3
  • Reputation:   0
  • Joined:  07/28/15
  • Last Seen:  

If you don't mind, can I ask you two questions? ^^

 

Why do you use a function for setting the level back to normal?

Why don't you replace this

if( !compare( implode( .maps$, ":" ), .@map$ ) ) end;

by this?

if( !compare( implode( .maps$, ":" ), .@map$ ) ) { callfunc( "PVPLP_revertLevel" ) ; end;}

so that players can get their level back when they leave the map instead of having to disconnect.

 

Also make sure players loose their stat points when their level is set to a lower value because I don't think it recalculates it automatically.

 

 

Very cool !!! *-*

 

the function would be used in all NPCs that will remove the player of the map but you idea it's a logical solution that i couldn't think! :P

 

Thanks! :D

Edited by Draculle
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...