feat(Core/Unit): Enable/Disable Daze config (#19454)

* daze

* bruh

* bruhx2
This commit is contained in:
avarishd
2024-07-20 21:53:00 +03:00
committed by GitHub
parent b9136e060d
commit 618f97bee6
4 changed files with 14 additions and 2 deletions

View File

@@ -4413,6 +4413,13 @@ DailyRBGArenaPoints.MinLevel = 71
MunchingBlizzlike.Enabled = 1
#
# Daze.Enabled
# Description: Enable or disable the chance for mob melee attacks to daze the victim.
# Default: 1 - (Blizzlike)
Daze.Enabled = 1
#
###################################################################################################

View File

@@ -1915,8 +1915,10 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss)
if (Probability > 40.0f)
Probability = 40.0f;
if (roll_chance_f(std::max(0.0f, Probability)))
CastSpell(victim, 1604, true);
// Daze application
if (sWorld->getBoolConfig(CONFIG_ENABLE_DAZE))
if (roll_chance_f(std::max(0.0f, Probability)))
CastSpell(victim, 1604, true);
}
if (GetTypeId() == TYPEID_PLAYER)

View File

@@ -186,6 +186,7 @@ enum WorldBoolConfigs
CONFIG_STRICT_NAMES_PROFANITY,
CONFIG_ALLOWS_RANK_MOD_FOR_PET_HEALTH,
CONFIG_MUNCHING_BLIZZLIKE,
CONFIG_ENABLE_DAZE,
BOOL_CONFIG_VALUE_COUNT
};

View File

@@ -1284,6 +1284,8 @@ void World::LoadConfigSettings(bool reload)
_bool_configs[CONFIG_MUNCHING_BLIZZLIKE] = sConfigMgr->GetOption<bool>("MunchingBlizzlike.Enabled", true);
_bool_configs[CONFIG_ENABLE_DAZE] = sConfigMgr->GetOption<bool>("Daze.Enabled", true);
_int_configs[CONFIG_DAILY_RBG_MIN_LEVEL_AP_REWARD] = sConfigMgr->GetOption<uint32>("DailyRBGArenaPoints.MinLevel", 71);
_int_configs[CONFIG_AUCTION_HOUSE_SEARCH_TIMEOUT] = sConfigMgr->GetOption<uint32>("AuctionHouse.SearchTimeout", 1000);