summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/battle.c9
-rw-r--r--src/map/party.h1
-rw-r--r--src/map/pc.c8
-rw-r--r--src/map/skill.c23
-rw-r--r--src/map/status.c4
5 files changed, 20 insertions, 25 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index f1679024e..358eb5746 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -149,7 +149,7 @@ struct delay_damage {
unsigned short skill_lv;
unsigned short skill_id;
unsigned short dmg_lv;
- unsigned char attack_type;
+ unsigned short attack_type;
};
int battle_delay_damage_sub (int tid, unsigned int tick, int id, int data)
@@ -163,7 +163,7 @@ int battle_delay_damage_sub (int tid, unsigned int tick, int id, int data)
if ((dat->dmg_lv == ATK_DEF || dat->damage > 0) && dat->attack_type)
{
if (!status_isdead(target))
- skill_additional_effect(dat->src,target,dat->skill_id,dat->skill_lv,dat->attack_type, tick);
+ skill_additional_effect(dat->src,target,dat->skill_id,dat->skill_lv,dat->attack_type,tick);
skill_counter_additional_effect(dat->src,target,dat->skill_id,dat->skill_lv,dat->attack_type,tick);
}
@@ -2785,8 +2785,7 @@ void battle_drain(TBL_PC *sd, struct block_list *tbl, int rdamage, int ldamage,
* ’Ê?í?UŒ‚?ˆ—?‚Ü‚Æ‚ß
*------------------------------------------
*/
-int battle_weapon_attack( struct block_list *src,struct block_list *target,
- unsigned int tick,int flag)
+int battle_weapon_attack(struct block_list* src, struct block_list* target, unsigned int tick, int flag)
{
struct map_session_data *sd = NULL, *tsd = NULL;
struct status_data *sstatus, *tstatus;
@@ -2929,7 +2928,7 @@ int battle_weapon_attack( struct block_list *src,struct block_list *target,
map_freeblock_lock();
- battle_delay_damage(tick+wd.amotion, src, target, BF_WEAPON, 0, 0, damage, wd.dmg_lv, wd.dmotion);
+ battle_delay_damage(tick+wd.amotion, src, target, wd.flag, 0, 0, damage, wd.dmg_lv, wd.dmotion);
if (sc && sc->data[SC_AUTOSPELL].timer != -1 && rand()%100 < sc->data[SC_AUTOSPELL].val4) {
int sp = 0;
diff --git a/src/map/party.h b/src/map/party.h
index 4c87dd501..f8ceb67f8 100644
--- a/src/map/party.h
+++ b/src/map/party.h
@@ -46,5 +46,4 @@ int party_send_dot_remove(struct map_session_data *sd);
int party_sub_count(struct block_list *bl, va_list ap);
int party_foreachsamemap(int (*func)(struct block_list *,va_list),struct map_session_data *sd,int type,...);
-
#endif /* _PARTY_H_ */
diff --git a/src/map/pc.c b/src/map/pc.c
index cff5069d5..06161cffe 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -2329,11 +2329,11 @@ int pc_bonus3(struct map_session_data *sd,int type,int type2,int type3,int val)
break;
case SP_AUTOSPELL:
if(sd->state.lr_flag != 2)
- pc_bonus_autospell(sd->autospell, MAX_PC_BONUS, type2, type3, val, BF_WEAPON|BF_SHORT|BF_LONG, current_equip_card_id);
+ pc_bonus_autospell(sd->autospell, MAX_PC_BONUS, type2, type3, val, BF_WEAPON|BF_SHORT|BF_LONG|BF_NORMAL, current_equip_card_id);
break;
case SP_AUTOSPELL_WHENHIT:
if(sd->state.lr_flag != 2)
- pc_bonus_autospell(sd->autospell2, MAX_PC_BONUS, type2, type3, val, BF_WEAPON|BF_SHORT|BF_LONG, current_equip_card_id);
+ pc_bonus_autospell(sd->autospell2, MAX_PC_BONUS, type2, type3, val, BF_WEAPON|BF_SHORT|BF_LONG|BF_NORMAL, current_equip_card_id);
break;
case SP_HP_LOSS_RATE:
if(sd->state.lr_flag != 2) {
@@ -2422,12 +2422,12 @@ int pc_bonus4(struct map_session_data *sd,int type,int type2,int type3,int type4
switch(type){
case SP_AUTOSPELL:
if(sd->state.lr_flag != 2)
- pc_bonus_autospell(sd->autospell, MAX_PC_BONUS, (val&1?type2:-type2), (val&2?-type3:type3), type4, BF_WEAPON|BF_SHORT|BF_LONG, current_equip_card_id);
+ pc_bonus_autospell(sd->autospell, MAX_PC_BONUS, (val&1?type2:-type2), (val&2?-type3:type3), type4, BF_WEAPON|BF_SHORT|BF_LONG|BF_NORMAL, current_equip_card_id);
break;
case SP_AUTOSPELL_WHENHIT:
if(sd->state.lr_flag != 2)
- pc_bonus_autospell(sd->autospell2, MAX_PC_BONUS, (val&1?type2:-type2), (val&2?-type3:type3), type4, BF_WEAPON|BF_SHORT|BF_LONG, current_equip_card_id);
+ pc_bonus_autospell(sd->autospell2, MAX_PC_BONUS, (val&1?type2:-type2), (val&2?-type3:type3), type4, BF_WEAPON|BF_SHORT|BF_LONG|BF_NORMAL, current_equip_card_id);
break;
default:
if(battle_config.error_log)
diff --git a/src/map/skill.c b/src/map/skill.c
index 34c07dd51..1279aa822 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1349,7 +1349,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
break;
case TK_TURNKICK:
case MO_BALKYOUNG: //Note: attack_type is passed as BF_WEAPON for the actual target, BF_MISC for the splash-affected mobs.
- if(attack_type == BF_MISC) //70% base stun chance...
+ if(attack_type&BF_MISC) //70% base stun chance...
sc_start(bl,SC_STUN,70,skilllv,skill_get_time2(skillid,skilllv));
break;
case GS_BULLSEYE: //0.1% coma rate.
@@ -1410,18 +1410,18 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
src = sd?&sd->bl:src;
}
- //Reports say that autospell effects get triggered on skills and pretty much everything including splash attacks. [Skotlex]
- //But Gravity Patched this silently, and it now seems to trigger only on
- //weapon attacks.
+ // Autospell when attacking
if(sd && !status_isdead(bl) && src != bl && sd->autospell[0].id) {
struct block_list *tbl;
struct unit_data *ud;
int i, skilllv;
+
for (i = 0; i < MAX_PC_BONUS && sd->autospell[i].id; i++) {
- if(!(sd->autospell[i].flag&attack_type&BF_RANGEMASK &&
- sd->autospell[i].flag&attack_type&BF_WEAPONMASK))
- continue; //Attack type or range type did not match.
+ if(!(sd->autospell[i].flag&attack_type&BF_WEAPONMASK &&
+ sd->autospell[i].flag&attack_type&BF_RANGEMASK &&
+ sd->autospell[i].flag&attack_type&BF_SKILLMASK))
+ continue; // one or more trigger conditions were not fulfilled
skill = (sd->autospell[i].id > 0) ? sd->autospell[i].id : -sd->autospell[i].id;
@@ -1583,7 +1583,7 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
}
}
- //Trigger counter-spells to retaliate against damage causing skills. [Skotlex]
+ // Trigger counter-spells to retaliate against damage causing skills.
if(dstsd && !status_isdead(bl) && src != bl && dstsd->autospell2[0].id &&
!(skillid && skill_get_nk(skillid)&NK_NO_DAMAGE))
{
@@ -1593,9 +1593,10 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
for (i = 0; i < MAX_PC_BONUS && dstsd->autospell2[i].id; i++) {
- if(!(dstsd->autospell2[i].flag&attack_type&BF_RANGEMASK &&
- dstsd->autospell2[i].flag&attack_type&BF_WEAPONMASK))
- continue; //Attack type or range type did not match.
+ if(!(dstsd->autospell2[i].flag&attack_type&BF_WEAPONMASK &&
+ dstsd->autospell2[i].flag&attack_type&BF_RANGEMASK &&
+ dstsd->autospell2[i].flag&attack_type&BF_SKILLMASK))
+ continue; // one or more trigger conditions were not fulfilled
skillid = (dstsd->autospell2[i].id > 0) ? dstsd->autospell2[i].id : -dstsd->autospell2[i].id;
skilllv = dstsd->autospell2[i].lv?dstsd->autospell2[i].lv:1;
diff --git a/src/map/status.c b/src/map/status.c
index 564d10d08..24d347b72 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -3539,8 +3539,6 @@ static signed char status_calc_def(struct block_list *bl, struct status_change *
def += sc->data[SC_DEFENCE].val2 ;
if(sc->data[SC_INCDEFRATE].timer!=-1)
def += def * sc->data[SC_INCDEFRATE].val1/100;
- if(sc->data[SC_FREEZE].timer!=-1)
- def >>=1;
if(sc->data[SC_STONE].timer!=-1 && sc->opt1 == OPT1_STONE)
def >>=1;
if(sc->data[SC_SIGNUMCRUCIS].timer!=-1)
@@ -3606,8 +3604,6 @@ static signed char status_calc_mdef(struct block_list *bl, struct status_change
return 90;
if(sc->data[SC_SKA].timer != -1) // [marquis007]
return 90;
- if(sc->data[SC_FREEZE].timer!=-1)
- mdef += 25*mdef/100;
if(sc->data[SC_STONE].timer!=-1 && sc->opt1 == OPT1_STONE)
mdef += 25*mdef/100;
if(sc->data[SC_ENDURE].timer!=-1 && sc->data[SC_ENDURE].val4 == 0)