Skip to content

Instantly share code, notes, and snippets.

@tje3d
Created January 19, 2018 00:11
Show Gist options
  • Save tje3d/34ad265a103506f5e51b0d317f622976 to your computer and use it in GitHub Desktop.
Save tje3d/34ad265a103506f5e51b0d317f622976 to your computer and use it in GitHub Desktop.
Gonna Go When the Volcano Blows
From 8447235c40786024f802f9a592caa89ecdca13c4 Mon Sep 17 00:00:00 2001
From: Moein <tje3d@yahoo.com>
Date: Fri, 19 Jan 2018 03:38:56 +0330
Subject: [PATCH] Achievement Gonna Go When the Volcano Blows
---
sql/custom/world/gonna_go_when_volcano_blows.sql | 4 ++
.../ObsidianSanctum/boss_sartharion.cpp | 83 +++++++++++++++++++++-
2 files changed, 85 insertions(+), 2 deletions(-)
create mode 100644 sql/custom/world/gonna_go_when_volcano_blows.sql
diff --git a/sql/custom/world/gonna_go_when_volcano_blows.sql b/sql/custom/world/gonna_go_when_volcano_blows.sql
new file mode 100644
index 0000000000..7cd1414eb8
--- /dev/null
+++ b/sql/custom/world/gonna_go_when_volcano_blows.sql
@@ -0,0 +1,4 @@
+-- Flame Strike Spell to calculate Gonna Go When the Volcano Blows Achievement
+DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_sartharion_lava_damage';
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+ (57591, 'spell_sartharion_lava_damage');
\ No newline at end of file
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp
index 300d0dd1f6..1095213777 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp
@@ -24,6 +24,7 @@
#include "obsidian_sanctum.h"
#include "ScriptedCreature.h"
#include "TemporarySummon.h"
+#include "AchievementMgr.h"
enum Enums
{
@@ -46,6 +47,7 @@ enum Enums
SPELL_TAIL_LASH = 56910, // A sweeping tail strike hits all enemies behind the caster, inflicting 3063 to 3937 damage and stunning them for 2 sec.
SPELL_WILL_OF_SARTHARION = 61254, // Sartharion's presence bolsters the resolve of the Twilight Drakes, increasing their total health by 25%. This effect also increases Sartharion's health by 25%.
SPELL_LAVA_STRIKE = 57571, // (Real spell cast should be 57578) 57571 then trigger visual missile, then summon Lava Blaze on impact(spell 57572)
+ SPELL_LAVA_STRIKE_DAMAGE = 57591,
SPELL_TWILIGHT_REVENGE = 60639,
NPC_FIRE_CYCLONE = 30648,
@@ -70,7 +72,11 @@ enum Enums
//using these custom points for dragons start and end
POINT_ID_INIT = 100,
- POINT_ID_LAND = 200
+ POINT_ID_LAND = 200,
+
+ // Achievements
+ ACHIEVEMENT_GONNA_GO_WHEN_THE_VOLCANO_BLOWS_10MAN = 2047,
+ ACHIEVEMENT_GONNA_GO_WHEN_THE_VOLCANO_BLOWS_25MAN = 2048,
};
enum Misc
@@ -78,6 +84,11 @@ enum Misc
DATA_CAN_LOOT = 0
};
+enum Actions
+{
+ ACTION_OBSIDIAN_PLAYER_HIT_BY_FLAME_STRIKE = 1
+};
+
Position const FlameRight1Spawn = { 3200.00f, 573.211f, 57.1551f, 0.0f };
Position const FlameRight1Direction = { 3289.28f, 573.211f, 57.1551f, 0.0f };
Position const FlameRight2Spawn = { 3200.00f, 532.211f, 57.1551f, 0.0f };
@@ -142,6 +153,7 @@ public:
_isBerserk = false;
_isSoftEnraged = false;
_isHardEnraged = false;
+ _flameStrikeHited = false;
drakeCount = 0;
}
@@ -181,7 +193,7 @@ public:
events.ScheduleEvent(EVENT_CALL_VESPERON, 120000);
}
- void JustDied(Unit* /*killer*/) override
+ void JustDied(Unit* killer) override
{
Talk(SAY_SARTHARION_DEATH);
_JustDied();
@@ -197,6 +209,20 @@ public:
if (Creature* vesperon = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_VESPERON)))
if (vesperon->IsAlive())
vesperon->DisappearAndDie();
+
+ // Achievement Flame Strike - Gonna Go When the Volcano Blows
+ if (!_flameStrikeHited) {
+ Map::PlayerList const& PlayerList = killer->GetMap()->GetPlayers();
+
+ AchievementEntry const* achievementEntry = sAchievementMgr->GetAchievement(Is25ManRaid() ? ACHIEVEMENT_GONNA_GO_WHEN_THE_VOLCANO_BLOWS_25MAN : ACHIEVEMENT_GONNA_GO_WHEN_THE_VOLCANO_BLOWS_10MAN);
+ if (!achievementEntry)
+ return;
+
+ if (!PlayerList.isEmpty())
+ for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
+ if (Player* player = i->GetSource())
+ player->CompletedAchievement(achievementEntry);
+ }
}
void KilledUnit(Unit* who) override
@@ -505,11 +531,24 @@ public:
DoMeleeAttackIfReady();
}
+ void DoAction(int32 action) override
+ {
+ switch (action)
+ {
+ case ACTION_OBSIDIAN_PLAYER_HIT_BY_FLAME_STRIKE:
+ _flameStrikeHited = true;
+ break;
+ default:
+ break;
+ }
+ }
+
private:
bool _isBerserk;
bool _isSoftEnraged;
bool _isHardEnraged;
uint8 drakeCount;
+ bool _flameStrikeHited;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -518,7 +557,47 @@ public:
}
};
+// 57591 - Spell Lava Strike Damage
+class spell_sartharion_lava_damage : public SpellScriptLoader
+{
+public:
+ spell_sartharion_lava_damage() : SpellScriptLoader("spell_sartharion_lava_damage") { }
+
+ class spell_sartharion_lava_damage_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_sartharion_lava_damage_SpellScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_LAVA_STRIKE_DAMAGE });
+ }
+
+ void HandleDummy()
+ {
+ if (!GetHitPlayer())
+ return;
+
+ Player* player = GetHitPlayer();
+
+ if (player->GetInstanceScript())
+ if (Creature* sartharion = ObjectAccessor::GetCreature(*player, player->GetInstanceScript()->GetGuidData(DATA_SARTHARION)))
+ sartharion->AI()->DoAction(ACTION_OBSIDIAN_PLAYER_HIT_BY_FLAME_STRIKE);
+ }
+
+ void Register() override
+ {
+ OnHit += SpellHitFn(spell_sartharion_lava_damage_SpellScript::HandleDummy);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_sartharion_lava_damage_SpellScript();
+ }
+};
+
void AddSC_boss_sartharion()
{
new boss_sartharion();
+ new spell_sartharion_lava_damage();
}
--
2.14.3 (Apple Git-98)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment