Hello everyone, I have found a way to add your own classes and change what they give you without hard coding it :)
in cahracter.cpp below
if (this->weight < 0 || this->weight > 250)
{
this->weight = 250;
}
Add this:
for(int i = 0 ; i < static_cast<int>(this->world->class_config["ClassAmount"]) ; i++)
{
if (this->clas == i)
{
this->maxhp += 10 + calccon+static_cast<int>(this->world->class_config[util::to_string(i+1) + ".maxhp"]);
this->maxtp += 10 + calcintl+static_cast<int>(this->world->class_config[util::to_string(i+1) + ".maxtp"]);
this->mindam += 1 + calcstr+static_cast<int>(this->world->class_config[util::to_string(i+1) + ".mindamage"]);
this->maxdam += 2 + calcstr+static_cast<int>(this->world->class_config[util::to_string(i+1) + ".maxdamage"]);
this->accuracy += 0 + calcagi+static_cast<int>(this->world->class_config[util::to_string(i+1) + ".accuracy"]);
this->evade += 0 + calcagi+static_cast<int>(this->world->class_config[util::to_string(i+1) + ".evade"]);
this->armor += 0 + calccon+static_cast<int>(this->world->class_config[util::to_string(i+1) + ".armour"]);
this->maxsp += std::min(20 + this->level*2, 100);
}
}
go to world.cpp and add this where all the other config stuff is (there are 2 places) add this:
this->class_config.Read(this->config["ClassConfigFile"]);
then go to world.hpp and add
Config class_config;
now, open your config file and add this
## ClassFile
ClassConfigFile= ./data/class.ini
next open notepad and make a new file. save it as class.ini and put it into your data folder.
This is how you add classes:
ClassAmount = 1
1.maxhp = 1
1.maxtp = 1
1.mindamage = 1
1.maxdamage = 1
1.accuracy = 1
1.evade = 1
1.armour = 1
the "1" at the front is the class number, the one at the end is the amount to add for that class
Hope this helps :D