diff options
-rw-r--r-- | sql/FULL/world_spell_full.sql | 37 | ||||
-rw-r--r-- | sql/updates/4875_world_scripts.sql | 20 | ||||
-rw-r--r-- | src/bindings/scripts/scripts/npc/npcs_special.cpp | 39 | ||||
-rw-r--r-- | src/game/SpellEffects.cpp | 51 |
4 files changed, 139 insertions, 8 deletions
diff --git a/sql/FULL/world_spell_full.sql b/sql/FULL/world_spell_full.sql index 59ca0b0cbe1..53ce6b9e70f 100644 --- a/sql/FULL/world_spell_full.sql +++ b/sql/FULL/world_spell_full.sql @@ -72,14 +72,15 @@ INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comm ( 20594, 65116, 0, 'Stoneform'), ( 49039, 50397, 2, 'Lichborne - shapeshift'), ( 64382, 64380, 0, 'Shattering Throw'), -( 19574, 24395, 2, 'Beast Within'), -( 19574, 24396, 2, 'Beast Within'), -( 19574, 24397, 2, 'Beast Within'), -( 19574, 26592, 2, 'Beast Within'), -( 34471, 24395, 2, 'Beast Within'), -( 34471, 24396, 2, 'Beast Within'), -( 34471, 24397, 2, 'Beast Within'), -( 34471, 26592, 2, 'Beast Within'), +( 19574, 24395, 2, 'Bestial Wrath'), +( 19574, 24396, 2, 'Bestial Wrath'), +( 19574, 24397, 2, 'Bestial Wrath'), +( 19574, 26592, 2, 'Bestial Wrath'), +( 34471, 24395, 2, 'The Beast Within'), +( 34471, 24396, 2, 'The Beast Within'), +( 34471, 24397, 2, 'The Beast Within'), +( 34471, 26592, 2, 'The Beast Within'), +(-59907, 7, 0, 'Lightwell Charges - Suicide'), -- Creature ( 36574, 36650, 0, 'Apply Phase Slip Vulnerability'), @@ -2072,3 +2073,23 @@ INSERT INTO `spell_script_target` (`entry`, `type`, `targetEntry`) VALUES DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (54643); INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES ( 54643,-54643, 2, 'Wintergrasp Defender Teleport'); + + +-- lightwell +UPDATE `creature_template` SET `ScriptName` = 'npc_lightwell' WHERE `entry` IN (31883, 31893, 31894, 31895, 31896, 31897); + +REPLACE INTO `npc_spellclick_spells` (npc_entry, spell_id, quest_start, quest_start_active, quest_end, cast_flags, quest_status) VALUES +(31883, 60123, 0, 0, 0, 2, 0), +(31893, 60123, 0, 0, 0, 2, 0), +(31894, 60123, 0, 0, 0, 2, 0), +(31895, 60123, 0, 0, 0, 2, 0), +(31896, 60123, 0, 0, 0, 2, 0), +(31897, 60123, 0, 0, 0, 2, 0); + +REPLACE INTO `spell_bonus_data` (entry, direct_bonus, dot_bonus, ap_bonus, ap_dot_bonus, comments) VALUES +(7001, -1, 0.3333, -1, -1, 'Priest - Lightwell Renew Rank 1'), +(27873, -1, 0.3333, -1, -1, 'Priest - Lightwell Renew Rank 2'), +(27874, -1, 0.3333, -1, -1, 'Priest - Lightwell Renew Rank 3'), +(28276, -1, 0.3333, -1, -1, 'Priest - Lightwell Renew Rank 4'), +(48084, -1, 0.3333, -1, -1, 'Priest - Lightwell Renew Rank 5'), +(48085, -1, 0.3333, -1, -1, 'Priest - Lightwell Renew Rank 6'); diff --git a/sql/updates/4875_world_scripts.sql b/sql/updates/4875_world_scripts.sql new file mode 100644 index 00000000000..eeb76e82515 --- /dev/null +++ b/sql/updates/4875_world_scripts.sql @@ -0,0 +1,20 @@ +UPDATE `creature_template` SET `ScriptName` = 'npc_lightwell' WHERE `entry` IN (31883, 31893, 31894, 31895, 31896, 31897); + +REPLACE INTO `npc_spellclick_spells` (npc_entry, spell_id, quest_start, quest_start_active, quest_end, cast_flags, quest_status) VALUES +(31883, 60123, 0, 0, 0, 2, 0), +(31893, 60123, 0, 0, 0, 2, 0), +(31894, 60123, 0, 0, 0, 2, 0), +(31895, 60123, 0, 0, 0, 2, 0), +(31896, 60123, 0, 0, 0, 2, 0), +(31897, 60123, 0, 0, 0, 2, 0); + +REPLACE INTO `spell_bonus_data` (entry, direct_bonus, dot_bonus, ap_bonus, ap_dot_bonus, comments) VALUES +(7001, -1, 0.3333, -1, -1, 'Priest - Lightwell Renew Rank 1'), +(27873, -1, 0.3333, -1, -1, 'Priest - Lightwell Renew Rank 2'), +(27874, -1, 0.3333, -1, -1, 'Priest - Lightwell Renew Rank 3'), +(28276, -1, 0.3333, -1, -1, 'Priest - Lightwell Renew Rank 4'), +(48084, -1, 0.3333, -1, -1, 'Priest - Lightwell Renew Rank 5'), +(48085, -1, 0.3333, -1, -1, 'Priest - Lightwell Renew Rank 6'); + +REPLACE INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES +(-59907, 7, 0, 'Lightwell Charges - Suicide');
\ No newline at end of file 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; } |