summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-03-04 17:26:07 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-03-04 17:26:07 +0000
commit134bf364c8deffa192fb77a323b92b708a2e2276 (patch)
tree606cb191f9a0d4a3897866a0c8086fed6a3b7333 /src/map/battle.c
parent23d9eff296a39897242648b4e5f89aaa14f945ea (diff)
downloadhercules-134bf364c8deffa192fb77a323b92b708a2e2276.tar.gz
hercules-134bf364c8deffa192fb77a323b92b708a2e2276.tar.bz2
hercules-134bf364c8deffa192fb77a323b92b708a2e2276.tar.xz
hercules-134bf364c8deffa192fb77a323b92b708a2e2276.zip
Small edits to battleground code (bugreport:2816)
- removed bg_idle_announce setting (could be considered later) - moved crystal protection code to battle_calc_bg_damage - removed mob state 'inmunity' in favor of a script-based solution - removed unneeded 'setmobdata' (fixes collision with mob controller) - added svn:eol-style native for battleground code git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13565 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c33
1 files changed, 13 insertions, 20 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 6485a53e7..b8fec30cb 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -283,13 +283,6 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i
if( mob_ksprotected(src, bl) )
return 0;
- if( bl->type == BL_MOB )
- { // Event Emperiums works like GvG Emperiums
- struct mob_data *md = BL_CAST(BL_MOB, bl);
- if( map[bl->m].flag.battleground && (md->class_ == 1914 || md->class_ == 1915) && flag&BF_SKILL )
- return 0; // Crystal Cannot receive magic damage on battlegrounds
- }
-
if (bl->type == BL_PC) {
sd=(struct map_session_data *)bl;
//Special no damage states
@@ -536,7 +529,16 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i
*------------------------------------------*/
int battle_calc_bg_damage(struct block_list *src, struct block_list *bl, int damage, int div_, int skill_num, int skill_lv, int flag)
{
- if( !damage ) return 0;
+ if( !damage )
+ return 0;
+
+ if( bl->type == BL_MOB )
+ {
+ struct mob_data* md = BL_CAST(BL_MOB, bl);
+ if( map[bl->m].flag.battleground && (md->class_ == 1914 || md->class_ == 1915) && flag&BF_SKILL )
+ return 0; // Crystal cannot receive skill damage on battlegrounds
+ }
+
switch( skill_num )
{
case PA_PRESSURE:
@@ -572,17 +574,12 @@ int battle_calc_bg_damage(struct block_list *src, struct block_list *bl, int dam
*------------------------------------------*/
int battle_calc_gvg_damage(struct block_list *src,struct block_list *bl,int damage,int div_,int skill_num,int skill_lv,int flag)
{
- struct mob_data *md = NULL;
- int class_;
+ struct mob_data* md = BL_CAST(BL_MOB, bl);
+ int class_ = status_get_class(bl);
if (!damage) //No reductions to make.
return 0;
- class_ = status_get_class(bl);
-
- if (bl->type == BL_MOB)
- md=(struct mob_data *)bl;
-
if(md && md->guardian_data) {
if(class_ == MOBID_EMPERIUM && flag&BF_SKILL)
//Skill immunity.
@@ -598,8 +595,7 @@ int battle_calc_gvg_damage(struct block_list *src,struct block_list *bl,int dama
if (!g) return 0;
if (class_ == MOBID_EMPERIUM && guild_checkskill(g,GD_APPROVAL) <= 0)
return 0;
- if (battle_config.guild_max_castles &&
- guild_checkcastles(g)>=battle_config.guild_max_castles)
+ if (battle_config.guild_max_castles && guild_checkcastles(g)>=battle_config.guild_max_castles)
return 0; // [MouseJstr]
}
}
@@ -3263,8 +3259,6 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
if( !((agit_flag || agit2_flag) && map[m].flag.gvg_castle) && md->guardian_data && md->guardian_data->guild_id )
return 0; // Disable guardians/emperiums owned by Guilds on non-woe times.
- if( md->state.inmunity && flag&BCT_ENEMY )
- return 0;
break;
}
}
@@ -3842,7 +3836,6 @@ static const struct _battle_data {
{ "bg_magic_attack_damage_rate", &battle_config.bg_magic_damage_rate, 60, 0, INT_MAX, },
{ "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, },
- { "bg_idle_announce", &battle_config.bg_idle_announce, 0, 0, INT_MAX, },
};