diff options
author | Shauren <none@none> | 2010-10-25 11:23:29 +0200 |
---|---|---|
committer | Shauren <none@none> | 2010-10-25 11:23:29 +0200 |
commit | 4acf6012a89de027e3b50ec6116defc97d1e917e (patch) | |
tree | 62afef39d7c048ad4c7facf4ed831616d7c073ce | |
parent | b96a206dc350c1fdac0fdef1c11fea5907e3f509 (diff) |
Scripts/Pit of Saron: Added script for Overlord's Brand aura
--HG--
branch : trunk
-rw-r--r-- | sql/base/world_database.sql | 2 | ||||
-rw-r--r-- | sql/updates/10300_world_spell_script_names.sql | 3 | ||||
-rw-r--r-- | src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp | 79 |
3 files changed, 82 insertions, 2 deletions
diff --git a/sql/base/world_database.sql b/sql/base/world_database.sql index 263608e894d..641911a4e7b 100644 --- a/sql/base/world_database.sql +++ b/sql/base/world_database.sql @@ -26793,6 +26793,8 @@ INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES ( 68861, 'spell_bronjahm_consume_soul'), ( 69008, 'spell_bronjahm_soulstorm_channel'), ( 68870, 'spell_bronjahm_soulstorm_visual'), +-- Pit of Saron +( 69172, 'spell_tyrannus_overlord_brand'), -- Icecrown Citadel ( 69057, 'spell_marrowgar_bone_spike_graveyard'), ( 69140, 'spell_marrowgar_coldflame'), diff --git a/sql/updates/10300_world_spell_script_names.sql b/sql/updates/10300_world_spell_script_names.sql new file mode 100644 index 00000000000..2e3850ba135 --- /dev/null +++ b/sql/updates/10300_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `spell_id`=69172 AND `ScriptName`='spell_tyrannus_overlord_brand'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(69172,'spell_tyrannus_overlord_brand'); diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp index beaeb180618..0324e4a28e2 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp @@ -19,8 +19,7 @@ #include "pit_of_saron.h" /* - * SDComment: TODO: - * - implement aura for spell Overlord Brand. + * TODO: * - Intro/Outro * - improve script of Rimefang */ @@ -56,6 +55,8 @@ enum Spells SPELL_FORCEFUL_SMASH = 69155, H_SPELL_FORCEFUL_SMASH = 69627, SPELL_OVERLORDS_BRAND = 69172, + SPELL_OVERLORD_BRAND_DAMAGE = 69189, + SPELL_OVERLORD_BRAND_HEAL = 69190, SPELL_DARK_MIGHT = 69167, H_SPELL_DARK_MIGHT = 69629, SPELL_HOARFROST = 69246, @@ -273,10 +274,84 @@ public: }; +class player_overlord_brandAI : public PlayerAI +{ + public: + player_overlord_brandAI(Player* pPlayer) : PlayerAI(pPlayer) + { + tyrannus = NULL; + } + + void SetGUID(const uint64& guid, int32 /*type*/) + { + tyrannus = ObjectAccessor::GetCreature(*me, guid); + if (!tyrannus) + me->IsAIEnabled = false; + } + + void DamageDealt(Unit* /*victim*/, uint32& damage, DamageEffectType /*damageType*/) + { + me->CastCustomSpell(SPELL_OVERLORD_BRAND_DAMAGE, SPELLVALUE_BASE_POINT0, damage, tyrannus->getVictim(), true, NULL, NULL, tyrannus->GetGUID()); + } + + void HealDone(Unit* /*target*/, uint32& addHealth) + { + me->CastCustomSpell(SPELL_OVERLORD_BRAND_HEAL, SPELLVALUE_BASE_POINT0, int32(addHealth*5.5f), tyrannus, true, NULL, NULL, tyrannus->GetGUID()); + } + + void UpdateAI(const uint32 diff) { } + + private: + Creature* tyrannus; +}; + +class spell_tyrannus_overlord_brand : public SpellScriptLoader +{ + public: + spell_tyrannus_overlord_brand() : SpellScriptLoader("spell_tyrannus_overlord_brand") { } + + class spell_tyrannus_overlord_brand_AuraScript : public AuraScript + { + PrepareAuraScript(spell_tyrannus_overlord_brand_AuraScript); + + void OnApply(AuraEffect const* /*aurEff*/, AuraApplication const* aurApp, AuraEffectHandleModes /*mode*/) + { + if (aurApp->GetTarget()->GetTypeId() != TYPEID_PLAYER) + return; + + oldAI = aurApp->GetTarget()->GetAI(); + aurApp->GetTarget()->SetAI(new player_overlord_brandAI(aurApp->GetTarget()->ToPlayer())); + aurApp->GetTarget()->GetAI()->SetGUID(GetCasterGUID()); + oldAIState = aurApp->GetTarget()->IsAIEnabled; + aurApp->GetTarget()->IsAIEnabled = true; + } + + void OnRemove(AuraEffect const* /*aurEff*/, AuraApplication const* aurApp, AuraEffectHandleModes /*mode*/) + { + delete aurApp->GetTarget()->GetAI(); + aurApp->GetTarget()->SetAI(oldAI); + aurApp->GetTarget()->IsAIEnabled = oldAIState; + } + + void Register() + { + OnEffectApply += AuraEffectApplyFn(spell_tyrannus_overlord_brand_AuraScript::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + OnEffectRemove += AuraEffectRemoveFn(spell_tyrannus_overlord_brand_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } + UnitAI* oldAI; + bool oldAIState; + }; + + AuraScript* GetAuraScript() const + { + return new spell_tyrannus_overlord_brand_AuraScript(); + } +}; void AddSC_boss_tyrannus() { new boss_tyrannus(); new boss_rimefang(); + new spell_tyrannus_overlord_brand(); } |