summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authormalufett <malufett.eat.my.binaries@gmail.com>2015-02-13 21:07:26 +0800
committermalufett <malufett.eat.my.binaries@gmail.com>2015-02-13 21:07:26 +0800
commit21b72c42cbcf05377a4e72087db3fd0fb9a1d651 (patch)
treefe7fa1528e7403ee3d4490097c974af50dae5940 /src/map/battle.c
parent00ca143b9f76620b7f68559bbdb4458e6936b639 (diff)
downloadhercules-21b72c42cbcf05377a4e72087db3fd0fb9a1d651.tar.gz
hercules-21b72c42cbcf05377a4e72087db3fd0fb9a1d651.tar.bz2
hercules-21b72c42cbcf05377a4e72087db3fd0fb9a1d651.tar.xz
hercules-21b72c42cbcf05377a4e72087db3fd0fb9a1d651.zip
Fixed Bug#8529
-http://hercules.ws/board/tracker/issue-8529-npc-earthquake-damage-calculation-bugged-and-possibly-wrong/?gopid=24559#entry24559 Signed-off-by: malufett <malufett.eat.my.binaries@gmail.com>
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 37e13a83f..c88e08495 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -1528,9 +1528,6 @@ int battle_calc_skillratio(int attack_type, struct block_list *src, struct block
case NPC_ENERGYDRAIN:
skillratio += 100 * skill_lv;
break;
- case NPC_EARTHQUAKE:
- skillratio += 100 + 100 * skill_lv + 100 * (skill_lv/2);
- break;
#ifdef RENEWAL
case WZ_HEAVENDRIVE:
case WZ_METEOR:
@@ -1894,6 +1891,9 @@ int battle_calc_skillratio(int attack_type, struct block_list *src, struct block
case NPC_PULSESTRIKE:
skillratio += 100 * (skill_lv-1);
break;
+ case NPC_EARTHQUAKE:
+ skillratio += 100 + 100 * skill_lv + 100 * (skill_lv / 2);
+ break;
case RG_BACKSTAP:
if( sd && sd->status.weapon == W_BOW && battle_config.backstab_bow_penalty )
skillratio += (200 + 40 * skill_lv) / 2;
@@ -3601,15 +3601,6 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
ad.damage = battle->calc_defense(BF_MAGIC, src, target, skill_id, skill_lv, ad.damage, flag.imdef, 0);
- if (skill_id == NPC_EARTHQUAKE) {
- //Adds atk2 to the damage, should be influenced by number of hits and skill-ratio, but not mdef reductions. [Skotlex]
- //Also divide the extra bonuses from atk2 based on the number in range [Kevin]
- if(mflag>0)
- ad.damage+= (sstatus->rhw.atk2*skillratio/100)/mflag;
- else
- ShowError("Zero range by %d:%s, divide per 0 avoided!\n", skill_id, skill->get_name(skill_id));
- }
-
if(ad.damage<1)
ad.damage=1;
else if(sc){//only applies when hit
@@ -4526,6 +4517,12 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
case NPC_UNDEADATTACK:
case NPC_TELEKINESISATTACK:
case NPC_BLEEDING:
+ case NPC_EARTHQUAKE:
+ case NPC_FIREBREATH:
+ case NPC_ICEBREATH:
+ case NPC_THUNDERBREATH:
+ case NPC_ACIDBREATH:
+ case NPC_DARKNESSBREATH:
hitrate += hitrate * 20 / 100;
break;
case KN_PIERCE:
@@ -5068,6 +5065,16 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
//Div fix.
damage_div_fix(wd.damage, wd.div_);
#endif
+#if 0 // Can't find any source about this one even in eagis
+ if (skill_id == NPC_EARTHQUAKE) {
+ //Adds atk2 to the damage, should be influenced by number of hits and skill-ratio, but not mdef reductions. [Skotlex]
+ //Also divide the extra bonuses from atk2 based on the number in range [Kevin]
+ if ( wflag>0 )
+ ATK_ADD((sstatus->rhw.atk2*skillratio / 100) / wflag);
+ else
+ ShowError("Zero range by %d:%s, divide per 0 avoided!\n", skill_id, skill->get_name(skill_id));
+ }
+#endif
//Post skill/vit reduction damage increases
if (sc) {
//SC skill damages