Переглянути джерело

* Added another GM trust config for party invitations (bugreport:2004)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@13051 54d463be-8e91-2dee-dedb-b68131a5f0ec
sketchyphoenix 17 роки тому
батько
коміт
f32ca3d261
5 змінених файлів з 26 додано та 1 видалено
  1. 2 0
      Changelog-Trunk.txt
  2. 10 0
      conf/battle/gm.conf
  3. 2 0
      src/map/battle.c
  4. 2 0
      src/map/battle.h
  5. 10 1
      src/map/party.c

+ 2 - 0
Changelog-Trunk.txt

@@ -3,6 +3,8 @@ Date	Added
 AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
+2008/08/07
+	* Added another GM trust config for party invitations (bugreport:2004) [SketchyPhoenix]
 2008/08/04
 	* Added configs for quest table name adjustment (bugreport:1778)
 2008/08/02

+ 10 - 0
conf/battle/gm.conf

@@ -96,6 +96,16 @@ disp_hpmeter: 0
 // (Default: 0 = Disabled).
 gm_viewequip_min_lv: 0
 
+// Can GMs invite non GMs to a party? (Note 1)
+// set to 'No', GMs under the party invite trust level may not invite non GMs to a party.
+// set to 'Yes', All GMs can invite any player to a party.
+// Also, as long as this is off, players cannot invite GMs to a party as well.
+gm_can_party: no
+
+//The trust level for GMs to invite to a party. Any GMs ABOVE this level will be able to invite normal
+//players into their party in addittion to other GMs. (regardless of gm_can_party)
+gm_cant_party_max_lv: 80
+
 // Players Titles (check msg_athena.conf for title strings)
 // You may assign different titles for your Players and GMs
 title_lvl1: 1

+ 2 - 0
src/map/battle.c

@@ -3403,6 +3403,8 @@ static const struct _battle_data {
 	{ "gm_skill_unconditional",             &battle_config.gm_skilluncond,                  0,      0,      100,            },
 	{ "gm_join_chat",                       &battle_config.gm_join_chat,                    0,      0,      100,            },
 	{ "gm_kick_chat",                       &battle_config.gm_kick_chat,                    0,      0,      100,            },
+	{ "gm_can_party",                       &battle_config.gm_can_party,                    0,      0,      1,              },
+	{ "gm_cant_party_max_lv",               &battle_config.gm_cant_party_max_lv,            80,     0,      100,            },
 	{ "player_skillfree",                   &battle_config.skillfree,                       0,      0,      1,              },
 	{ "player_skillup_limit",               &battle_config.skillup_limit,                   1,      0,      1,              },
 	{ "weapon_produce_rate",                &battle_config.wp_rate,                         100,    0,      INT_MAX,        },

+ 2 - 0
src/map/battle.h

@@ -328,6 +328,8 @@ extern struct Battle_Config
 	int disp_hpmeter;
 	int bone_drop;
 	int buyer_name;
+	int gm_cant_party_max_lv;
+	int gm_can_party; // [SketchyPhoenix]
 
 // eAthena additions
 	int night_at_start; // added by [Yor]

+ 10 - 1
src/map/party.c

@@ -287,7 +287,16 @@ int party_invite(struct map_session_data *sd,struct map_session_data *tsd)
 	nullpo_retr(0, sd);
 	if (p==NULL)
 		return 0;
-
+	
+	if ( (pc_isGM(sd) && !pc_isGM(tsd) && !battle_config.gm_can_party && pc_isGM(sd) < battle_config.gm_cant_party_max_lv)
+		|| ( !pc_isGM(sd) && pc_isGM(tsd) && !battle_config.gm_can_party ) )
+	{
+		//GMs can't invite non GMs to the party if not above the invite trust level
+		//Likewise, as long as gm_can_party is off, players can't invite GMs.
+		clif_displaymessage(sd->fd, msg_txt(81));
+		return 0;
+	}
+	
 	if(tsd==NULL) {	//TODO: Find the correct reply packet.
 		clif_displaymessage(sd->fd, msg_txt(3));
 		return 0;