diff options
author | QAston <none@none> | 2009-08-17 02:53:39 +0200 |
---|---|---|
committer | QAston <none@none> | 2009-08-17 02:53:39 +0200 |
commit | 41c12d173b8d0cf297edf70e40b8e13b9bf3af35 (patch) | |
tree | 483b138dcad5abd803330495cc211c3a90218173 /src/game/SpellEffects.cpp | |
parent | 6359bfb27ac42392dc3a314fc5fe194964485931 (diff) |
*Add spell_bonus_data for lightwell - by Elron
*Add aura_required, aura_forbidden, user_type columns to npc_spellclick_spells table for additional requirement checks
*Remove workarounds from lightwell code and use new npc_spellclick_spells fields instead.
--HG--
branch : trunk
Diffstat (limited to 'src/game/SpellEffects.cpp')
-rw-r--r-- | src/game/SpellEffects.cpp | 70 |
1 files changed, 24 insertions, 46 deletions
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 39eb470bc9c..fb54844430a 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -5177,56 +5177,34 @@ void Spell::EffectScriptEffect(uint32 effIndex) if(Unit *passenger = ((Vehicle*)m_caster)->GetPassenger(0)) passenger->CastSpell(m_caster->m_Vehicle, damage, true); return; - case 60123: // Lightwell Renew, TODO: 30% Attackdamage check for Lightwell + case 60123: // Lightwell { - if(unitTarget && m_originalCaster) - { - Unit* owner = m_originalCaster->GetOwner(); - uint32 spell_heal; - uint32 spell_charges = 59907; + if (m_caster->GetTypeId() != TYPEID_UNIT || !((Creature*)m_caster)->isSummon()) + return; - switch(m_originalCaster->GetEntry()) - { - case 31897: spell_heal = 7001; break; - case 31896: spell_heal = 27873; break; - case 31895: spell_heal = 27874; break; - case 31894: spell_heal = 28276; break; - case 31893: spell_heal = 48084; break; - case 31883: spell_heal = 48085; break; - } + uint32 spell_heal; - if(owner && spell_heal && spell_charges) - { - if(owner->GetTypeId() == TYPEID_PLAYER && unitTarget->GetTypeId() == TYPEID_PLAYER) - { - if(((Player*)owner)->IsInSameRaidWith(((Player*)unitTarget)) && (!((Player*)unitTarget)->duel || unitTarget == owner) && !unitTarget->HasAura(spell_heal)) - { - Aura *chargesaura = m_originalCaster->GetAura(spell_charges); - if(chargesaura) - { - if(chargesaura->GetAuraCharges() > 1) - { - chargesaura->SetAuraCharges(chargesaura->GetAuraCharges() - 1); - owner->CastSpell(unitTarget, spell_heal, true); - if(unitTarget->IsPvP() && !owner->IsPvP()) - { - owner->SetPvP(true); - } - } - else - { - m_originalCaster->RemoveAura(chargesaura); - owner->CastSpell(unitTarget, spell_heal, true); - if(unitTarget->IsPvP() && !owner->IsPvP()) - { - owner->SetPvP(true); - } - } - } - } - } - } + switch(m_caster->GetEntry()) + { + case 31897: spell_heal = 7001; break; + case 31896: spell_heal = 27873; break; + case 31895: spell_heal = 27874; break; + case 31894: spell_heal = 28276; break; + case 31893: spell_heal = 48084; break; + case 31883: spell_heal = 48085; break; + default: + sLog.outError("Unknown Lightwell spell caster %u", m_caster->GetEntry()); + return; } + Aura * chargesaura = m_caster->GetAura(59907); + + if(chargesaura && chargesaura->GetAuraCharges() > 1) + { + chargesaura->SetAuraCharges(chargesaura->GetAuraCharges() - 1); + m_caster->CastSpell(unitTarget, spell_heal, true, NULL, NULL, ((TempSummon*)m_caster)->GetSummonerGUID()); + } + else + ((TempSummon*)m_caster)->UnSummon(); } } break; |