Pre-Re Monster Stats, CSV2YAML Converter, Damage Inaccuracy Fix (#8278)

- Fixed several pre-re monster stats being 1 instead of 0
  * Issue was introduced in 05a17d8 as safety measure to prevent division by 0, but it results in wrong damage numbers
  * Players can get 0 on stats as well, so it's better to put such safety measures at the point where the division takes place
- Minimum stat for monsters is now 0 instead of 1
- Monsters that have 0 Luk after this change can no longer be cursed
- Improved csv2yaml converter to no longer lose the information whether a stat is 0 or 1
- Fixed an issue with converting Race2 in the csv2yaml converter
- Removed arbitrary "+1 MATK" bonus that was probably added due to people not figuring out why the damage was off by 1
- Fixed small damage inaccuracy issue in PVP
- Fixes #8277
This commit is contained in:
Playtester 2024-04-24 21:04:34 +02:00 committed by GitHub
parent 7c44390606
commit 2963e52fc6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 500 additions and 16 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
# This file is a part of rAthena.
# Copyright(C) 2023 rAthena Development Team
# Copyright(C) 2024 rAthena Development Team
# https://rathena.org - https://github.com/rathena
#
# This program is free software: you can redistribute it and/or modify

View File

@ -6585,7 +6585,7 @@ static void battle_calc_defense_reduction(struct Damage* wd, struct block_list *
#ifndef RENEWAL
//Damage reduction: [VIT*0.3] + RND(0, [VIT^2/150] - [VIT*0.3] - 1) + [VIT*0.5]
vit_def = ((3 * def2) / 10);
vit_def += rnd_value(0, (def2 * def2) / 150 - ((3 * def2) / 10) - 1);
vit_def += rnd_value(0, max(0, (def2 * def2) / 150 - ((3 * def2) / 10) - 1));
vit_def += (def2 / 2);
#else
vit_def = def2;
@ -7710,7 +7710,7 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
return ad;
}
//Initial Values
ad.damage = 1;
ad.damage = 0;
ad.div_ = skill_get_num(skill_id,skill_lv);
ad.amotion = (skill_get_inf(skill_id)&INF_GROUND_SKILL ? 0 : sstatus->amotion); //Amotion should be 0 for ground skills.
ad.dmotion = tstatus->dmotion;

View File

@ -4592,7 +4592,7 @@ uint64 MobDatabase::parseBodyNode(const ryml::NodeRef& node) {
if (!this->asUInt16(node, "Str", stat))
return 0;
mob->status.str = max(1, stat);
mob->status.str = max(0, stat);
}
if (this->nodeExists(node, "Agi")) {
@ -4601,7 +4601,7 @@ uint64 MobDatabase::parseBodyNode(const ryml::NodeRef& node) {
if (!this->asUInt16(node, "Agi", stat))
return 0;
mob->status.agi = max(1, stat);
mob->status.agi = max(0, stat);
}
if (this->nodeExists(node, "Vit")) {
@ -4610,7 +4610,7 @@ uint64 MobDatabase::parseBodyNode(const ryml::NodeRef& node) {
if (!this->asUInt16(node, "Vit", stat))
return 0;
mob->status.vit = max(1, stat);
mob->status.vit = max(0, stat);
}
if (this->nodeExists(node, "Int")) {
@ -4619,7 +4619,7 @@ uint64 MobDatabase::parseBodyNode(const ryml::NodeRef& node) {
if (!this->asUInt16(node, "Int", stat))
return 0;
mob->status.int_ = max(1, stat);
mob->status.int_ = max(0, stat);
}
if (this->nodeExists(node, "Dex")) {
@ -4628,7 +4628,7 @@ uint64 MobDatabase::parseBodyNode(const ryml::NodeRef& node) {
if (!this->asUInt16(node, "Dex", stat))
return 0;
mob->status.dex = max(1, stat);
mob->status.dex = max(0, stat);
}
if (this->nodeExists(node, "Luk")) {
@ -4637,7 +4637,7 @@ uint64 MobDatabase::parseBodyNode(const ryml::NodeRef& node) {
if (!this->asUInt16(node, "Luk", stat))
return 0;
mob->status.luk = max(1, stat);
mob->status.luk = max(0, stat);
}
if (this->nodeExists(node, "AttackRange")) {

View File

@ -241,6 +241,9 @@ bool Csv2YamlTool::initialize( int argc, char* argv[] ){
#define export_constant_npc(a) export_constant(a)
init_random_option_constants();
#include <map/script_constants.hpp>
// Constants that are deprecated but still needed for conversion
script_set_constant(QUOTE(RC2_GUARDIAN), RC2_GUARDIAN, false, false);
script_set_constant(QUOTE(RC2_BATTLEFIELD), RC2_BATTLEFIELD, false, false);
std::vector<std::string> root_paths = {
path_db,
@ -3367,17 +3370,17 @@ static bool mob_readdb_sub( char *fields[], size_t columns, size_t current ){
body << YAML::Key << "Defense" << YAML::Value << cap_value(std::stoi(fields[12]), DEFTYPE_MIN, DEFTYPE_MAX);
if (strtol(fields[13], nullptr, 10) > 0)
body << YAML::Key << "MagicDefense" << YAML::Value << cap_value(std::stoi(fields[13]), DEFTYPE_MIN, DEFTYPE_MAX);
if (strtol(fields[14], nullptr, 10) > 1)
if (strtol(fields[14], nullptr, 10) != 1)
body << YAML::Key << "Str" << YAML::Value << fields[14];
if (strtol(fields[15], nullptr, 10) > 1)
if (strtol(fields[15], nullptr, 10) != 1)
body << YAML::Key << "Agi" << YAML::Value << fields[15];
if (strtol(fields[16], nullptr, 10) > 1)
if (strtol(fields[16], nullptr, 10) != 1)
body << YAML::Key << "Vit" << YAML::Value << fields[16];
if (strtol(fields[17], nullptr, 10) > 1)
if (strtol(fields[17], nullptr, 10) != 1)
body << YAML::Key << "Int" << YAML::Value << fields[17];
if (strtol(fields[18], nullptr, 10) > 1)
if (strtol(fields[18], nullptr, 10) != 1)
body << YAML::Key << "Dex" << YAML::Value << fields[18];
if (strtol(fields[19], nullptr, 10) > 1)
if (strtol(fields[19], nullptr, 10) != 1)
body << YAML::Key << "Luk" << YAML::Value << fields[19];
if (strtol(fields[9], nullptr, 10) > 0)
body << YAML::Key << "AttackRange" << YAML::Value << fields[9];