summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-05-17 09:06:40 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-05-17 09:06:40 +0000
commit19d277340dece57918d6d502e8098dd821a976d9 (patch)
treefdca960e95991f2637b86bae88627353af377b11 /src/map/battle.c
parent89b474156401347a36d84f2aeb58b1ab0c2f8a33 (diff)
downloadhercules-19d277340dece57918d6d502e8098dd821a976d9.tar.gz
hercules-19d277340dece57918d6d502e8098dd821a976d9.tar.bz2
hercules-19d277340dece57918d6d502e8098dd821a976d9.tar.xz
hercules-19d277340dece57918d6d502e8098dd821a976d9.zip
Fixed bugreport:5620 Fear Breeze auto attack should now trigger properly.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16122 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 2e72c2a46..a27ea59a1 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -1374,8 +1374,7 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
flag.lh=1;
}
- if( sd && !skill_num )
- { //Check for double attack.
+ if( sd && !skill_num ) { //Check for double attack.
if( ( ( skill_lv = pc_checkskill(sd,TF_DOUBLE) ) > 0 && sd->weapontype1 == W_DAGGER )
|| ( sd->double_rate > 0 && sd->weapontype1 != W_FIST ) ) //Will fail bare-handed
{ //Success chance is not added, the higher one is used [Skotlex]
@@ -1390,6 +1389,20 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
wd.div_ = skill_get_num(GS_CHAINACTION,skill_lv);
wd.type = 0x08;
}
+ else if(sc && sc->data[SC_FEARBREEZE] && sd->weapontype1==W_BOW && (i = sd->equip_index[EQI_AMMO]) >= 0 && sd->inventory_data[i] && sd->status.inventory[i].amount > 1){
+ short rate[] = { 4, 4, 7, 9, 10 };
+ if(sc->data[SC_FEARBREEZE]->val1 > 0 && sc->data[SC_FEARBREEZE]->val1 < 6 && rand()%100 < rate[sc->data[SC_FEARBREEZE]->val1-1]) {
+ wd.type = 0x08;
+ wd.div_ = 2;
+ if(sc->data[SC_FEARBREEZE]->val1 > 2){
+ int chance = rand()%100;
+ wd.div_ += (chance >= 40) + (chance >= 70) + (chance >= 90);
+ wd.div_ = min(wd.div_,sc->data[SC_FEARBREEZE]->val1);
+ }
+ wd.div_ = min(wd.div_,sd->status.inventory[i].amount);
+ sc->data[SC_FEARBREEZE]->val4 = wd.div_-1;
+ }
+ }
}
//Check for critical
@@ -4338,6 +4351,11 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
}
if( sc->data[SC_GIANTGROWTH] && (wd.flag&BF_SHORT) && rnd()%100 < sc->data[SC_GIANTGROWTH]->val2 )
wd.damage *= 3; // Triple Damage
+
+ if( sc->data[SC_FEARBREEZE] && sc->data[SC_FEARBREEZE]->val4 > 0 && sd->status.inventory[sd->equip_index[EQI_AMMO]].amount >= sc->data[SC_FEARBREEZE]->val4 && battle_config.arrow_decrement){
+ pc_delitem(sd,sd->equip_index[EQI_AMMO],sc->data[SC_FEARBREEZE]->val4,0,1,LOG_TYPE_CONSUME);
+ sc->data[SC_FEARBREEZE]->val4 = 0;
+ }
}
if (sd && sd->state.arrow_atk) //Consume arrow.
battle_consume_ammo(sd, 0, 0);