mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-23 05:36:23 +00:00
Merge branch 'master' into Playerbot
This commit is contained in:
@@ -1847,7 +1847,10 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss)
|
||||
if (damageInfo->blocked_amount && damageInfo->TargetState != VICTIMSTATE_BLOCKS)
|
||||
victim->HandleEmoteCommand(EMOTE_ONESHOT_PARRY_SHIELD);
|
||||
|
||||
if (damageInfo->TargetState == VICTIMSTATE_PARRY)
|
||||
// Parry haste is enabled if it's not a creature or if the creature doesn't have the NO_PARRY_HASTEN flag.
|
||||
bool isParryHasteEnabled = !victim->IsCreature() ||
|
||||
!victim->ToCreature()->GetCreatureTemplate()->HasFlagsExtra(CREATURE_FLAG_EXTRA_NO_PARRY_HASTEN);
|
||||
if (damageInfo->TargetState == VICTIMSTATE_PARRY && isParryHasteEnabled)
|
||||
{
|
||||
// Get attack timers
|
||||
float offtime = float(victim->getAttackTimer(OFF_ATTACK));
|
||||
@@ -20256,13 +20259,13 @@ void Unit::OutDebugInfo() const
|
||||
class AuraMunchingQueue : public BasicEvent
|
||||
{
|
||||
public:
|
||||
AuraMunchingQueue(Unit& owner, ObjectGuid targetGUID, int32 basePoints, uint32 spellId, AuraEffect* aurEff) : _owner(owner), _targetGUID(targetGUID), _basePoints(basePoints), _spellId(spellId), _aurEff(aurEff) { }
|
||||
AuraMunchingQueue(Unit& owner, ObjectGuid targetGUID, int32 basePoints, uint32 spellId) : _owner(owner), _targetGUID(targetGUID), _basePoints(basePoints), _spellId(spellId) { }
|
||||
|
||||
bool Execute(uint64 /*eventTime*/, uint32 /*updateTime*/) override
|
||||
{
|
||||
if (_owner.IsInWorld() && _owner.FindMap())
|
||||
if (Unit* target = ObjectAccessor::GetUnit(_owner, _targetGUID))
|
||||
_owner.CastCustomSpell(_spellId, SPELLVALUE_BASE_POINT0, _basePoints, target, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_NO_PERIODIC_RESET), nullptr, _aurEff, _owner.GetGUID());
|
||||
_owner.CastCustomSpell(_spellId, SPELLVALUE_BASE_POINT0, _basePoints, target, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_NO_PERIODIC_RESET), nullptr, nullptr, _owner.GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -20272,15 +20275,13 @@ private:
|
||||
ObjectGuid _targetGUID;
|
||||
int32 _basePoints;
|
||||
uint32 _spellId;
|
||||
AuraEffect* _aurEff;
|
||||
};
|
||||
|
||||
void Unit::CastDelayedSpellWithPeriodicAmount(Unit* caster, uint32 spellId, AuraType auraType, int32 addAmount, uint8 effectIndex)
|
||||
{
|
||||
AuraEffect* aurEff = nullptr;
|
||||
for (AuraEffectList::iterator i = m_modAuras[auraType].begin(); i != m_modAuras[auraType].end(); ++i)
|
||||
{
|
||||
aurEff = *i;
|
||||
AuraEffect* aurEff = *i;
|
||||
if (aurEff->GetCasterGUID() != caster->GetGUID() || aurEff->GetId() != spellId || aurEff->GetEffIndex() != effectIndex || !aurEff->GetTotalTicks())
|
||||
continue;
|
||||
|
||||
@@ -20290,9 +20291,9 @@ void Unit::CastDelayedSpellWithPeriodicAmount(Unit* caster, uint32 spellId, Aura
|
||||
|
||||
// xinef: delay only for casting on different unit
|
||||
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, aurEff, caster->GetGUID());
|
||||
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, aurEff), caster->m_Events.CalculateQueueTime(400));
|
||||
caster->m_Events.AddEvent(new AuraMunchingQueue(*caster, GetGUID(), addAmount, spellId), caster->m_Events.CalculateQueueTime(400));
|
||||
}
|
||||
|
||||
void Unit::SendClearTarget()
|
||||
|
||||
Reference in New Issue
Block a user