summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authormalufett <malufett.eat.my.binaries@gmail.com>2013-01-17 22:23:33 +0800
committermalufett <malufett.eat.my.binaries@gmail.com>2013-01-17 22:23:33 +0800
commit2bf913eebcc0a18057c9012be187585a7afb2f72 (patch)
treec6331085709e12e4fe58a915b05ed648924b4759 /src/map/battle.c
parent541c5f69913da208356ef68f556d3cb888d01911 (diff)
parent32ea0d89b449710473aab78d83840d22fccfd5b4 (diff)
downloadhercules-2bf913eebcc0a18057c9012be187585a7afb2f72.tar.gz
hercules-2bf913eebcc0a18057c9012be187585a7afb2f72.tar.bz2
hercules-2bf913eebcc0a18057c9012be187585a7afb2f72.tar.xz
hercules-2bf913eebcc0a18057c9012be187585a7afb2f72.zip
Merge remote-tracking branch 'origin/rathena'
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c34
1 files changed, 25 insertions, 9 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 7b6bf5869..0959ea858 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -1857,19 +1857,35 @@ 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]) {
+ 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){
+ int chance = rand()%100;
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);
+ switch(sc->data[SC_FEARBREEZE]->val1){
+ case 5:
+ if( chance < 3){// 3 % chance to attack 5 times.
+ wd.div_ = 5;
+ break;
+ }
+ case 4:
+ if( chance < 7){// 6 % chance to attack 4 times.
+ wd.div_ = 4;
+ break;
+ }
+ case 3:
+ if( chance < 10){// 9 % chance to attack 3 times.
+ wd.div_ = 3;
+ break;
+ }
+ case 2:
+ case 1:
+ if( chance < 13){// 12 % chance to attack 2 times.
+ wd.div_ = 2;
+ break;
+ }
}
wd.div_ = min(wd.div_,sd->status.inventory[i].amount);
sc->data[SC_FEARBREEZE]->val4 = wd.div_-1;
- }
}
}