fix(Core/Spells): Fix Lock and Load procs (#24795)
Co-authored-by: blinkysc <blinkysc@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
-- Lock and Load: allow periodic tick procs (Black Arrow, Explosive Trap)
|
||||||
|
-- SpellPhaseMask 6 = PROC_SPELL_PHASE_HIT | PROC_SPELL_PHASE_FINISH
|
||||||
|
UPDATE `spell_proc` SET `SpellPhaseMask` = 6 WHERE `SpellId` = -56342;
|
||||||
@@ -719,6 +719,7 @@ Spell::~Spell()
|
|||||||
void Spell::InitExplicitTargets(SpellCastTargets const& targets)
|
void Spell::InitExplicitTargets(SpellCastTargets const& targets)
|
||||||
{
|
{
|
||||||
m_targets = targets;
|
m_targets = targets;
|
||||||
|
m_originalTargetGUID = targets.GetObjectTargetGUID();
|
||||||
// this function tries to correct spell explicit targets for spell
|
// this function tries to correct spell explicit targets for spell
|
||||||
// client doesn't send explicit targets correctly sometimes - we need to fix such spells serverside
|
// client doesn't send explicit targets correctly sometimes - we need to fix such spells serverside
|
||||||
// this also makes sure that we correctly send explicit targets to client (removes redundant data)
|
// this also makes sure that we correctly send explicit targets to client (removes redundant data)
|
||||||
@@ -7855,6 +7856,11 @@ void Spell::DelayedChannel()
|
|||||||
SendChannelUpdate(m_timer);
|
SendChannelUpdate(m_timer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Unit* Spell::GetOriginalTarget() const
|
||||||
|
{
|
||||||
|
return ObjectAccessor::GetUnit(*m_caster, m_originalTargetGUID);
|
||||||
|
}
|
||||||
|
|
||||||
bool Spell::UpdatePointers()
|
bool Spell::UpdatePointers()
|
||||||
{
|
{
|
||||||
if (m_originalCasterGUID == m_caster->GetGUID())
|
if (m_originalCasterGUID == m_caster->GetGUID())
|
||||||
|
|||||||
@@ -585,6 +585,7 @@ public:
|
|||||||
|
|
||||||
Unit* GetCaster() const { return m_caster; }
|
Unit* GetCaster() const { return m_caster; }
|
||||||
Unit* GetOriginalCaster() const { return m_originalCaster; }
|
Unit* GetOriginalCaster() const { return m_originalCaster; }
|
||||||
|
Unit* GetOriginalTarget() const;
|
||||||
SpellInfo const* GetSpellInfo() const { return m_spellInfo; }
|
SpellInfo const* GetSpellInfo() const { return m_spellInfo; }
|
||||||
int32 GetPowerCost() const { return m_powerCost; }
|
int32 GetPowerCost() const { return m_powerCost; }
|
||||||
|
|
||||||
@@ -621,6 +622,8 @@ public:
|
|||||||
// e.g. damage around area spell trigered by victim aura and damage enemies of aura caster
|
// e.g. damage around area spell trigered by victim aura and damage enemies of aura caster
|
||||||
Unit* m_originalCaster; // cached pointer for m_originalCaster, updated at Spell::UpdatePointers()
|
Unit* m_originalCaster; // cached pointer for m_originalCaster, updated at Spell::UpdatePointers()
|
||||||
|
|
||||||
|
ObjectGuid m_originalTargetGUID; // unit target saved before InitExplicitTargets strips it
|
||||||
|
|
||||||
Spell** m_selfContainer; // pointer to our spell container (if applicable)
|
Spell** m_selfContainer; // pointer to our spell container (if applicable)
|
||||||
|
|
||||||
std::string GetDebugInfo() const;
|
std::string GetDebugInfo() const;
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ enum HunterSpells
|
|||||||
SPELL_HUNTER_GLYPH_OF_ARCANE_SHOT = 61389,
|
SPELL_HUNTER_GLYPH_OF_ARCANE_SHOT = 61389,
|
||||||
SPELL_LOCK_AND_LOAD_TRIGGER = 56453,
|
SPELL_LOCK_AND_LOAD_TRIGGER = 56453,
|
||||||
SPELL_LOCK_AND_LOAD_MARKER = 67544,
|
SPELL_LOCK_AND_LOAD_MARKER = 67544,
|
||||||
|
SPELL_FROST_TRAP_SLOW = 67035,
|
||||||
SPELL_HUNTER_PET_LEGGINGS_OF_BEAST_MASTERY = 38297, // Leggings of Beast Mastery
|
SPELL_HUNTER_PET_LEGGINGS_OF_BEAST_MASTERY = 38297, // Leggings of Beast Mastery
|
||||||
|
|
||||||
// Proc system spells
|
// Proc system spells
|
||||||
@@ -1177,7 +1178,8 @@ class spell_hun_lock_and_load : public AuraScript
|
|||||||
return ValidateSpellInfo(
|
return ValidateSpellInfo(
|
||||||
{
|
{
|
||||||
SPELL_LOCK_AND_LOAD_TRIGGER,
|
SPELL_LOCK_AND_LOAD_TRIGGER,
|
||||||
SPELL_LOCK_AND_LOAD_MARKER
|
SPELL_LOCK_AND_LOAD_MARKER,
|
||||||
|
SPELL_FROST_TRAP_SLOW
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1197,6 +1199,13 @@ class spell_hun_lock_and_load : public AuraScript
|
|||||||
if (!spellInfo || !(spellInfo->GetSchoolMask() & (SPELL_SCHOOL_MASK_FROST | SPELL_SCHOOL_MASK_FIRE)))
|
if (!spellInfo || !(spellInfo->GetSchoolMask() & (SPELL_SCHOOL_MASK_FROST | SPELL_SCHOOL_MASK_FIRE)))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// TODO: Research whether Lock and Load should proc on targets
|
||||||
|
// immune to Frost Trap slow (bosses) in WotLK 3.3.5a.
|
||||||
|
// if (Spell const* procSpell = eventInfo.GetProcSpell())
|
||||||
|
// if (Unit* target = procSpell->GetOriginalTarget())
|
||||||
|
// if (target->IsImmunedToSpell(sSpellMgr->GetSpellInfo(SPELL_FROST_TRAP_SLOW)))
|
||||||
|
// return false;
|
||||||
|
|
||||||
return roll_chance_i(aurEff->GetAmount());
|
return roll_chance_i(aurEff->GetAmount());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user