Skip to content

Commit

Permalink
feat(Core/Unit): Enable/Disable Daze config (azerothcore#19454)
Browse files Browse the repository at this point in the history
* daze

* bruh

* bruhx2
  • Loading branch information
avarishd authored Jul 20, 2024
1 parent b9136e0 commit 618f97b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/server/apps/worldserver/worldserver.conf.dist
Original file line number Diff line number Diff line change
Expand Up @@ -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

#
###################################################################################################

Expand Down
6 changes: 4 additions & 2 deletions src/server/game/Entities/Unit/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/server/game/World/IWorld.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand Down
2 changes: 2 additions & 0 deletions src/server/game/World/World.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 618f97b

Please sign in to comment.