summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-12-13 21:20:14 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-12-13 21:20:14 +0000
commit1ab6b565f48ad88c5c64a5ff2c11e9cf2a6da8e5 (patch)
treed054301b15b9fe66f9a5369cbe33568237f00a64
parent81706ea0213ee69fab8afc2a122904e49bceb7e5 (diff)
downloadhercules-1ab6b565f48ad88c5c64a5ff2c11e9cf2a6da8e5.tar.gz
hercules-1ab6b565f48ad88c5c64a5ff2c11e9cf2a6da8e5.tar.bz2
hercules-1ab6b565f48ad88c5c64a5ff2c11e9cf2a6da8e5.tar.xz
hercules-1ab6b565f48ad88c5c64a5ff2c11e9cf2a6da8e5.zip
- Additional damage bonuses (True Sight, EDP, Assassin Link, Crusader Link, Card skill damage bonuses) are now applied independently of each other, which lets them stack.
- Some minor cleanings on the code vecinity. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9492 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt3
-rw-r--r--src/map/battle.c56
2 files changed, 33 insertions, 26 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 6ce52035e..48cfa6733 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,9 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/12/13
+ * Additional damage bonuses (True Sight, EDP, Assassin Link, Crusader Link,
+ Card skill damage bonuses) are now applied independently of each other,
+ which lets them stack. [Skotlex]
* Modified flush_fifo so the code do what is written in the comment [Toms]
* Modified flush_fifo so you can decide whether to block the current thread
or not until the data is sent. The server-tick reply no longer blocks the
diff --git a/src/map/battle.c b/src/map/battle.c
index 3b355c3b2..82c59e362 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -1633,44 +1633,48 @@ static struct Damage battle_calc_weapon_attack(
}
//Div fix.
damage_div_fix(wd.damage, wd.div_);
- //Here comes a second pass for skills that stack to the previously defined % damage. [Skotlex]
- skillratio = 100;
- //Skill damage modifiers that affect linearly stacked damage.
- if (sc && skill_num != PA_SACRIFICE) {
+
+ //The following are applied on top of current damage and are stackable.
+ if (sc) {
if(sc->data[SC_TRUESIGHT].timer != -1)
- skillratio += 2*sc->data[SC_TRUESIGHT].val1;
- // It is still not quite decided whether it works on bosses or not...
- if(sc->data[SC_EDP].timer != -1 /*&& !(t_mode&MD_BOSS)*/ && skill_num != ASC_BREAKER && skill_num != ASC_METEORASSAULT)
- skillratio += sc->data[SC_EDP].val3;
+ ATK_ADDRATE(2*sc->data[SC_TRUESIGHT].val1);
+
+ if(sc->data[SC_EDP].timer != -1 &&
+ skill_num != ASC_BREAKER &&
+ skill_num != ASC_METEORASSAULT)
+ ATK_ADDRATE(sc->data[SC_EDP].val3);
}
+
switch (skill_num) {
case AS_SONICBLOW:
- if (sc && sc->data[SC_SPIRIT].timer != -1 && sc->data[SC_SPIRIT].val2 == SL_ASSASIN)
- skillratio += (map_flag_gvg(src->m))?25:100; //+25% dmg on woe/+100% dmg on nonwoe
+ if (sc && sc->data[SC_SPIRIT].timer != -1 &&
+ sc->data[SC_SPIRIT].val2 == SL_ASSASIN)
+ ATK_ADDRATE(map_flag_gvg(src->m)?25:100); //+25% dmg on woe/+100% dmg on nonwoe
+
if(sd && pc_checkskill(sd,AS_SONICACCEL)>0)
- skillratio += 10;
+ ATK_ADDRATE(10);
break;
case CR_SHIELDBOOMERANG:
- if (sc && sc->data[SC_SPIRIT].timer != -1 && sc->data[SC_SPIRIT].val2 == SL_CRUSADER)
- skillratio += 100;
+ if(sc && sc->data[SC_SPIRIT].timer != -1 &&
+ sc->data[SC_SPIRIT].val2 == SL_CRUSADER)
+ ATK_ADDRATE(100);
break;
}
- if (sd && sd->skillatk[0].id != 0)
- {
- for (i = 0; i < MAX_PC_BONUS && sd->skillatk[i].id != 0 && sd->skillatk[i].id != skill_num; i++);
- if (i < MAX_PC_BONUS && sd->skillatk[i].id == skill_num)
- //May seem wrong as it also applies on top of other modifiers, but adding, say, 10%
- //to 800% dmg -> 810% would make the bonus a little lame. [Skotlex]
- skillratio += sd->skillatk[i].val;
- }
- if (skillratio != 100)
- ATK_RATE(skillratio);
if(sd)
{
- if (skill_num != PA_SACRIFICE && skill_num != MO_INVESTIGATE
- && skill_num != CR_GRANDCROSS && skill_num != NPC_GRANDDARKNESS
- && skill_num != PA_SHIELDCHAIN
+ if (skill_num && sd->skillatk[0].id)
+ { //Additional skill damage.
+ for (i = 0; i < MAX_PC_BONUS && sd->skillatk[i].id &&
+ sd->skillatk[i].id != skill_num; i++);
+
+ if (i < MAX_PC_BONUS && sd->skillatk[i].id == skill_num)
+ ATK_ADDRATE(sd->skillatk[i].val);
+ }
+
+ if(skill_num != PA_SACRIFICE && skill_num != MO_INVESTIGATE &&
+ skill_num != CR_GRANDCROSS && skill_num != NPC_GRANDDARKNESS &&
+ skill_num != PA_SHIELDCHAIN
&& !flag.cri)
{ //Elemental/Racial adjustments
if(sd->right_weapon.def_ratio_atk_ele & (1<<tstatus->def_ele) ||