Merge branch 'azerothcore:master' into Playerbot

This commit is contained in:
ZhengPeiRu21
2022-06-27 09:06:46 -06:00
committed by GitHub
29 changed files with 459 additions and 129 deletions

View File

@@ -2330,14 +2330,14 @@ void Unit::CalcHealAbsorb(HealInfo& healInfo)
healInfo.AbsorbHeal(absorbAmount);
}
void Unit::AttackerStateUpdate(Unit* victim, WeaponAttackType attType, bool extra)
void Unit::AttackerStateUpdate(Unit* victim, WeaponAttackType attType /*= BASE_ATTACK*/, bool extra /*= false*/, bool ignoreCasting /*= false*/)
{
if (HasUnitFlag(UNIT_FLAG_PACIFIED))
{
return;
}
if (HasUnitState(UNIT_STATE_CANNOT_AUTOATTACK) && !extra)
if (HasUnitState(UNIT_STATE_CANNOT_AUTOATTACK) && !extra && !ignoreCasting)
{
return;
}
@@ -7845,13 +7845,9 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_SHAMAN, 0x10000000, 0x0, 0x0, GetGUID()))
{
Aura* flameShock = aurEff->GetBase();
int32 maxDuration = flameShock->GetMaxDuration();
int32 newDuration = flameShock->GetDuration() + 2 * aurEff->GetAmplitude();
flameShock->SetDuration(newDuration);
// is it blizzlike to change max duration for FS?
if (newDuration > maxDuration)
flameShock->SetMaxDuration(newDuration);
int32 extraTime = 2 * aurEff->GetAmplitude();
flameShock->SetMaxDuration(flameShock->GetMaxDuration() + extraTime);
flameShock->SetDuration(flameShock->GetDuration() + extraTime);
return true;
}
@@ -17994,8 +17990,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
GetMotionMaster()->MoveIdle();
StopMoving();
if (charmer->GetTypeId() == TYPEID_PLAYER &&
charmer->getClass() == CLASS_WARLOCK)
if (charmer->GetTypeId() == TYPEID_PLAYER && charmer->getClass() == CLASS_WARLOCK && ToCreature()->GetCreatureTemplate()->type == CREATURE_TYPE_DEMON)
{
// Disable CreatureAI/SmartAI and switch to CharmAI when charmed by warlock
Creature* charmed = ToCreature();
@@ -18649,23 +18644,38 @@ void Unit::SetPhaseMask(uint32 newPhaseMask, bool update)
}
}
WorldObject::SetPhaseMask(newPhaseMask, update);
WorldObject::SetPhaseMask(newPhaseMask, false);
if (!IsInWorld())
{
return;
}
for (ControlSet::const_iterator itr = m_Controlled.begin(); itr != m_Controlled.end(); )
{
Unit* controlled = *itr;
++itr;
if (controlled->GetTypeId() == TYPEID_UNIT)
{
controlled->SetPhaseMask(newPhaseMask, true);
}
}
for (uint8 i = 0; i < MAX_SUMMON_SLOT; ++i)
{
if (m_SummonSlot[i])
{
if (Creature* summon = GetMap()->GetCreature(m_SummonSlot[i]))
{
summon->SetPhaseMask(newPhaseMask, true);
}
}
}
if (update)
{
UpdateObjectVisibility();
}
}
void Unit::UpdateObjectVisibility(bool forced, bool /*fromUpdate*/)

View File

@@ -1534,7 +1534,7 @@ public:
void TriggerAurasProcOnEvent(ProcEventInfo& eventInfo, std::list<AuraApplication*>& procAuras);
void HandleEmoteCommand(uint32 emoteId);
void AttackerStateUpdate (Unit* victim, WeaponAttackType attType = BASE_ATTACK, bool extra = false);
void AttackerStateUpdate (Unit* victim, WeaponAttackType attType = BASE_ATTACK, bool extra = false, bool ignoreCasting = false);
void CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* damageInfo, WeaponAttackType attackType = BASE_ATTACK, const bool sittingVictim = false);
void DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss);