diff options
author | megamage <none@none> | 2009-08-10 15:52:11 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-08-10 15:52:11 -0500 |
commit | f86d54376a440165bff703a255f95eb8ed7b1868 (patch) | |
tree | 082a73697533bf13ac03013600c53af6224b0896 /src | |
parent | 7982a75c5c759efc1f4a85853524074bf579638b (diff) |
*Fix Lightwell. By Elron
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/bindings/scripts/scripts/npc/npcs_special.cpp | 39 | ||||
-rw-r--r-- | src/game/SpellEffects.cpp | 51 |
2 files changed, 90 insertions, 0 deletions
diff --git a/src/bindings/scripts/scripts/npc/npcs_special.cpp b/src/bindings/scripts/scripts/npc/npcs_special.cpp index f6922745953..05ecab1f102 100644 --- a/src/bindings/scripts/scripts/npc/npcs_special.cpp +++ b/src/bindings/scripts/scripts/npc/npcs_special.cpp @@ -1679,6 +1679,40 @@ CreatureAI* GetAI_npc_mirror_image(Creature *_Creature) return new npc_mirror_image (_Creature); } +//TODO: 30% Attackdamage check for Lightwell +struct TRINITY_DLL_DECL npc_lightwellAI : public PassiveAI +{ + npc_lightwellAI(Creature *c) : PassiveAI(c) {} + + //uint32 desummon_timer; + + void Reset() + { + //desummon_timer = 180000; + m_creature->CastSpell(m_creature, 59907, false); // Spell for Lightwell Charges + } + + /* + void UpdateAI(const uint32 diff) + { + if(desummon_timer < diff) + { + m_creature->Kill(m_creature); + }else desummon_timer -= diff; + + if(!m_creature->HasAura(59907)) + { + m_creature->Kill(m_creature); + } + } + */ +}; + +CreatureAI* GetAI_npc_lightwellAI(Creature *_Creature) +{ + return new npc_lightwellAI (_Creature); +} + struct TRINITY_DLL_DECL npc_training_dummy : Scripted_NoMovementAI { npc_training_dummy(Creature *c) : Scripted_NoMovementAI(c) {} @@ -1813,6 +1847,11 @@ void AddSC_npcs_special() newscript->RegisterSelf(); newscript = new Script; + newscript->Name="npc_lightwell"; + newscript->GetAI = &GetAI_npc_lightwellAI; + newscript->RegisterSelf(); + + newscript = new Script; newscript->Name="npc_mirror_image"; newscript->GetAI = &GetAI_npc_mirror_image; newscript->RegisterSelf(); diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index f68488e538b..5b1179c0ed8 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -5181,6 +5181,57 @@ 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 + { + if(unitTarget && m_originalCaster) + { + Unit* owner = m_originalCaster->GetOwner(); + uint32 spell_heal; + uint32 spell_charges = 59907; + + 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; + } + + 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); + } + } + } + } + } + } + } + } } break; } |