diff options
author | zephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2009-05-12 15:39:17 +0000 |
---|---|---|
committer | zephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2009-05-12 15:39:17 +0000 |
commit | 0c5e8296319a3f1396e0208fba16135ac2c7b4b0 (patch) | |
tree | ed381d5dd7d58c9bf128a08844c9180757efb712 /src/map/battle.c | |
parent | 78e1256b168a8d4403883079c8f6bb2687ae71aa (diff) | |
download | hercules-0c5e8296319a3f1396e0208fba16135ac2c7b4b0.tar.gz hercules-0c5e8296319a3f1396e0208fba16135ac2c7b4b0.tar.bz2 hercules-0c5e8296319a3f1396e0208fba16135ac2c7b4b0.tar.xz hercules-0c5e8296319a3f1396e0208fba16135ac2c7b4b0.zip |
- Fixed a bug (important on Battlegrounds if you are using then).
* A player can do more than 1 damage to a plant per hit, if he equip only one weapon on left hand and keep the right hand clean and receives Weapon Element buff, for example the post effect of Magnum Break. On battleground it means you can destroy quickly crystals and barricades.
- Also fixed the extra bonus of the leaf hand, it was using the bonus of the right hand.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13760 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/battle.c')
-rw-r--r-- | src/map/battle.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index d05f3ade5..6c009ee64 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -1894,22 +1894,26 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo if(!(nk&NK_NO_ELEFIX)) { //Elemental attribute fix - if (wd.damage > 0) + if( wd.damage > 0 ) { wd.damage=battle_attr_fix(src,target,wd.damage,s_ele,tstatus->def_ele, tstatus->ele_lv); - if(skill_num==MC_CARTREVOLUTION) //Cart Revolution applies the element fix once more with neutral element + if( skill_num == MC_CARTREVOLUTION ) //Cart Revolution applies the element fix once more with neutral element wd.damage = battle_attr_fix(src,target,wd.damage,ELE_NEUTRAL,tstatus->def_ele, tstatus->ele_lv); - if(skill_num== GS_GROUNDDRIFT) //Additional 50*lv Neutral damage. - wd.damage+= battle_attr_fix(src,target,50*skill_lv,ELE_NEUTRAL,tstatus->def_ele, tstatus->ele_lv); + if( skill_num== GS_GROUNDDRIFT ) //Additional 50*lv Neutral damage. + wd.damage += battle_attr_fix(src,target,50*skill_lv,ELE_NEUTRAL,tstatus->def_ele, tstatus->ele_lv); } - if (flag.lh && wd.damage2 > 0) + if( flag.lh && wd.damage2 > 0 ) wd.damage2 = battle_attr_fix(src,target,wd.damage2,s_ele_,tstatus->def_ele, tstatus->ele_lv); - if(sc && sc->data[SC_WATK_ELEMENT]) - { //Descriptions indicate this means adding a percent of a normal attack in another element. [Skotlex] - int damage= battle_calc_base_damage(sstatus, &sstatus->rhw, sc, tstatus->size, sd, (flag.arrow?2:0)); - damage = damage*sc->data[SC_WATK_ELEMENT]->val2/100; - damage = battle_attr_fix(src,target,damage,sc->data[SC_WATK_ELEMENT]->val1,tstatus->def_ele, tstatus->ele_lv); - ATK_ADD(damage); + if( sc && sc->data[SC_WATK_ELEMENT] ) + { // Descriptions indicate this means adding a percent of a normal attack in another element. [Skotlex] + int damage = battle_calc_base_damage(sstatus, &sstatus->rhw, sc, tstatus->size, sd, (flag.arrow?2:0)) * sc->data[SC_WATK_ELEMENT]->val2 / 100; + wd.damage += battle_attr_fix(src, target, damage, sc->data[SC_WATK_ELEMENT]->val1, tstatus->def_ele, tstatus->ele_lv); + + if( flag.lh ) + { + damage = battle_calc_base_damage(sstatus, &sstatus->lhw, sc, tstatus->size, sd, (flag.arrow?2:0)) * sc->data[SC_WATK_ELEMENT]->val2 / 100; + wd.damage2 += battle_attr_fix(src, target, damage, sc->data[SC_WATK_ELEMENT]->val1, tstatus->def_ele, tstatus->ele_lv); + } } } @@ -2060,9 +2064,9 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo if( flag.infdef ) { //Plants receive 1 damage when hit - if( flag.rh && (flag.hit || wd.damage>0) ) - wd.damage = 1; - if( flag.lh && (flag.hit || wd.damage2>0) ) + if( flag.hit || wd.damage > 0 ) + wd.damage = 1; // In some cases, right hand no need to have a weapon to increase damage + if( flag.lh && (flag.hit || wd.damage2 > 0) ) wd.damage2 = 1; if( !(battle_config.skill_min_damage&1) ) //Do not return if you are supposed to deal greater damage to plants than 1. [Skotlex] @@ -2479,7 +2483,7 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list if( skill_num == CR_GRANDCROSS || skill_num == NPC_GRANDDARKNESS ) { //Apply the physical part of the skill's damage. [Skotlex] struct Damage wd = battle_calc_weapon_attack(src,target,skill_num,skill_lv,mflag); - ad.damage = battle_attr_fix(src, target, wd.damage + ad.damage, s_ele, tstatus->def_ele, tstatus->ele_lv) * (100 + 40*skill_lv)/100;; + ad.damage = battle_attr_fix(src, target, wd.damage + ad.damage, s_ele, tstatus->def_ele, tstatus->ele_lv) * (100 + 40*skill_lv)/100; if( src == target ) { if( src->type == BL_PC ) |