aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Spells/spell_quest.cpp85
1 files changed, 85 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp
index ca94f871d03..46a39828afd 100644
--- a/src/server/scripts/Spells/spell_quest.cpp
+++ b/src/server/scripts/Spells/spell_quest.cpp
@@ -1876,6 +1876,90 @@ class spell_q13086_cannons_target : public SpellScriptLoader
}
};
+enum BurstAtTheSeams
+{
+ BURST_AT_THE_SEAMS = 52510, //Burst at the Seams
+ BURST_AT_THE_SEAMS_DMG = 52508, //Damage spell
+ BURST_AT_THE_SEAMS_DMG_2 = 59580, //Abomination self damage spell
+ BURST_AT_THE_SEAMS_BONE = 52516, //Burst at the Seams:Bone
+ BURST_AT_THE_SEAMS_MEAT = 52520, //Explode Abomination:Meat
+ BURST_AT_THE_SEAMS_BMEAT = 52523, //Explode Abomination:Bloody Meat
+ DRAKKARI_SKULLCRUSHER_CREDIT = 52590, //Credit for Drakkari Skullcrusher
+ SUMMON_DRAKKARI_CHIEFTAIN = 52616, //Summon Drakkari Chieftain
+ DRAKKARI_CHIEFTAINK_KILL_CREDIT = 52620, //Drakkari Chieftain Kill Credit
+};
+
+class spell_q12690_burst_at_the_seams : public SpellScriptLoader
+{
+
+ public:
+ spell_q12690_burst_at_the_seams() : SpellScriptLoader("spell_q12690_burst_at_the_seams") { }
+ class spell_q12690_burst_at_the_seams_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_q12690_burst_at_the_seams_SpellScript);
+
+ bool Validate(SpellInfo const* spellInfo) OVERRIDE
+ {
+ if (!sSpellMgr->GetSpellInfo(BURST_AT_THE_SEAMS) || !sSpellMgr->GetSpellInfo(BURST_AT_THE_SEAMS_DMG) || !sSpellMgr->GetSpellInfo(BURST_AT_THE_SEAMS_DMG_2) || !sSpellMgr->GetSpellInfo(BURST_AT_THE_SEAMS_BONE) || !sSpellMgr->GetSpellInfo(BURST_AT_THE_SEAMS_MEAT) || !sSpellMgr->GetSpellInfo(BURST_AT_THE_SEAMS_BMEAT))
+ return false;
+ return true;
+ }
+
+ bool Load() OVERRIDE
+ {
+ return GetCaster()->GetTypeId() == TYPEID_UNIT;
+ }
+
+ void HandleKnockBack(SpellEffIndex /*effIndex*/)
+ {
+ if (Unit* abomination = GetCaster())
+ {
+ if (Unit* creature = GetHitCreature())
+ {
+ if(Unit* charmer = abomination->GetCharmerOrOwner())
+ {
+ if (Player* player = charmer->ToPlayer())
+ {
+ if (player->GetQuestStatus(12690) == QUEST_STATUS_INCOMPLETE)
+ {
+ player->CastSpell(player, DRAKKARI_SKULLCRUSHER_CREDIT, true);
+ creature->CastSpell(creature,BURST_AT_THE_SEAMS_BONE);
+ creature->CastSpell(creature,BURST_AT_THE_SEAMS_MEAT);
+ creature->CastSpell(creature,BURST_AT_THE_SEAMS_BMEAT);
+ creature->CastSpell(creature,BURST_AT_THE_SEAMS_DMG);
+ creature->CastSpell(creature,BURST_AT_THE_SEAMS_DMG_2);
+ player->CastSpell(player, DRAKKARI_SKULLCRUSHER_CREDIT, true);
+ uint16 count = player->GetReqKillOrCastCurrentCount(12690 /*questid*/, 29099 /*creditid*/);
+ if (count % 20 == 0)
+ player->CastSpell(player, SUMMON_DRAKKARI_CHIEFTAIN, true);
+ }
+ }
+ }
+ }
+ }
+ }
+
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ if (Unit* abomination = GetCaster())
+ if(abomination->IsAlive())
+ abomination->ToCreature()->DespawnOrUnsummon(2*IN_MILLISECONDS);
+ }
+
+ void Register() OVERRIDE
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_q12690_burst_at_the_seams_SpellScript::HandleKnockBack, EFFECT_1, SPELL_EFFECT_KNOCK_BACK);
+ OnEffectHitTarget += SpellEffectFn(spell_q12690_burst_at_the_seams_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const OVERRIDE
+ {
+ return new spell_q12690_burst_at_the_seams_SpellScript();
+ }
+};
+
void AddSC_quest_spell_scripts()
{
new spell_q55_sacred_cleansing();
@@ -1922,4 +2006,5 @@ void AddSC_quest_spell_scripts()
new spell_q12847_summon_soul_moveto_bunny();
new spell_q13011_bear_flank_master();
new spell_q13086_cannons_target();
+ new spell_q12690_burst_at_the_seams();
}