mirror of
https://github.com/mangosfour/server.git
synced 2025-12-31 04:37:04 +00:00
Fixed some additional found nullptrs
This commit is contained in:
parent
2e925eddd5
commit
2d960a4b1c
36 changed files with 303 additions and 303 deletions
|
|
@ -632,7 +632,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
|
|||
int32 triggerAmount = triggeredByAura->GetModifier()->m_amount;
|
||||
|
||||
Item* castItem = triggeredByAura->GetCastItemGuid() && GetTypeId() == TYPEID_PLAYER
|
||||
? ((Player*)this)->GetItemByGuid(triggeredByAura->GetCastItemGuid()) : nullptr;
|
||||
? ((Player*)this)->GetItemByGuid(triggeredByAura->GetCastItemGuid()) : NULL;
|
||||
|
||||
// some dummy spells have trigger spell in spell data already (from 3.0.3)
|
||||
uint32 triggered_spell_id = dummySpellEffect->EffectApplyAuraName == SPELL_AURA_DUMMY ? dummySpellEffect->EffectTriggerSpell : 0;
|
||||
|
|
@ -1321,7 +1321,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
|
|||
RemoveAurasDueToSpell(triggeredByAura->GetId());
|
||||
|
||||
// Cast finish spell (triggeredByAura already not exist!)
|
||||
CastSpell(this, 27285, true, castItem, nullptr, casterGuid);
|
||||
CastSpell(this, 27285, true, castItem, NULL, casterGuid);
|
||||
return SPELL_AURA_PROC_OK; // no hidden cooldown
|
||||
}
|
||||
|
||||
|
|
@ -1343,7 +1343,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
|
|||
RemoveAurasDueToSpell(triggeredByAura->GetId());
|
||||
|
||||
// Cast finish spell (triggeredByAura already not exist!)
|
||||
CastSpell(this, 32865, true, castItem, nullptr, casterGuid);
|
||||
CastSpell(this, 32865, true, castItem, NULL, casterGuid);
|
||||
return SPELL_AURA_PROC_OK; // no hidden cooldown
|
||||
}
|
||||
// Damage counting
|
||||
|
|
@ -1502,7 +1502,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
|
|||
// Heal amount - Self/Team
|
||||
int32 team = triggerAmount * damage / 500;
|
||||
int32 self = triggerAmount * damage / 100 - team;
|
||||
CastCustomSpell(this, 15290, &team, &self, nullptr, true, castItem, triggeredByAura);
|
||||
CastCustomSpell(this, 15290, &team, &self, NULL, true, castItem, triggeredByAura);
|
||||
return SPELL_AURA_PROC_OK; // no hidden cooldown
|
||||
}
|
||||
// Priest Tier 6 Trinket (Ashtongue Talisman of Acumen)
|
||||
|
|
@ -1601,7 +1601,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
|
|||
if (SpellEntry const* manaCastEntry = sSpellStore.LookupEntry(60889))
|
||||
{
|
||||
int32 mana_percent = manaCastEntry->CalculateSimpleValue(EFFECT_INDEX_0) * heal_percent;
|
||||
CastCustomSpell(this, manaCastEntry, &mana_percent, nullptr, nullptr, true, castItem, triggeredByAura);
|
||||
CastCustomSpell(this, manaCastEntry, &mana_percent, NULL, NULL, true, castItem, triggeredByAura);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
@ -1705,7 +1705,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
|
|||
if (!second)
|
||||
return SPELL_AURA_PROC_FAILED;
|
||||
|
||||
pVictim->CastSpell(second, procSpell, true, nullptr, triggeredByAura, GetObjectGuid());
|
||||
pVictim->CastSpell(second, procSpell, true, NULL, triggeredByAura, GetObjectGuid());
|
||||
return SPELL_AURA_PROC_OK;
|
||||
}
|
||||
// Item - Druid T10 Balance 4P Bonus
|
||||
|
|
@ -1908,7 +1908,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
|
|||
// Glyph of Mend Pet
|
||||
if (dummySpell->Id == 57870)
|
||||
{
|
||||
pVictim->CastSpell(pVictim, 57894, true, nullptr, nullptr, GetObjectGuid());
|
||||
pVictim->CastSpell(pVictim, 57894, true, NULL, NULL, GetObjectGuid());
|
||||
return SPELL_AURA_PROC_OK;
|
||||
}
|
||||
// Misdirection
|
||||
|
|
@ -1957,7 +1957,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
|
|||
return SPELL_AURA_PROC_FAILED;
|
||||
|
||||
basepoints[0] = int32(pVictim->GetMaxHealth() * triggeredByAura->GetModifier()->m_amount / 100);
|
||||
pVictim->CastCustomSpell(pVictim, 20267, &basepoints[0], nullptr, nullptr, true, nullptr, triggeredByAura);
|
||||
pVictim->CastCustomSpell(pVictim, 20267, &basepoints[0], NULL, NULL, true, NULL, triggeredByAura);
|
||||
return SPELL_AURA_PROC_OK;
|
||||
}
|
||||
// Judgement of Wisdom
|
||||
|
|
@ -1971,7 +1971,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
|
|||
{
|
||||
// 2% of maximum base mana
|
||||
basepoints[0] = int32(pVictim->GetCreateMana() * 2 / 100);
|
||||
pVictim->CastCustomSpell(pVictim, 20268, &basepoints[0], nullptr, nullptr, true, nullptr, triggeredByAura);
|
||||
pVictim->CastCustomSpell(pVictim, 20268, &basepoints[0], NULL, NULL, true, NULL, triggeredByAura);
|
||||
}
|
||||
return SPELL_AURA_PROC_OK;
|
||||
}
|
||||
|
|
@ -2073,7 +2073,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
|
|||
}
|
||||
}
|
||||
if (stacks >= 5)
|
||||
CastSpell(target, 42463, true, nullptr, triggeredByAura);
|
||||
CastSpell(target, 42463, true, NULL, triggeredByAura);
|
||||
break;
|
||||
}
|
||||
// Judgements of the Wise
|
||||
|
|
@ -2088,7 +2088,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
|
|||
triggered_spell_id = 31930;
|
||||
|
||||
// Replenishment
|
||||
CastSpell(this, 57669, true, nullptr, triggeredByAura);
|
||||
CastSpell(this, 57669, true, NULL, triggeredByAura);
|
||||
break;
|
||||
// Paladin Tier 6 Trinket (Ashtongue Talisman of Zeal)
|
||||
case 40470:
|
||||
|
|
@ -2131,7 +2131,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
|
|||
return SPELL_AURA_PROC_FAILED;
|
||||
|
||||
// find caster main aura at beacon
|
||||
Aura* dummy = nullptr;
|
||||
Aura* dummy = NULL;
|
||||
Unit::AuraList const& baa = beacon->GetAurasByType(SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
for (Unit::AuraList::const_iterator i = baa.begin(); i != baa.end(); ++i)
|
||||
{
|
||||
|
|
@ -2150,7 +2150,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
|
|||
basepoints[0] = triggeredByAura->GetModifier()->m_amount * damage / 100;
|
||||
|
||||
// cast with original caster set but beacon to beacon for apply caster mods and avoid LoS check
|
||||
beacon->CastCustomSpell(beacon, triggered_spell_id, &basepoints[0], nullptr, nullptr, true, castItem, triggeredByAura, pVictim->GetObjectGuid());
|
||||
beacon->CastCustomSpell(beacon, triggered_spell_id, &basepoints[0], NULL, NULL, true, castItem, triggeredByAura, pVictim->GetObjectGuid());
|
||||
return SPELL_AURA_PROC_OK;
|
||||
}
|
||||
// Seal of Corruption (damage calc on apply aura)
|
||||
|
|
@ -2175,7 +2175,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
|
|||
}
|
||||
}
|
||||
if (stacks >= 5)
|
||||
CastSpell(target, 53739, true, nullptr, triggeredByAura);
|
||||
CastSpell(target, 53739, true, NULL, triggeredByAura);
|
||||
break;
|
||||
}
|
||||
// Glyph of Holy Light
|
||||
|
|
@ -2386,7 +2386,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
|
|||
|
||||
// Attack Twice
|
||||
for (uint32 i = 0; i < 2; ++i)
|
||||
CastCustomSpell(pVictim, triggered_spell_id, &basepoints[0], nullptr, nullptr, true, castItem, triggeredByAura);
|
||||
CastCustomSpell(pVictim, triggered_spell_id, &basepoints[0], NULL, NULL, true, castItem, triggeredByAura);
|
||||
|
||||
return SPELL_AURA_PROC_OK;
|
||||
}
|
||||
|
|
@ -2886,9 +2886,9 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
|
|||
|
||||
if (basepoints[EFFECT_INDEX_0] || basepoints[EFFECT_INDEX_1] || basepoints[EFFECT_INDEX_2])
|
||||
CastCustomSpell(target, triggered_spell_id,
|
||||
basepoints[EFFECT_INDEX_0] ? &basepoints[EFFECT_INDEX_0] : nullptr,
|
||||
basepoints[EFFECT_INDEX_1] ? &basepoints[EFFECT_INDEX_1] : nullptr,
|
||||
basepoints[EFFECT_INDEX_2] ? &basepoints[EFFECT_INDEX_2] : nullptr,
|
||||
basepoints[EFFECT_INDEX_0] ? &basepoints[EFFECT_INDEX_0] : NULL,
|
||||
basepoints[EFFECT_INDEX_1] ? &basepoints[EFFECT_INDEX_1] : NULL,
|
||||
basepoints[EFFECT_INDEX_2] ? &basepoints[EFFECT_INDEX_2] : NULL,
|
||||
true, castItem, triggeredByAura);
|
||||
else
|
||||
CastSpell(target, triggered_spell_id, true, castItem, triggeredByAura);
|
||||
|
|
@ -2912,14 +2912,14 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d
|
|||
// Set trigger spell id, target, custom basepoints
|
||||
SpellEffectEntry const* spellEffect = auraSpellInfo->GetSpellEffect(triggeredByAura->GetEffIndex());
|
||||
uint32 trigger_spell_id = spellEffect ? spellEffect->EffectTriggerSpell : 0;
|
||||
Unit* target = nullptr;
|
||||
Unit* target = NULL;
|
||||
int32 basepoints[MAX_EFFECT_INDEX] = {0, 0, 0};
|
||||
|
||||
if (triggeredByAura->GetModifier()->m_auraname == SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE)
|
||||
basepoints[0] = triggerAmount;
|
||||
|
||||
Item* castItem = triggeredByAura->GetCastItemGuid() && GetTypeId() == TYPEID_PLAYER
|
||||
? ((Player*)this)->GetItemByGuid(triggeredByAura->GetCastItemGuid()) : nullptr;
|
||||
? ((Player*)this)->GetItemByGuid(triggeredByAura->GetCastItemGuid()) : NULL;
|
||||
|
||||
// Try handle unknown trigger spells
|
||||
// Custom requirements (not listed in procEx) Warning! damage dealing after this
|
||||
|
|
@ -3112,7 +3112,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d
|
|||
int32 basepoints2 = (int32)(damage * 0.45f);
|
||||
if (Unit* caster = triggeredByAura->GetCaster())
|
||||
// Actually this spell should be sent with SMSG_SPELL_START
|
||||
CastCustomSpell(caster, 69034, &basepoints2, nullptr, nullptr, true, nullptr, triggeredByAura, GetObjectGuid());
|
||||
CastCustomSpell(caster, 69034, &basepoints2, NULL, NULL, true, NULL, triggeredByAura, GetObjectGuid());
|
||||
|
||||
return SPELL_AURA_PROC_OK;
|
||||
}
|
||||
|
|
@ -3213,7 +3213,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d
|
|||
{
|
||||
// basepoints of trigger spell stored in dummyeffect of spellProto
|
||||
int32 basepoints2 = GetMaxPower(POWER_MANA) * (*i)->GetSpellProto()->CalculateSimpleValue(EFFECT_INDEX_2) / 100;
|
||||
CastCustomSpell(this, 18371, &basepoints2, nullptr, nullptr, true, castItem, triggeredByAura);
|
||||
CastCustomSpell(this, 18371, &basepoints2, NULL, NULL, true, castItem, triggeredByAura);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -3447,7 +3447,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d
|
|||
if (!pVictim || !pVictim->IsAlive())
|
||||
return SPELL_AURA_PROC_FAILED;
|
||||
// stacking
|
||||
CastSpell(this, 37658, true, nullptr, triggeredByAura);
|
||||
CastSpell(this, 37658, true, NULL, triggeredByAura);
|
||||
|
||||
Aura* dummy = GetDummyAura(37658);
|
||||
// release at 3 aura in stack (cont contain in basepoint of trigger aura)
|
||||
|
|
@ -3471,7 +3471,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d
|
|||
if (!pVictim || !pVictim->IsAlive())
|
||||
return SPELL_AURA_PROC_FAILED;
|
||||
// stacking
|
||||
CastSpell(this, 54842, true, nullptr, triggeredByAura);
|
||||
CastSpell(this, 54842, true, NULL, triggeredByAura);
|
||||
|
||||
// counting
|
||||
Aura* dummy = GetDummyAura(54842);
|
||||
|
|
@ -3492,7 +3492,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d
|
|||
uint32 castSpell = auraSpellInfo->Id == 67758 ? 67759 : 67713;
|
||||
|
||||
// stacking
|
||||
CastSpell(this, castSpell, true, nullptr, triggeredByAura);
|
||||
CastSpell(this, castSpell, true, NULL, triggeredByAura);
|
||||
|
||||
// counting
|
||||
Aura* dummy = GetDummyAura(castSpell);
|
||||
|
|
@ -3805,7 +3805,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d
|
|||
return SPELL_AURA_PROC_FAILED;
|
||||
|
||||
// try detect target manually if not set
|
||||
if (target == nullptr)
|
||||
if (target == NULL)
|
||||
target = !(procFlags & PROC_FLAG_SUCCESSFUL_POSITIVE_SPELL) && IsPositiveSpell(trigger_spell_id) ? this : pVictim;
|
||||
|
||||
// default case
|
||||
|
|
@ -3814,9 +3814,9 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d
|
|||
|
||||
if (basepoints[EFFECT_INDEX_0] || basepoints[EFFECT_INDEX_1] || basepoints[EFFECT_INDEX_2])
|
||||
CastCustomSpell(target, trigger_spell_id,
|
||||
basepoints[EFFECT_INDEX_0] ? &basepoints[EFFECT_INDEX_0] : nullptr,
|
||||
basepoints[EFFECT_INDEX_1] ? &basepoints[EFFECT_INDEX_1] : nullptr,
|
||||
basepoints[EFFECT_INDEX_2] ? &basepoints[EFFECT_INDEX_2] : nullptr,
|
||||
basepoints[EFFECT_INDEX_0] ? &basepoints[EFFECT_INDEX_0] : NULL,
|
||||
basepoints[EFFECT_INDEX_1] ? &basepoints[EFFECT_INDEX_1] : NULL,
|
||||
basepoints[EFFECT_INDEX_2] ? &basepoints[EFFECT_INDEX_2] : NULL,
|
||||
true, castItem, triggeredByAura);
|
||||
else
|
||||
CastSpell(target, trigger_spell_id, true, castItem, triggeredByAura);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue