diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-07-30 18:56:33 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-07-30 18:56:33 +0000 |
commit | 1dc97e8a346414a600bedc25969d5ae21c28f401 (patch) | |
tree | d3143bd27af5046d7de7ddb96ebc47939b55f7b8 /src/map | |
parent | 0cc1e7bfbd0d93024a12ee6f5d2aaf8f95b408d1 (diff) | |
download | hercules-1dc97e8a346414a600bedc25969d5ae21c28f401.tar.gz hercules-1dc97e8a346414a600bedc25969d5ae21c28f401.tar.bz2 hercules-1dc97e8a346414a600bedc25969d5ae21c28f401.tar.xz hercules-1dc97e8a346414a600bedc25969d5ae21c28f401.zip |
- Added bNoMiscDamage setting so you can specify misc-damage blocking from skills. Modified battle_calc_damage so that even Pressure and similar skills will be affected by this setting.
- Removed SC_LANDPROTECTOR as it wasn't being used by anything.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7982 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/battle.c | 23 | ||||
-rw-r--r-- | src/map/map.h | 5 | ||||
-rw-r--r-- | src/map/pc.c | 6 | ||||
-rw-r--r-- | src/map/status.c | 1 | ||||
-rw-r--r-- | src/map/status.h | 2 |
5 files changed, 20 insertions, 17 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index 27f926c33..f2613b98b 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -226,7 +226,6 @@ int battle_attr_fix(struct block_list *src, struct block_list *target, int damag int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,int div_,int skill_num,int skill_lv,int flag) { struct map_session_data *sd = NULL; - struct mob_data *md = NULL; struct status_change *sc; struct status_change_entry *sci; @@ -235,9 +234,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i if (!damage) return 0; - if (bl->type == BL_MOB) { - md=(struct mob_data *)bl; - } else if (bl->type == BL_PC) { + if (bl->type == BL_PC) { sd=(struct map_session_data *)bl; //Special no damage states if(flag&BF_WEAPON && sd->special_state.no_weapon_damage) @@ -246,8 +243,14 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i if(flag&BF_MAGIC && sd->special_state.no_magic_damage) damage -= damage*sd->special_state.no_magic_damage/100; + if(flag&BF_MISC && sd->special_state.no_misc_damage) + damage -= damage*sd->special_state.no_misc_damage/100; + if(!damage) return 0; } + + if (skill_num == PA_PRESSURE || skill_num == NJ_ZENYNAGE) + return damage; //These two bypass everything else. sc = status_get_sc(bl); @@ -271,9 +274,6 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i status_change_end(bl,SC_SAFETYWALL,-1); } - if(sc->data[SC_LANDPROTECTOR].timer!=-1 && flag&BF_MAGIC) - return 0; - if(sc->data[SC_AUTOGUARD].timer != -1 && flag&BF_WEAPON && rand()%100 < sc->data[SC_AUTOGUARD].val2) { int delay; @@ -438,11 +438,11 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i damage = div_; } - if( md && !status_isdead(bl) && src != bl) { + if( bl->type == BL_MOB && !status_isdead(bl) && src != bl) { if (damage > 0 ) - mobskill_event(md,src,gettick(),flag); + mobskill_event((TBL_MOB*)bl,src,gettick(),flag); if (skill_num) - mobskill_event(md,src,gettick(),MSC_SKILLUSED|(skill_num<<16)); + mobskill_event((TBL_MOB*)bl,src,gettick(),MSC_SKILLUSED|(skill_num<<16)); } return damage; @@ -2691,8 +2691,7 @@ struct Damage battle_calc_misc_attack( md.damage=battle_attr_fix(src, target, md.damage, s_ele, tstatus->def_ele, tstatus->ele_lv); - if (skill_num != PA_PRESSURE && skill_num != NJ_ZENYNAGE) //Pressure ignores all these things... and Throw Money ? - md.damage=battle_calc_damage(src,target,md.damage,md.div_,skill_num,skill_lv,md.flag); + md.damage=battle_calc_damage(src,target,md.damage,md.div_,skill_num,skill_lv,md.flag); if (map_flag_gvg(target->m)) md.damage=battle_calc_gvg_damage(src,target,md.damage,md.div_,skill_num,skill_lv,md.flag); diff --git a/src/map/map.h b/src/map/map.h index c6a7b168e..cdb91a0f1 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -544,7 +544,7 @@ struct map_session_data { struct guild *gmaster_flag;
} state;
struct {
- unsigned char no_weapon_damage, no_magic_damage;
+ unsigned char no_weapon_damage, no_magic_damage, no_misc_damage;
unsigned killer : 1;
unsigned killable : 1;
unsigned restart_full_recover : 1;
@@ -1152,7 +1152,7 @@ enum { SP_DELAYRATE,SP_HP_DRAIN_RATE_RACE,SP_SP_DRAIN_RATE_RACE, // 1083-1085
SP_RESTART_FULL_RECOVER=2000,SP_NO_CASTCANCEL,SP_NO_SIZEFIX,SP_NO_MAGIC_DAMAGE,SP_NO_WEAPON_DAMAGE,SP_NO_GEMSTONE, // 2000-2005
- SP_NO_CASTCANCEL2,SP_FREE1,SP_UNBREAKABLE_WEAPON,SP_UNBREAKABLE_ARMOR, SP_UNBREAKABLE_HELM, // 2006-2010
+ SP_NO_CASTCANCEL2,SP_NO_MISC_DAMAGE,SP_UNBREAKABLE_WEAPON,SP_UNBREAKABLE_ARMOR, SP_UNBREAKABLE_HELM, // 2006-2010
SP_UNBREAKABLE_SHIELD, SP_LONG_ATK_RATE, // 2011-2012
SP_CRIT_ATK_RATE, SP_CRITICAL_ADDRACE, SP_NO_REGEN, SP_ADDEFF_WHENHIT, SP_AUTOSPELL_WHENHIT, // 2013-2017
@@ -1165,7 +1165,6 @@ enum { SP_ADD_SKILL_BLOW, SP_SP_VANISH_RATE //2041
//Before adding another, note that
//1077 (SP_FREE, previously disguise),
- //2007 (SP_FREE2, previously Infinite Endure)
//are available!
};
diff --git a/src/map/pc.c b/src/map/pc.c index 15d2637ae..16828d87b 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -1625,6 +1625,12 @@ int pc_bonus(struct map_session_data *sd,int type,int val) val+= sd->special_state.no_weapon_damage; sd->special_state.no_weapon_damage = cap_value(val,0,100); break; + case SP_NO_MISC_DAMAGE: + if(sd->state.lr_flag == 2) + break; + val+= sd->special_state.no_misc_damage; + sd->special_state.no_misc_damage = cap_value(val,0,100); + break; case SP_NO_GEMSTONE: if(sd->state.lr_flag != 2) sd->special_state.no_gemstone = 1; diff --git a/src/map/status.c b/src/map/status.c index 5d5c0c6a4..b5298b92e 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -246,7 +246,6 @@ void initChangeTables(void) { set_sc(SA_VOLCANO, SC_VOLCANO, SI_BLANK, SCB_WATK); set_sc(SA_DELUGE, SC_DELUGE, SI_BLANK, SCB_MAXHP); set_sc(SA_VIOLENTGALE, SC_VIOLENTGALE, SI_BLANK, SCB_FLEE); - add_sc(SA_LANDPROTECTOR, SC_LANDPROTECTOR); add_sc(SA_REVERSEORCISH, SC_ORCISH); add_sc(SA_COMA, SC_COMA); set_sc(BD_ENCORE, SC_DANCING, SI_BLANK, SCB_SPEED); diff --git a/src/map/status.h b/src/map/status.h index a15a6c0d7..06e1f3e22 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -112,7 +112,7 @@ enum { SC_DELUGE,
SC_VIOLENTGALE,
SC_WATK_ELEMENT,
- SC_LANDPROTECTOR,
+ SC_LANDPROTECTOR, //Available
SC_ARMOR_ELEMENT,
SC_NOCHAT,
SC_BABY,
|