From e2db93490af67bb42a5611b3cb299770ff0131d7 Mon Sep 17 00:00:00 2001 From: EyesOfAHawk Date: Thu, 28 Feb 2019 03:12:36 +1300 Subject: Adds configuration for Magic Rod behavior (official/eAthena). --- conf/map/battle/skill.conf | 5 +++++ src/map/battle.c | 1 + src/map/battle.h | 2 ++ src/map/skill.c | 15 +++++++++------ 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/conf/map/battle/skill.conf b/conf/map/battle/skill.conf index 64bba68b5..da8d1906d 100644 --- a/conf/map/battle/skill.conf +++ b/conf/map/battle/skill.conf @@ -330,3 +330,8 @@ bowling_bash_area: 0 // punch a hole into SG it will for example create a "suck in" effect. // If you disable this setting, the knockback direction will be completely random (eAthena style). stormgust_knockback: true + +// Magic Rod's animation behavior (Note 1) +// 0 : (official) Magic Rod's animation occurs every time it is used. +// 1 : Magic Rod's animation would not occur unless a spell was absorbed. (old behavior) +magicrod_type: 0 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); -- cgit v1.2.3-60-g2f50