Przeglądaj źródła

Fixed bugreport:6115 players without guild may now attack guardians during woe, mercenaries no longer can attack emperium.
Special Thanks/Credits To Daegaladh

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

shennetsind 13 lat temu
rodzic
commit
941818dec5
1 zmienionych plików z 8 dodań i 4 usunięć
  1. 8 4
      src/map/battle.c

+ 8 - 4
src/map/battle.c

@@ -915,7 +915,7 @@ int battle_calc_gvg_damage(struct block_list *src,struct block_list *bl,int dama
 			}
 		}
 		if(src->type != BL_MOB) {
-			struct guild *g=guild_search(status_get_guild_id(src));
+			struct guild *g = guild_search(status_get_guild_id(src));
 			if (!g) return 0;
 			if (class_ == MOBID_EMPERIUM && guild_checkskill(g,GD_APPROVAL) <= 0)
 				return 0;
@@ -4871,7 +4871,7 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
 	}
 	
 	switch( target->type ) { // Checks on actual target
-			case BL_PC: {
+		case BL_PC: {
 				struct status_change* sc = status_get_sc(src);
 				if (((TBL_PC*)target)->invincible_timer != INVALID_TIMER || pc_isinvisible((TBL_PC*)target))
 					return -1; //Cannot be targeted yet.
@@ -5009,6 +5009,10 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
 				}
 			}
 			break;
+		case BL_MER:
+			if (t_bl->type == BL_MOB && ((TBL_MOB*)t_bl)->class_ == MOBID_EMPERIUM && flag&BCT_ENEMY)
+				return 0; //mercenary may not attack Emperium
+			break;
 	}
 
 	switch( s_bl->type )
@@ -5031,8 +5035,8 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
 						return 0; // You can't target anything out of your duel
 				}
 			}
-			if( map_flag_gvg(m) && !sd->status.guild_id && t_bl->type == BL_MOB && ((TBL_MOB*)t_bl)->guardian_data )
-				return 0; //If you don't belong to a guild, can't target guardians/emperium.
+			if( map_flag_gvg(m) && !sd->status.guild_id && t_bl->type == BL_MOB && ((TBL_MOB*)t_bl)->class_ == MOBID_EMPERIUM )
+				return 0; //If you don't belong to a guild, can't target emperium.
 			if( t_bl->type != BL_PC )
 				state |= BCT_ENEMY; //Natural enemy.
 			break;