Skip to content

Commit

Permalink
feat(Core/Unit): Implement munching as a configurable option. (azerot…
Browse files Browse the repository at this point in the history
…hcore#19188)

* Init.

* Correct description.

* Adjust boolean to integer in config.
  • Loading branch information
heyitsbench authored Jul 10, 2024
1 parent 793f87f commit 70eb920
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
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 @@ -4386,6 +4386,13 @@ TeleportTimeoutFar = 45

DailyRBGArenaPoints.MinLevel = 71

#
# MunchingBlizzlike.Enabled
# Description: Enable the Blizzlike implementation of munching with e.g. Warrior's Rend or Mage's Ignite
# Default: 1 - (Blizzlike)

MunchingBlizzlike.Enabled = 1

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

Expand Down
2 changes: 1 addition & 1 deletion src/server/game/Entities/Unit/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20566,7 +20566,7 @@ void Unit::CastDelayedSpellWithPeriodicAmount(Unit* caster, uint32 spellId, Aura
}

// xinef: delay only for casting on different unit
if (this == caster)
if (this == caster || !sWorld->getBoolConfig(CONFIG_MUNCHING_BLIZZLIKE))
caster->CastCustomSpell(spellId, SPELLVALUE_BASE_POINT0, addAmount, this, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_NO_PERIODIC_RESET), nullptr, nullptr, caster->GetGUID());
else
caster->m_Events.AddEvent(new AuraMunchingQueue(*caster, GetGUID(), addAmount, spellId), caster->m_Events.CalculateQueueTime(400));
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 @@ -185,6 +185,7 @@ enum WorldBoolConfigs
CONFIG_STRICT_NAMES_RESERVED,
CONFIG_STRICT_NAMES_PROFANITY,
CONFIG_ALLOWS_RANK_MOD_FOR_PET_HEALTH,
CONFIG_MUNCHING_BLIZZLIKE,
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 @@ -1282,6 +1282,8 @@ void World::LoadConfigSettings(bool reload)

_bool_configs[CONFIG_ALLOWS_RANK_MOD_FOR_PET_HEALTH] = sConfigMgr->GetOption<bool>("Pet.RankMod.Health", true);

_bool_configs[CONFIG_MUNCHING_BLIZZLIKE] = sConfigMgr->GetOption<bool>("MunchingBlizzlike.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 70eb920

Please sign in to comment.