summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-07-27 00:11:32 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-07-27 00:11:32 +0000
commit96cc4f2e7496202c8c278399124f9f85ce3a5ae5 (patch)
tree7455cde7f3b96c014e441b58662630910f49ed36 /src/map/battle.c
parent679b172c58b43307a8e25ba85bae0d83f8598926 (diff)
downloadhercules-96cc4f2e7496202c8c278399124f9f85ce3a5ae5.tar.gz
hercules-96cc4f2e7496202c8c278399124f9f85ce3a5ae5.tar.bz2
hercules-96cc4f2e7496202c8c278399124f9f85ce3a5ae5.tar.xz
hercules-96cc4f2e7496202c8c278399124f9f85ce3a5ae5.zip
Fixed bugreport:309 combos may now stack properly. moved all combo processing out of item bonuses and made it's own processing scheme, which is by far more efficient cpu-wise although it requires a little more memory, instead of checking for combo items whenever a status effect is turned on/off it only checks when equipping/un-equipping a item (and on login). Special Thanks to GreenBox, Kenpachi, Skotlex and Trojal
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16508 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 5e051f6bd..34946aec6 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -3126,34 +3126,28 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
return wd;
}
- if (sd)
- {
- if (!flag.rh && flag.lh)
- { //Move lh damage to the rh
+ if (sd) {
+ if (!flag.rh && flag.lh) { //Move lh damage to the rh
wd.damage = wd.damage2;
wd.damage2 = 0;
flag.rh=1;
flag.lh=0;
- } else if(flag.rh && flag.lh)
- { //Dual-wield
- if (wd.damage)
- {
- if( skill = pc_checkskill(sd,AS_RIGHT) )
+ } else if(flag.rh && flag.lh) { //Dual-wield
+ if (wd.damage) {
+ if( (skill = pc_checkskill(sd,AS_RIGHT)) )
wd.damage = wd.damage * (50 + (skill * 10))/100;
- else if( skill = pc_checkskill(sd,KO_RIGHT) )
+ else if( (skill = pc_checkskill(sd,KO_RIGHT)) )
wd.damage = wd.damage * (70 + (skill * 10))/100;
if(wd.damage < 1) wd.damage = 1;
}
- if (wd.damage2)
- {
- if( skill = pc_checkskill(sd,AS_LEFT) )
+ if (wd.damage2) {
+ if( (skill = pc_checkskill(sd,AS_LEFT)) )
wd.damage2 = wd.damage2 * (30 + (skill * 10))/100;
- else if( skill = pc_checkskill(sd,KO_LEFT) )
+ else if( (skill = pc_checkskill(sd,KO_LEFT)) )
wd.damage2 = wd.damage2 * (50 + (skill * 10))/100;
if(wd.damage2 < 1) wd.damage2 = 1;
}
- } else if(sd->status.weapon == W_KATAR && !skill_num)
- { //Katars (offhand damage only applies to normal attacks, tested on Aegis 10.2)
+ } else if(sd->status.weapon == W_KATAR && !skill_num) { //Katars (offhand damage only applies to normal attacks, tested on Aegis 10.2)
skill = pc_checkskill(sd,TF_DOUBLE);
wd.damage2 = wd.damage * (1 + (skill * 2))/100;