summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2019-03-11 00:35:23 +0100
committerGitHub <noreply@github.com>2019-03-11 00:35:23 +0100
commitaf3bf18055ceae4b85df96f5fe66b9edc203351d (patch)
tree4ce0c3392084139e55a3aacaea7365f86b9c0697 /src
parent69831adf32d57f4a47e27e965df03b7230238e0d (diff)
parente2db93490af67bb42a5611b3cb299770ff0131d7 (diff)
downloadhercules-af3bf18055ceae4b85df96f5fe66b9edc203351d.tar.gz
hercules-af3bf18055ceae4b85df96f5fe66b9edc203351d.tar.bz2
hercules-af3bf18055ceae4b85df96f5fe66b9edc203351d.tar.xz
hercules-af3bf18055ceae4b85df96f5fe66b9edc203351d.zip
Merge pull request #2034 from EyesOfAHawk/magic_rod
Adds configuration for Magic Rod behavior (official/eAthena).
Diffstat (limited to 'src')
-rw-r--r--src/map/battle.c1
-rw-r--r--src/map/battle.h2
-rw-r--r--src/map/skill.c15
3 files changed, 12 insertions, 6 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 6fa46a7c7..1b7bf909e 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -7413,6 +7413,7 @@ static const struct battle_data {
{ "min_item_buy_price", &battle_config.min_item_buy_price, 1, 0, INT_MAX, },
{ "min_item_sell_price", &battle_config.min_item_sell_price, 0, 0, INT_MAX, },
{ "display_fake_hp_when_dead", &battle_config.display_fake_hp_when_dead, 1, 0, 1, },
+ { "magicrod_type", &battle_config.magicrod_type, 0, 0, 1, },
};
static bool battle_set_value_sub(int index, int value)
diff --git a/src/map/battle.h b/src/map/battle.h
index d2fd92450..c797e665a 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -576,6 +576,8 @@ struct Battle_Config {
int min_item_sell_price;
int display_fake_hp_when_dead;
+
+ int magicrod_type;
};
/* criteria for battle_config.idletime_critera */
diff --git a/src/map/skill.c b/src/map/skill.c
index 069db55df..633a73d67 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -2892,14 +2892,16 @@ static int skill_attack(int attack_type, struct block_list *src, struct block_li
}
#endif /* MAGIC_REFLECTION_TYPE */
}
- if(sc && sc->data[SC_MAGICROD] && src == dsrc) {
- int sp = skill->get_sp(skill_id,skill_lv);
+ if (sc && sc->data[SC_MAGICROD] && src == dsrc) {
+ int sp = skill->get_sp(skill_id, skill_lv);
dmg.damage = dmg.damage2 = 0;
dmg.dmg_lv = ATK_MISS; //This will prevent skill additional effect from taking effect. [Skotlex]
sp = sp * sc->data[SC_MAGICROD]->val2 / 100;
- if(skill_id == WZ_WATERBALL && skill_lv > 1)
- sp = sp/((skill_lv|1)*(skill_lv|1)); //Estimate SP cost of a single water-ball
+ if (skill_id == WZ_WATERBALL && skill_lv > 1)
+ sp = sp / ((skill_lv | 1) * (skill_lv | 1)); //Estimate SP cost of a single water-ball
status->heal(bl, 0, sp, STATUS_HEAL_SHOWEFFECT);
+ if (battle->bc->magicrod_type == 1)
+ clif->skill_nodamage(bl, bl, SA_MAGICROD, sc->data[SC_MAGICROD]->val1, 1); // Animation used here in eAthena [Wolfie]
}
}
@@ -7881,8 +7883,9 @@ static int skill_castend_nodamage_id(struct block_list *src, struct block_list *
}
break;
case SA_MAGICROD:
- clif->skill_nodamage(src,src,SA_MAGICROD,skill_lv,1);
- sc_start(src,bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv));
+ if (battle->bc->magicrod_type == 0)
+ clif->skill_nodamage(src, src, SA_MAGICROD, skill_lv, 1); // Animation used here in official [Wolfie]
+ sc_start(src, bl, type, 100, skill_lv, skill->get_time(skill_id, skill_lv));
break;
case SA_AUTOSPELL:
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);