Przeglądaj źródła

New Battle Config: gm.conf/atcommand_max_stat_bypass for bugreport:3301
-- Allows you to choose whether your gms can bypass your server's max stat limit or not.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@15046 54d463be-8e91-2dee-dedb-b68131a5f0ec

shennetsind 13 lat temu
rodzic
commit
9e9872c301
4 zmienionych plików z 22 dodań i 13 usunięć
  1. 4 0
      conf/battle/gm.conf
  2. 14 11
      src/map/atcommand.c
  3. 2 1
      src/map/battle.c
  4. 2 1
      src/map/battle.h

+ 4 - 0
conf/battle/gm.conf

@@ -56,6 +56,10 @@ gm_kick_chat: no
 // set to 'Yes', Normal players (gm level 0) can never use a GM command even if you set the command level to 0.
 atcommand_gm_only: no
 
+// (@) @allstats/@str/@agi/@vit/@int/@dex/@luk
+// allow gms to bypass the maximum stat parameter? ( if yes gm stats can go up to 32k ) default: no
+atcommand_max_stat_bypass: no
+
 // Is the character of a GM account set as the object of a display by @ command etc. or not?
 hide_GM_session: no
 

+ 14 - 11
src/map/atcommand.c

@@ -3065,7 +3065,7 @@ ACMD_FUNC(zeny)
  *------------------------------------------*/
 ACMD_FUNC(param)
 {
-	int i, value = 0, new_value;
+	int i, value = 0, new_value, max;
 	const char* param[] = { "str", "agi", "vit", "int", "dex", "luk" };
 	short* status[6];
  	//we don't use direct initialization because it isn't part of the c standard.
@@ -3094,16 +3094,16 @@ ACMD_FUNC(param)
 	status[4] = &sd->status.dex;
 	status[5] = &sd->status.luk;
 
-	if(value < 0 && *status[i] <= -value)
-	{
-		new_value = 1;
-	}
-	else if(SHRT_MAX - *status[i] < value)
-	{
-		new_value = SHRT_MAX;
-	}
+	if( battle_config.atcommand_max_stat_bypass )
+		max = SHRT_MAX;
 	else
-	{
+		max = pc_maxparameter(sd);
+
+	if(value < 0 && *status[i] <= -value) {
+		new_value = 1;
+	} else if(max - *status[i] < value) {
+		new_value = max;
+	} else {
 		new_value = *status[i] + value;
 	}
 
@@ -3145,7 +3145,10 @@ ACMD_FUNC(stat_all)
 		value = pc_maxparameter(sd);
 		max = pc_maxparameter(sd);
 	} else {
-		max = SHRT_MAX;
+		if( battle_config.atcommand_max_stat_bypass )
+			max = SHRT_MAX;
+		else
+			max = pc_maxparameter(sd);
 	}
 
 	count = 0;

+ 2 - 1
src/map/battle.c

@@ -4580,9 +4580,10 @@ static const struct _battle_data {
 	{ "bg_misc_attack_damage_rate",         &battle_config.bg_misc_damage_rate,             60,     0,      INT_MAX,        },
 	{ "bg_flee_penalty",                    &battle_config.bg_flee_penalty,                 20,     0,      INT_MAX,        },
 	/**
-	 * RR-Specific
+	 * rAthena
 	 **/
 	{ "max_third_parameter",                &battle_config.max_third_parameter,                 20,     0,      INT_MAX,        },
+	{ "atcommand_max_stat_bypass",          &battle_config.atcommand_max_stat_bypass,            0,      0,      100,            },           
 };
 
 

+ 2 - 1
src/map/battle.h

@@ -497,8 +497,9 @@ extern struct Battle_Config
 	int bg_magic_damage_rate;
 	int bg_misc_damage_rate;
 	int bg_flee_penalty;
-	//[RR]
+	// rAthena
 	int max_third_parameter;
+	int atcommand_max_stat_bypass;
 } battle_config;
 
 void do_init_battle(void);