aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsirikfoll <sirikfoll@hotmail.com>2016-05-27 23:37:08 +0200
committerjoschiwald <joschiwald.trinity@gmail.com>2017-01-09 21:36:03 +0100
commit04ff2e195f4dc5b231b20735066750f8f33e1a0c (patch)
treecd4eaeb4f6ecfbd2fbbdcb00c8e618bb5924947e /src
parent31e08b97227cf141445ea7b0a043a46d1eb5383f (diff)
Core/Achievement A-bomb-inable and A-bomb-ination
(cherry picked from commit e016bf8d06c8236c160ecaf63c6a4f26f7d4467b) DB: SQL rename (cherry picked from commit 71081c2576571a6e6d5a16179e6729843094a882)
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Northrend/IsleOfConquest/isle_of_conquest.cpp53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/server/scripts/Northrend/IsleOfConquest/isle_of_conquest.cpp b/src/server/scripts/Northrend/IsleOfConquest/isle_of_conquest.cpp
index fb4a368bce0..ba6f75152c8 100644
--- a/src/server/scripts/Northrend/IsleOfConquest/isle_of_conquest.cpp
+++ b/src/server/scripts/Northrend/IsleOfConquest/isle_of_conquest.cpp
@@ -259,6 +259,58 @@ class spell_ioc_launch : public SpellScriptLoader
}
};
+enum SeaforiumBombSpells
+{
+ SPELL_SEAFORIUM_BLAST = 66676,
+ SPELL_HUGE_SEAFORIUM_BLAST = 66672,
+ SPELL_A_BOMB_INABLE_CREDIT = 68366,
+ SPELL_A_BOMB_INATION_CREDIT = 68367
+};
+
+class spell_ioc_seaforium_blast_credit : public SpellScriptLoader
+{
+ public:
+ spell_ioc_seaforium_blast_credit() : SpellScriptLoader("spell_ioc_seaforium_blast_credit") { }
+
+ class spell_ioc_seaforium_blast_credit_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_ioc_seaforium_blast_credit_SpellScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_A_BOMB_INABLE_CREDIT) || !sSpellMgr->GetSpellInfo(SPELL_A_BOMB_INATION_CREDIT))
+ return false;
+ return true;
+ }
+
+ void HandleAchievementCredit(SpellEffIndex /*effIndex*/)
+ {
+ uint32 _creditSpell = 0;
+ Unit* caster = GetOriginalCaster();
+ if (!caster)
+ return;
+
+ if (GetSpellInfo()->Id == SPELL_SEAFORIUM_BLAST)
+ _creditSpell = SPELL_A_BOMB_INABLE_CREDIT;
+ else if (GetSpellInfo()->Id == SPELL_HUGE_SEAFORIUM_BLAST)
+ _creditSpell = SPELL_A_BOMB_INATION_CREDIT;
+
+ if (GetHitGObj() && GetHitGObj()->IsDestructibleBuilding())
+ caster->CastSpell(caster, _creditSpell, true);
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_ioc_seaforium_blast_credit_SpellScript::HandleAchievementCredit, EFFECT_1, SPELL_EFFECT_GAMEOBJECT_DAMAGE);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_ioc_seaforium_blast_credit_SpellScript();
+ }
+};
+
void AddSC_isle_of_conquest()
{
new npc_four_car_garage();
@@ -266,4 +318,5 @@ void AddSC_isle_of_conquest()
new spell_ioc_gunship_portal();
new spell_ioc_parachute_ic();
new spell_ioc_launch();
+ new spell_ioc_seaforium_blast_credit();
}