summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/battle.c16
-rw-r--r--src/map/map.h6
-rw-r--r--src/map/pc.c6
-rw-r--r--src/map/pc.h1
-rw-r--r--src/map/skill.c23
-rw-r--r--src/map/status.c1
6 files changed, 39 insertions, 14 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 879e6c0db..1ac70f77b 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -1712,8 +1712,20 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
short vit_def;
signed char def1 = status_get_def(target); //Don't use tstatus->def1 due to skill timer reductions.
short def2 = (short)tstatus->def2;
- if(battle_config.vit_penalty_type &&
- battle_config.vit_penalty_target&target->type)
+
+ if( sd )
+ {
+ i = sd->ignore_def[is_boss(target)?RC_BOSS:RC_NONBOSS];
+ i += sd->ignore_def[tstatus->race];
+ if( i )
+ {
+ if( i > 100 ) i = 100;
+ def1 -= def1 * i / 100;
+ // def2 -= def2 * i / 100;
+ }
+ }
+
+ if( battle_config.vit_penalty_type && battle_config.vit_penalty_target&target->type )
{
unsigned char target_count; //256 max targets should be a sane max
target_count = unit_counttargeted(target,battle_config.vit_penalty_count_lv);
diff --git a/src/map/map.h b/src/map/map.h
index 159b8da0d..1504c773f 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -220,7 +220,9 @@ enum auto_trigger_flag {
ATF_SELF=0x01,
ATF_TARGET=0x02,
ATF_SHORT=0x04,
- ATF_LONG=0x08
+ ATF_LONG=0x08,
+ ATF_WEAPON=0x10,
+ ATF_SKILL=0x20,
};
struct block_list {
@@ -303,7 +305,7 @@ enum _sp {
SP_HP_DRAIN_VALUE,SP_SP_DRAIN_VALUE, // 1079-1080
SP_WEAPON_ATK,SP_WEAPON_ATK_RATE, // 1081-1082
SP_DELAYRATE,SP_HP_DRAIN_RATE_RACE,SP_SP_DRAIN_RATE_RACE, // 1083-1085
- SP_IGNORE_MDEF_RATE, //1086
+ SP_IGNORE_MDEF_RATE, SP_IGNORE_DEF_RATE, //1086-1087
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_NO_MISC_DAMAGE,SP_UNBREAKABLE_WEAPON,SP_UNBREAKABLE_ARMOR, SP_UNBREAKABLE_HELM, // 2006-2010
diff --git a/src/map/pc.c b/src/map/pc.c
index c2fa49e72..f9149b086 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -1487,6 +1487,8 @@ static int pc_bonus_addeff(struct s_addeffect* effect, int max, enum sc_type id,
flag|=ATF_SHORT|ATF_LONG; //Default range: both
if (!(flag&(ATF_TARGET|ATF_SELF)))
flag|=ATF_TARGET; //Default target: enemy.
+ if (!(flag&(ATF_WEAPON|ATF_SKILL)))
+ flag|=ATF_WEAPON; //Defatul type: weapon.
for (i = 0; i < max && effect[i].flag; i++) {
if (effect[i].id == id && effect[i].flag == flag)
@@ -2533,6 +2535,10 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val)
if(sd->state.lr_flag != 2)
sd->ignore_mdef[type2] += val;
break;
+ case SP_IGNORE_DEF_RATE:
+ if(sd->state.lr_flag != 2)
+ sd->ignore_def[type2] += val;
+ break;
default:
ShowWarning("pc_bonus2: unknown type %d %d %d!\n",type,type2,val);
diff --git a/src/map/pc.h b/src/map/pc.h
index cef9b5df5..87ecd3279 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -202,6 +202,7 @@ struct map_session_data {
int critaddrace[RC_MAX];
int expaddrace[RC_MAX];
int ignore_mdef[RC_MAX];
+ int ignore_def[RC_MAX];
int itemgrouphealrate[MAX_ITEMGROUP];
short sp_gain_race[RC_MAX];
// zeroed arrays end here.
diff --git a/src/map/skill.c b/src/map/skill.c
index e344b1630..bd4bd618f 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -842,27 +842,30 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
break;
}
- if( sd && attack_type&BF_WEAPON &&
- skillid != WS_CARTTERMINATION &&
- skillid != AM_DEMONSTRATION &&
- skillid != CR_REFLECTSHIELD && skillid != MS_REFLECTSHIELD &&
- skillid != ASC_BREAKER )
+ if( sd && skillid != WS_CARTTERMINATION && skillid != AM_DEMONSTRATION && skillid != CR_REFLECTSHIELD && skillid != MS_REFLECTSHIELD && skillid != ASC_BREAKER )
{ // Trigger status effects
enum sc_type type;
int i;
- for(i=0; i < ARRAYLENGTH(sd->addeff) && sd->addeff[i].flag; i++)
+ for( i = 0; i < ARRAYLENGTH(sd->addeff) && sd->addeff[i].flag; i++ )
{
rate = sd->addeff[i].rate;
- if (attack_type&BF_LONG) // Any ranged physical attack takes status arrows into account (Grimtooth...) [DracoRPG]
+ if( attack_type&BF_LONG ) // Any ranged physical attack takes status arrows into account (Grimtooth...) [DracoRPG]
rate += sd->addeff[i].arrow_rate;
- if (!rate) continue;
+ if( !rate ) continue;
- if ((sd->addeff[i].flag&(ATF_LONG|ATF_SHORT)) != (ATF_LONG|ATF_SHORT))
- { //Trigger has range consideration.
+ if( (sd->addeff[i].flag&(ATF_WEAPON|ATF_SKILL)) != (ATF_WEAPON|ATF_SKILL) )
+ { // Trigger has attack type consideration.
+ if( (sd->addeff[i].flag&ATF_WEAPON && !(attack_type&BF_WEAPON)) || (sd->addeff[i].flag&ATF_SKILL && !(attack_type&(BF_MAGIC|BF_MISC))) )
+ continue;
+ }
+
+ if( (sd->addeff[i].flag&(ATF_LONG|ATF_SHORT)) != (ATF_LONG|ATF_SHORT) )
+ { // Trigger has range consideration.
if((sd->addeff[i].flag&ATF_LONG && !(attack_type&BF_LONG)) ||
(sd->addeff[i].flag&ATF_SHORT && !(attack_type&BF_SHORT)))
continue; //Range Failed.
}
+
type = sd->addeff[i].id;
skill = skill_get_time2(status_sc2skill(type),7);
diff --git a/src/map/status.c b/src/map/status.c
index 189c70e68..5b38fd17a 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -1715,6 +1715,7 @@ int status_calc_pc(struct map_session_data* sd,int first)
+ sizeof(sd->critaddrace)
+ sizeof(sd->expaddrace)
+ sizeof(sd->ignore_mdef)
+ + sizeof(sd->ignore_def)
+ sizeof(sd->itemgrouphealrate)
+ sizeof(sd->sp_gain_race)
);