From 6ebedc8ce5d97d55cf4fe395471c8fee7bd309a9 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Thu, 26 Jul 2012 02:30:41 +0000 Subject: 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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16502 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/battle.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/map/battle.c b/src/map/battle.c index aff678365..11efc70e0 100644 --- a/src/map/battle.c +++ b/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; -- cgit v1.2.3-70-g09d2