Explorar o código

* Fixed monsters above Lv99 displaying a Lv99 aura (bugreport:3986).
- The server no longer caps the level sent to the client by default.
- Servers that require the aura to be displayed at a level different from lv99, either have to alter the client or adjust the 'client_limit_unit_lv' setting.

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

ai4rei %!s(int64=13) %!d(string=hai) anos
pai
achega
7662f1e897
Modificáronse 6 ficheiros con 66 adicións e 9 borrados
  1. 4 0
      Changelog-Trunk.txt
  2. 2 0
      conf/Changelog.txt
  3. 8 0
      conf/battle/client.conf
  4. 1 0
      src/map/battle.c
  5. 1 0
      src/map/battle.h
  6. 50 9
      src/map/clif.c

+ 4 - 0
Changelog-Trunk.txt

@@ -1,5 +1,9 @@
 Date	Added
 
+2011/08/21
+	* Fixed monsters above Lv99 displaying a Lv99 aura (bugreport:3986). [Ai4rei]
+	- The server no longer caps the level sent to the client by default.
+	- Servers that require the aura to be displayed at a level different from lv99, either have to alter the client or adjust the 'client_limit_unit_lv' setting.
 2011/08/20
 	* Added quick validation of guild emblems' bitmap format to prevent forged emblems, that cause the client to crash, from being accepted (thx to sinya for a sample). [Ai4rei]
 2011/08/16

+ 2 - 0
conf/Changelog.txt

@@ -1,5 +1,7 @@
 Date	Added
 
+2011/08/21
+	* Rev. 14938 Added setting 'client_limit_unit_lv' to control the unit types which are affected by 'max_lv' and 'aura_lv' settings. [Ai4rei]
 2011/07/09
 	* Rev. 14892 Removed 'msg_athena.conf' messages 619 and 620 (duplicates to 572 and 573) (since r5506). [Ai4rei]
 2011/05/13

+ 8 - 0
conf/battle/client.conf

@@ -17,6 +17,8 @@
 //--------------------------------------------------------------
 // Note 1: Value is a config switch (on/off, yes/no or 1/0)
 // Note 2: Value is in percents (100 means 100%)
+// Note 3: Value is a bit field. If no description is given,
+//         assume unit types (1: Pc, 2: Mob, 4: Pet, 8: Homun, 16: Mercenary)
 //--------------------------------------------------------------
 
 // Set here which client version do you accept. Add all values of clients:
@@ -86,6 +88,12 @@ max_lv: 99
 //          150 or more will be reported as having level 99 and show an aura.
 aura_lv: 99
 
+// Units types affected by max_lv and aura_lv settings. (Note 3)
+// Note: If an unit type, which normally does not show an aura, is
+//       set it will obtain an aura when it meets the level requirement.
+// Default: 0 (none)
+client_limit_unit_lv: 0
+
 // Will tuxedo and wedding dresses be shown when worn? (Note 1)
 wedding_modifydisplay: no
 

+ 1 - 0
src/map/battle.c

@@ -4014,6 +4014,7 @@ static const struct _battle_data {
 	{ "display_party_name",                 &battle_config.display_party_name,              0,      0,      1,              },
 	{ "cashshop_show_points",               &battle_config.cashshop_show_points,            0,      0,      1,              },
 	{ "mail_show_status",                   &battle_config.mail_show_status,                0,      0,      2,              },
+	{ "client_limit_unit_lv",               &battle_config.client_limit_unit_lv,            0,      0,      BL_ALL,         },
 // BattleGround Settings
 	{ "bg_update_interval",                 &battle_config.bg_update_interval,              1000,   100,    INT_MAX,        },
 	{ "bg_short_attack_damage_rate",        &battle_config.bg_short_damage_rate,            80,     0,      INT_MAX,        },

+ 1 - 0
src/map/battle.h

@@ -487,6 +487,7 @@ extern struct Battle_Config
 	int display_party_name;
 	int cashshop_show_points;
 	int mail_show_status;
+	int client_limit_unit_lv;
 
 	// [BattleGround Settings]
 	int bg_update_interval;

+ 50 - 9
src/map/clif.c

@@ -756,13 +756,54 @@ void clif_get_weapon_view(struct map_session_data* sd, unsigned short *rhand, un
 }
 
 //To make the assignation of the level based on limits clearer/easier. [Skotlex]
-static int clif_setlevel(int lv)
+static int clif_setlevel_sub(int lv)
 {
-   if( lv < battle_config.max_lv )
-	  return lv;
-   if( lv < battle_config.aura_lv )
-	  return battle_config.max_lv - 1;
-   return battle_config.max_lv;
+	if( lv < battle_config.max_lv )
+	{
+		;
+	}
+	else if( lv < battle_config.aura_lv )
+	{
+		lv = battle_config.max_lv - 1;
+	}
+	else
+	{
+		lv = battle_config.max_lv;
+	}
+
+	return lv;
+}
+
+static int clif_setlevel(struct block_list* bl)
+{
+	int lv = status_get_lv(bl);
+
+	switch( bl->type )
+	{
+		case BL_PC:
+		case BL_HOM:
+		case BL_MOB:
+		case BL_MER:
+			if( battle_config.client_limit_unit_lv&bl->type )
+			{
+				lv = clif_setlevel_sub(lv);
+			}
+			break;
+		case BL_NPC:
+		case BL_PET:
+			if( battle_config.client_limit_unit_lv&bl->type )
+			{
+				lv = clif_setlevel_sub(lv);
+				break;
+			}
+			// npcs and pets do not have level
+			return 0;
+		default:
+			ShowWarning("clif_setlevel: Unhandled bl type %d.\n", bl->type);
+			break;
+	}
+
+	return lv;
 }
 
 /*==========================================
@@ -916,7 +957,7 @@ static int clif_set_unit_idle(struct block_list* bl, unsigned char* buffer, bool
 		offset++;
 		buf = WBUFP(buffer,offset);
 	}
-	WBUFW(buf,51) = clif_setlevel(status_get_lv(bl));
+	WBUFW(buf,51) = clif_setlevel(bl);
 #if PACKETVER < 20091103
 	if (type) //End for non-player packet
 		return packet_len(WBUFW(buffer,0));
@@ -1027,7 +1068,7 @@ static int clif_set_unit_walking(struct block_list* bl, struct unit_data* ud, un
 	WBUFPOS2(buf,50,bl->x,bl->y,ud->to_x,ud->to_y,8,8);
 	WBUFB(buf,56) = (sd)? 5 : 0;
 	WBUFB(buf,57) = (sd)? 5 : 0;
-	WBUFW(buf,58) = clif_setlevel(status_get_lv(bl));
+	WBUFW(buf,58) = clif_setlevel(bl);
 #if PACKETVER >= 20080102
 	WBUFW(buf,60) = sd?sd->user_font:0;
 #endif
@@ -3102,7 +3143,7 @@ int clif_changeoption2(struct block_list* bl)
 	WBUFW(buf,0) = 0x28a;
 	WBUFL(buf,2) = bl->id;
 	WBUFL(buf,6) = sc->option;
-	WBUFL(buf,10) = clif_setlevel(status_get_lv(bl));
+	WBUFL(buf,10) = clif_setlevel(bl);
 	WBUFL(buf,14) = sc->opt3;
 	if(disguised(bl)) {
 		clif_send(buf,packet_len(0x28a),bl,AREA_WOS);