Merge branch 'master' into Playerbot

This commit is contained in:
Yunfan Li
2023-08-05 19:11:41 +08:00
13 changed files with 120 additions and 41 deletions

View File

@@ -180,7 +180,7 @@ void BattlegroundMgr::Update(uint32 diff)
if (GameTime::GetGameTime() > m_NextAutoDistributionTime)
{
sArenaTeamMgr->DistributeArenaPoints();
m_NextAutoDistributionTime = m_NextAutoDistributionTime + 1_days * sWorld->getIntConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS);
m_NextAutoDistributionTime = GameTime::GetGameTime() + Seconds(DAY * sWorld->getIntConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS));
sWorld->setWorldState(WS_ARENA_DISTRIBUTION_TIME, m_NextAutoDistributionTime.count());
}
m_AutoDistributionTimeChecker = 600000; // 10 minutes check

View File

@@ -1091,7 +1091,17 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
PetLevelInfo const* pInfo = sObjectMgr->GetPetLevelInfo(creature_ID, petlevel);
if (pInfo) // exist in DB
{
SetCreateHealth(pInfo->health);
// Default scale value of 1 to use if Pet.RankMod.Health = 0
float factorHealth = 1;
// If config is set to allow pets to use health modifiers, apply it to creatures with a DB entry
// Pet.RankMod.Health = 1 use the factor value based on the rank of the pet, most pets have a rank of 0 and so use
// the Elite rank which is set as the default in Creature::_GetHealthMod(int32 Rank)
if (sWorld->getBoolConfig(CONFIG_ALLOWS_RANK_MOD_FOR_PET_HEALTH))
{
factorHealth *= _GetHealthMod(cinfo->rank);
}
SetCreateHealth(pInfo->health*factorHealth);
SetModifierValue(UNIT_MOD_HEALTH, BASE_VALUE, (float)pInfo->health);
if (petType != HUNTER_PET) //hunter pet use focus
{

View File

@@ -2187,7 +2187,7 @@ bool Aura::CanStackWith(Aura const* existingAura, bool remove) const
}
// spell of same spell rank chain
if (m_spellInfo->IsRankOf(existingSpellInfo))
if (m_spellInfo->IsRankOf(existingSpellInfo) && !(m_spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER && m_spellInfo->SpellFamilyFlags[1] & 0x80000000))
{
// don't allow passive area auras to stack
if (m_spellInfo->IsMultiSlotAura() && !IsArea())