summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authorInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-06-13 04:25:34 +0000
committerInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-06-13 04:25:34 +0000
commit0580db8bf96e58c76f0b743003fb707a8dc2e4de (patch)
treecfcecad381801d6234c43c07bfcbede9831f05fe /src/map/battle.c
parente0e8a5606bfce797c57e0adad39f174957f6bc49 (diff)
downloadhercules-0580db8bf96e58c76f0b743003fb707a8dc2e4de.tar.gz
hercules-0580db8bf96e58c76f0b743003fb707a8dc2e4de.tar.bz2
hercules-0580db8bf96e58c76f0b743003fb707a8dc2e4de.tar.xz
hercules-0580db8bf96e58c76f0b743003fb707a8dc2e4de.zip
* If both Double Attack and critical attack have chance to trigger within one attack, Double Attack takes priority. (bugreport:3231)
* Fixed Butterfly Wings not working on maps blocking Teleport. (bugreport:3236) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13886 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c43
1 files changed, 19 insertions, 24 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 73bf76ce8..0a6d302c1 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -1066,8 +1066,26 @@ 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( ( ( 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]
+ if( rand()%100 < ( 5*skill_lv > sd->double_rate ? 5*skill_lv : sd->double_rate ) )
+ {
+ wd.div_ = skill_get_num(TF_DOUBLE,skill_lv?skill_lv:1);
+ wd.type = 0x08;
+ }
+ }
+ else if( sd->weapontype1 == W_REVOLVER && (skill_lv = pc_checkskill(sd,GS_CHAINACTION)) > 0 && rand()%100 < 5*skill_lv )
+ {
+ wd.div_ = skill_get_num(GS_CHAINACTION,skill_lv);
+ wd.type = 0x08;
+ }
+ }
+
//Check for critical
- if(!flag.cri && sstatus->cri &&
+ if( !flag.cri && !(wd.type&0x08) && sstatus->cri &&
(!skill_num ||
skill_num == KN_AUTOCOUNTER ||
skill_num == SN_SHARPSHOOTING || skill_num == MA_SHARPSHOOTING ||
@@ -2089,29 +2107,6 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
return wd;
}
- if(sd && !skill_num && !flag.cri)
- { //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]
- if (rand()%100 < (5*skill_lv>sd->double_rate?5*skill_lv:sd->double_rate))
- {
- wd.div_=skill_get_num(TF_DOUBLE,skill_lv?skill_lv:1);
- damage_div_fix(wd.damage, wd.div_);
- wd.type = 0x08;
- }
- } else
- if (sd->weapontype1 == W_REVOLVER &&
- (skill_lv = pc_checkskill(sd,GS_CHAINACTION)) > 0 &&
- (rand()%100 < 5*skill_lv)
- )
- {
- wd.div_=skill_get_num(GS_CHAINACTION,skill_lv);
- damage_div_fix(wd.damage, wd.div_);
- wd.type = 0x08;
- }
- }
-
if (sd)
{
if (!flag.rh && flag.lh)