diff options
author | Haru <haru@dotalux.com> | 2014-08-02 20:58:22 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2014-08-02 21:04:06 +0200 |
commit | b791b665c87589548c9c57afbe0fe50ec7c32676 (patch) | |
tree | c356cb0d145e68c9ca5912a2aa0ba55fb9790a09 /src/map | |
parent | 3961c4cba6e4686d0babb59be917b971479f7780 (diff) | |
download | hercules-b791b665c87589548c9c57afbe0fe50ec7c32676.tar.gz hercules-b791b665c87589548c9c57afbe0fe50ec7c32676.tar.bz2 hercules-b791b665c87589548c9c57afbe0fe50ec7c32676.tar.xz hercules-b791b665c87589548c9c57afbe0fe50ec7c32676.zip |
Fixed several issues with SO_EL_SYMPATHY
- Corrected an issue that caused the elemental's HP and SP would
_decrease to_ summon_level*5% instead of _increasing by_ said amount.
- Corrected an issue that decreased the SP cost of summon elemental
skills by 5% even when the Spirit Sympathy skill wasn't present.
- Added/renamed some variables to prevent confusion. Please don't reuse
'i' variables for things that aren't array indices. Or don't reuse
variables altogether for different purposes than their original one.
- Special thanks to Kisuka.
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/elemental.c | 62 | ||||
-rw-r--r-- | src/map/skill.c | 6 |
2 files changed, 38 insertions, 30 deletions
diff --git a/src/map/elemental.c b/src/map/elemental.c index 7ffeea410..caba02692 100644 --- a/src/map/elemental.c +++ b/src/map/elemental.c @@ -64,7 +64,7 @@ struct view_data * elemental_get_viewdata(int class_) { int elemental_create(struct map_session_data *sd, int class_, unsigned int lifetime) { struct s_elemental ele; struct s_elemental_db *db; - int i; + int i, summon_level, skill_level; nullpo_retr(1,sd); @@ -77,63 +77,67 @@ int elemental_create(struct map_session_data *sd, int class_, unsigned int lifet ele.char_id = sd->status.char_id; ele.class_ = class_; ele.mode = EL_MODE_PASSIVE; // Initial mode - i = db->status.size+1; // summon level + summon_level = db->status.size+1; // summon level //[(Caster's Max HP/ 3 ) + (Caster's INT x 10 )+ (Caster's Job Level x 20 )] x [(Elemental Summon Level + 2) / 3] - ele.hp = ele.max_hp = (sd->battle_status.max_hp/3 + sd->battle_status.int_*10 + sd->status.job_level) * ((i + 2) / 3); + ele.hp = ele.max_hp = (sd->battle_status.max_hp/3 + sd->battle_status.int_*10 + sd->status.job_level) * ((summon_level + 2) / 3); //Caster's Max SP /4 ele.sp = ele.max_sp = sd->battle_status.max_sp/4; //Caster's [ Max SP / (18 / Elemental Summon Skill Level) 1- 100 ] - ele.atk = (sd->battle_status.max_sp / (18 / i) * 1 - 100); + ele.atk = (sd->battle_status.max_sp / (18 / summon_level) * 1 - 100); //Caster's [ Max SP / (18 / Elemental Summon Skill Level) ] ele.atk2 = sd->battle_status.max_sp / 18; //Caster's HIT + (Caster's Base Level) ele.hit = sd->battle_status.hit + sd->status.base_level; //[Elemental Summon Skill Level x (Caster's INT / 2 + Caster's DEX / 4)] - ele.matk = i * (sd->battle_status.int_ / 2 + sd->battle_status.dex / 4); + ele.matk = summon_level * (sd->battle_status.int_ / 2 + sd->battle_status.dex / 4); //150 + [Caster's DEX / 10] + [Elemental Summon Skill Level x 3 ] - ele.amotion = 150 + sd->battle_status.dex / 10 + i * 3; + ele.amotion = 150 + sd->battle_status.dex / 10 + summon_level * 3; //Caster's DEF + (Caster's Base Level / (5 - Elemental Summon Skill Level) - ele.def = sd->battle_status.def + sd->status.base_level / (5-i); + ele.def = sd->battle_status.def + sd->status.base_level / (5-summon_level); //Caster's MDEF + (Caster's INT / (5 - Elemental Summon Skill Level) - ele.mdef = sd->battle_status.mdef + sd->battle_status.int_ / (5-i); + ele.mdef = sd->battle_status.mdef + sd->battle_status.int_ / (5-summon_level); //Caster's FLEE + (Caster's Base Level / (5 - Elemental Summon Skill Level) - ele.flee = sd->status.base_level / (5-i); + ele.flee = sd->status.base_level / (5-summon_level); //Caster's HIT + (Caster's Base Level) ele.hit = sd->battle_status.hit + sd->status.base_level; //per individual bonuses switch(db->class_){ - case 2114: case 2115: + case 2114: + case 2115: case 2116: //ATK + (Summon Agni Skill Level x 20) / HIT + (Summon Agni Skill Level x 10) - ele.atk += i * 20; - ele.atk2 += i * 20; - ele.hit += i * 10; + ele.atk += summon_level * 20; + ele.atk2 += summon_level * 20; + ele.hit += summon_level * 10; break; - case 2117: case 2118: + case 2117: + case 2118: case 2119: //MDEF + (Summon Aqua Skill Level x 10) / MATK + (Summon Aqua Skill Level x 20) - ele.mdef += i * 10; - ele.matk += i * 20; + ele.mdef += summon_level * 10; + ele.matk += summon_level * 20; break; - case 2120: case 2121: + case 2120: + case 2121: case 2122: //FLEE + (Summon Ventus Skill Level x 20) / MATK + (Summon Ventus Skill Level x 10) - ele.flee += i * 20; - ele.matk += i * 10; + ele.flee += summon_level * 20; + ele.matk += summon_level * 10; break; - case 2123: case 2124: + case 2123: + case 2124: case 2125: //DEF + (Summon Tera Skill Level x 25) / ATK + (Summon Tera Skill Level x 5) - ele.def += i * 25; - ele.atk += i * 5; - ele.atk2 += i * 5; + ele.def += summon_level * 25; + ele.atk += summon_level * 5; + ele.atk2 += summon_level * 5; break; } - if( (i=pc->checkskill(sd,SO_EL_SYMPATHY)) > 0 ){ - ele.hp = ele.max_hp = ele.max_hp * 5 * i / 100; - ele.sp = ele.max_sp = ele.max_sp * 5 * i / 100; - ele.atk += 25 * i; - ele.atk2 += 25 * i; - ele.matk += 25 * i; + if ((skill_level=pc->checkskill(sd,SO_EL_SYMPATHY)) > 0) { + ele.hp = ele.max_hp += ele.max_hp * 5 * skill_level / 100; + ele.sp = ele.max_sp += ele.max_sp * 5 * skill_level / 100; + ele.atk += 25 * skill_level; + ele.atk2 += 25 * skill_level; + ele.matk += 25 * skill_level; } ele.life_time = lifetime; diff --git a/src/map/skill.c b/src/map/skill.c index c744dbde4..e16cb0cc7 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -14043,7 +14043,11 @@ struct skill_condition skill_get_requirement(struct map_session_data* sd, uint16 case SO_SUMMON_AQUA: case SO_SUMMON_VENTUS: case SO_SUMMON_TERA: - req.sp -= req.sp * (5 + 5 * pc->checkskill(sd,SO_EL_SYMPATHY)) / 100; + { + int spirit_sympathy = pc->checkskill(sd,SO_EL_SYMPATHY); + if (spirit_sympathy) + req.sp -= req.sp * (5 + 5 * spirit_sympathy) / 100; + } break; case SO_PSYCHIC_WAVE: if( sc && (sc->data[SC_HEATER_OPTION] || sc->data[SC_COOLER_OPTION] || sc->data[SC_BLAST_OPTION] || sc->data[SC_CURSED_SOIL_OPTION] )) |