diff --git a/db/elemental_db.yml b/db/elemental_db.yml index 06e62d0408a..c0ac278e4d6 100644 --- a/db/elemental_db.yml +++ b/db/elemental_db.yml @@ -49,6 +49,7 @@ # AttackDelay Attack speed. (Default: 504) # AttackMotion Attack animation speed. Base AttackMotion depends on the caster AttackMotion. (Default: 1020) # DamageMotion Damage animation speed. (Default: 360) +# DamageTaken Rate at which the elemental will receive incoming damage. (Default: 100) # Mode: List of elemental skills by mode. (Optional) # : Mode name to define the skill available. Available modes are Passive, Assist, and Aggressive. # Skill Skill name. @@ -57,7 +58,7 @@ Header: Type: ELEMENTAL_DB - Version: 1 + Version: 2 Footer: Imports: diff --git a/db/import-tmpl/elemental_db.yml b/db/import-tmpl/elemental_db.yml index b9ebd6f4660..6aaed3ae292 100644 --- a/db/import-tmpl/elemental_db.yml +++ b/db/import-tmpl/elemental_db.yml @@ -32,6 +32,7 @@ # AttackDelay Attack speed. (Default: 504) # AttackMotion Attack animation speed. Base AttackMotion depends on the caster AttackMotion. (Default: 1020) # DamageMotion Damage animation speed. (Default: 360) +# DamageTaken Rate at which the elemental will receive incoming damage. (Default: 100) # Mode: List of elemental skills by mode. (Optional) # : Mode name to define the skill available. Available modes are Passive, Assist, and Aggressive. # Skill Skill name. @@ -40,4 +41,4 @@ Header: Type: ELEMENTAL_DB - Version: 1 + Version: 2 diff --git a/db/re/elemental_db.yml b/db/re/elemental_db.yml index f072c4d1908..59e79678cd1 100644 --- a/db/re/elemental_db.yml +++ b/db/re/elemental_db.yml @@ -49,6 +49,7 @@ # AttackDelay Attack speed. (Default: 504) # AttackMotion Attack animation speed. Base AttackMotion depends on the caster AttackMotion. (Default: 1020) # DamageMotion Damage animation speed. (Default: 360) +# DamageTaken Rate at which the elemental will receive incoming damage. (Default: 100) # Mode: List of elemental skills by mode. (Optional) # : Mode name to define the skill available. Available modes are Passive, Assist, and Aggressive. # Skill Skill name. @@ -57,7 +58,7 @@ Header: Type: ELEMENTAL_DB - Version: 1 + Version: 2 Body: - Id: 2114 @@ -241,6 +242,7 @@ Body: Size: Large Element: Water ElementLevel: 4 + DamageTaken: 10 Mode: Passive: Skill: EM_EL_COLD_FORCE @@ -255,6 +257,7 @@ Body: Size: Large Element: Fire ElementLevel: 4 + DamageTaken: 10 Mode: Passive: Skill: EM_EL_FLAMETECHNIC @@ -269,6 +272,7 @@ Body: Size: Large Element: Wind ElementLevel: 4 + DamageTaken: 10 Mode: Passive: Skill: EM_EL_GRACE_BREEZE @@ -283,6 +287,7 @@ Body: Size: Large Element: Earth ElementLevel: 4 + DamageTaken: 10 Mode: Passive: Skill: EM_EL_EARTH_CARE @@ -297,6 +302,7 @@ Body: Size: Large Element: Poison ElementLevel: 4 + DamageTaken: 10 Mode: Passive: Skill: EM_EL_DEEP_POISONING diff --git a/db/re/skill_db.yml b/db/re/skill_db.yml index b39c56b75df..b6529ca6b4a 100644 --- a/db/re/skill_db.yml +++ b/db/re/skill_db.yml @@ -35672,7 +35672,7 @@ Body: FixedCastTime: 1500 Requires: SpCost: 130 - ApCost: 25 + ApCost: 15 Unit: Id: Astral_Strike Range: @@ -45745,15 +45745,15 @@ Body: SpCost: 10 ApCost: - Level: 1 - Amount: 22 + Amount: 13 - Level: 2 - Amount: 19 + Amount: 11 - Level: 3 - Amount: 16 + Amount: 9 - Level: 4 - Amount: 13 + Amount: 7 - Level: 5 - Amount: 10 + Amount: 5 - Id: 6511 Name: SHC_CROSS_SLASH Description: Cross Slash @@ -45874,15 +45874,15 @@ Body: Time: 500 Cooldown: - Level: 1 - Time: 12500 - - Level: 2 Time: 10000 + - Level: 2 + Time: 8000 - Level: 3 - Time: 7500 + Time: 6000 - Level: 4 - Time: 5000 + Time: 4000 - Level: 5 - Time: 2500 + Time: 2000 FixedCastTime: 1500 Requires: SpCost: diff --git a/doc/yaml/db/elemental_db.yml b/doc/yaml/db/elemental_db.yml index 912039e6daa..e3f34f4a2f3 100644 --- a/doc/yaml/db/elemental_db.yml +++ b/doc/yaml/db/elemental_db.yml @@ -32,6 +32,7 @@ # AttackDelay Attack speed. (Default: 504) # AttackMotion Attack animation speed. Base AttackMotion depends on the caster AttackMotion. (Default: 1020) # DamageMotion Damage animation speed. (Default: 360) +# DamageTaken Rate at which the elemental will receive incoming damage. (Default: 100) # Mode: List of elemental skills by mode. (Optional) # : Mode name to define the skill available. Available modes are Passive, Assist, and Aggressive. # Skill Skill name. diff --git a/src/map/battle.cpp b/src/map/battle.cpp index 171b0523a9c..94f383eaa98 100644 --- a/src/map/battle.cpp +++ b/src/map/battle.cpp @@ -2047,7 +2047,13 @@ int64 battle_calc_damage(block_list *src,block_list *bl,struct Damage *d,int64 d if (md && md->damagetaken != 100) damage = i64max(damage * md->damagetaken / 100, 1); } - + else if (bl->type == BL_ELEM) { + s_elemental_data* ed = BL_CAST(BL_ELEM, bl); + + if (ed != nullptr && ed->db->damagetaken != 100) + damage = i64max(damage * ed->db->damagetaken / 100, 1); + } + if (tsc != nullptr && !tsc->empty()) { if (!battle_status_block_damage(src, bl, tsc, d, damage, skill_id, skill_lv)) // Statuses that reduce damage to 0. return 0; diff --git a/src/map/elemental.cpp b/src/map/elemental.cpp index dde97a7944c..22610c289a5 100644 --- a/src/map/elemental.cpp +++ b/src/map/elemental.cpp @@ -1059,6 +1059,18 @@ uint64 ElementalDatabase::parseBodyNode(const ryml::NodeRef& node) { elemental->status.dmotion = 360; } + if (this->nodeExists(node, "DamageTaken")) { + uint16 damage; + + if (!this->asUInt16Rate(node, "DamageTaken", damage, 100)) + return 0; + + elemental->damagetaken = damage; + } else { + if (!exists) + elemental->damagetaken = 100; + } + elemental->status.aspd_rate = 1000; if (this->nodeExists(node, "Mode")) { diff --git a/src/map/elemental.hpp b/src/map/elemental.hpp index b8eea635b9c..84a72d068eb 100644 --- a/src/map/elemental.hpp +++ b/src/map/elemental.hpp @@ -69,6 +69,7 @@ struct s_elemental_db { uint16 range2, range3; status_data status; view_data vd; + uint16 damagetaken; std::unordered_map> skill; /// mode, skill }; @@ -94,7 +95,7 @@ struct s_elemental_data : public block_list { class ElementalDatabase : public TypesafeYamlDatabase { public: - ElementalDatabase() : TypesafeYamlDatabase("ELEMENTAL_DB", 1) { + ElementalDatabase() : TypesafeYamlDatabase("ELEMENTAL_DB", 2, 1) { } diff --git a/src/map/skills/mage/energyconversion.cpp b/src/map/skills/mage/energyconversion.cpp index 17143846480..a479e73e139 100644 --- a/src/map/skills/mage/energyconversion.cpp +++ b/src/map/skills/mage/energyconversion.cpp @@ -21,5 +21,5 @@ void SkillEnergyConversion::castendNoDamageId(block_list *src, block_list *targe // Apply the SP gain to the caster clif_skill_nodamage(src, *target, getSkillId(), skill_lv); - status_heal(target, 0, (skill_lv * (skill_lv + 1) / 2) * 40, 1); + status_heal(target, 0, (skill_lv * (skill_lv + 1) / 2) * 80, 1); } diff --git a/src/map/skills/swordman/dragonicbreath.cpp b/src/map/skills/swordman/dragonicbreath.cpp index b1d6137a657..8b96e57a970 100644 --- a/src/map/skills/swordman/dragonicbreath.cpp +++ b/src/map/skills/swordman/dragonicbreath.cpp @@ -16,16 +16,16 @@ void SkillDragonicBreath::calculateSkillRatio(const Damage* wd, const block_list const status_change* sc = status_get_sc(src); const status_data* sstatus = status_get_status_data(*src); - skillratio += -100 + 50 + 350 * skill_lv; + skillratio += -100 + 250 + 400 * skill_lv; skillratio += 7 * sstatus->pow; if (sc && sc->getSCE(SC_DRAGONIC_AURA)) { skillratio += 3 * sstatus->pow; - skillratio += (skill_lv * (sstatus->max_hp * 25 / 100) * 7) / 100; // Skill level x 0.07 x ((MaxHP / 4) + (MaxSP / 2)) - skillratio += (skill_lv * (sstatus->max_sp * 50 / 100) * 7) / 100; + skillratio += (skill_lv * (sstatus->max_hp * 25 / 100) * 7) / 100; + skillratio += (skill_lv * sstatus->max_sp * 7) / 100; } else { - skillratio += (skill_lv * (sstatus->max_hp * 25 / 100) * 5) / 100; // Skill level x 0.05 x ((MaxHP / 4) + (MaxSP / 2)) - skillratio += (skill_lv * (sstatus->max_sp * 50 / 100) * 5) / 100; + skillratio += (skill_lv * (sstatus->max_hp * 25 / 100) * 5) / 100; + skillratio += (skill_lv * sstatus->max_sp * 5) / 100; } RE_LVL_DMOD(100); diff --git a/src/tool/csv2yaml.cpp b/src/tool/csv2yaml.cpp index 6fec952737b..be8cc9dfd8f 100644 --- a/src/tool/csv2yaml.cpp +++ b/src/tool/csv2yaml.cpp @@ -512,7 +512,7 @@ bool Csv2YamlTool::initialize( int32 argc, char* argv[] ){ } elemental_skill_txt_data(path_db_mode, path_db); - if (!process("ELEMENTAL_DB", 1, root_paths, "elemental_db", [](const std::string &path, const std::string &name_ext) -> bool { + if (!process("ELEMENTAL_DB", 2, root_paths, "elemental_db", [](const std::string &path, const std::string &name_ext) -> bool { return sv_readdb(path.c_str(), name_ext.c_str(), ',', 26, 26, -1, &read_elementaldb, false); })) { return false; diff --git a/src/tool/yamlupgrade.cpp b/src/tool/yamlupgrade.cpp index d2a5f7aaa07..3a0c316c1cc 100644 --- a/src/tool/yamlupgrade.cpp +++ b/src/tool/yamlupgrade.cpp @@ -14,6 +14,7 @@ static bool upgrade_enchantgrade_db( std::string file, const uint32 source_versi static bool upgrade_item_group_db( std::string file, const uint32 source_version ); static bool upgrade_skill_db( std::string file, const uint32 source_version ); static bool upgrade_item_packages_db( std::string file, const uint32 source_version ); +static bool upgrade_elemental_db( std::string file, const uint32 source_version ); template bool process(const std::string &type, uint32 version, const std::vector &paths, const std::string &name, Func lambda) { @@ -165,6 +166,12 @@ bool YamlUpgradeTool::initialize( int32 argc, char* argv[] ){ return false; } + if( !process( "ELEMENTAL_DB", 2, root_paths, "elemental_db", []( const std::string& path, const std::string& name_ext, uint32 source_version ) -> bool { + return upgrade_elemental_db( path + name_ext, source_version ); + } ) ){ + return false; + } + return true; } @@ -580,6 +587,19 @@ static bool upgrade_item_packages_db( std::string file, const uint32 source_vers return true; } +static bool upgrade_elemental_db( std::string file, const uint32 source_version ){ + size_t entries = 0; + + for( auto input : inNode["Body"] ){ + body << input; + entries++; + } + + ShowStatus( "Done converting/upgrading '" CL_WHITE "%zu" CL_RESET "' entries in '" CL_WHITE "%s" CL_RESET "'.\n", entries, file.c_str() ); + + return true; +} + int32 main( int32 argc, char *argv[] ){ return main_core( argc, argv ); }