mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-23 05:36:23 +00:00
fix(Core/Config): Added new config to make pet's health be modified b… (#14051)
This commit is contained in:
@@ -3820,6 +3820,14 @@ QuestPOI.Enabled = 1
|
||||
|
||||
ChangeFaction.MaxMoney = 0
|
||||
|
||||
#
|
||||
# Pet.RankMod.Health
|
||||
# Description: Allows pet health to be modified by rank health rates (set in config)
|
||||
# Default: 1 - Enabled
|
||||
# 0 - Disabled
|
||||
|
||||
Pet.RankMod.Health = 1
|
||||
|
||||
#
|
||||
###################################################################################################
|
||||
|
||||
|
||||
@@ -1108,6 +1108,11 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
||||
float factorHealth = owner->GetTypeId() == TYPEID_PLAYER ? std::min(1.0f, cinfo->ModHealth) : cinfo->ModHealth;
|
||||
float factorMana = owner->GetTypeId() == TYPEID_PLAYER ? std::min(1.0f, cinfo->ModMana) : cinfo->ModMana;
|
||||
|
||||
if (sWorld->getBoolConfig(CONFIG_ALLOWS_RANK_MOD_FOR_PET_HEALTH))
|
||||
{
|
||||
factorHealth *= _GetHealthMod(cinfo->rank);
|
||||
}
|
||||
|
||||
SetCreateHealth(std::max<uint32>(1, stats->BaseHealth[cinfo->expansion]*factorHealth));
|
||||
SetModifierValue(UNIT_MOD_HEALTH, BASE_VALUE, GetCreateHealth());
|
||||
SetCreateMana(stats->BaseMana * factorMana);
|
||||
|
||||
@@ -179,6 +179,7 @@ enum WorldBoolConfigs
|
||||
CONFIG_OBJECT_SPARKLES,
|
||||
CONFIG_LOW_LEVEL_REGEN_BOOST,
|
||||
CONFIG_OBJECT_QUEST_MARKERS,
|
||||
CONFIG_ALLOWS_RANK_MOD_FOR_PET_HEALTH,
|
||||
BOOL_CONFIG_VALUE_COUNT
|
||||
};
|
||||
|
||||
|
||||
@@ -1282,6 +1282,8 @@ void World::LoadConfigSettings(bool reload)
|
||||
|
||||
_int_configs[CONFIG_CHANGE_FACTION_MAX_MONEY] = sConfigMgr->GetOption<uint32>("ChangeFaction.MaxMoney", 0);
|
||||
|
||||
_bool_configs[CONFIG_ALLOWS_RANK_MOD_FOR_PET_HEALTH] = sConfigMgr->GetOption<bool>("Pet.RankMod.Health", true);
|
||||
|
||||
///- Read the "Data" directory from the config file
|
||||
std::string dataPath = sConfigMgr->GetOption<std::string>("DataDir", "./");
|
||||
if (dataPath.empty() || (dataPath.at(dataPath.length() - 1) != '/' && dataPath.at(dataPath.length() - 1) != '\\'))
|
||||
|
||||
Reference in New Issue
Block a user