aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Northrend/Ulduar/ulduar/boss_freya.cpp66
1 files changed, 66 insertions, 0 deletions
diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/boss_freya.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/boss_freya.cpp
index 0d052abd212..f65ee25811e 100644
--- a/src/server/scripts/Northrend/Ulduar/ulduar/boss_freya.cpp
+++ b/src/server/scripts/Northrend/Ulduar/ulduar/boss_freya.cpp
@@ -103,6 +103,7 @@ enum FreyaSpells
// Achievement spells
SPELL_DEFORESTATION_CREDIT = 65015,
+ SPELL_KNOCK_ON_WOOD_CREDIT = 65074,
// Wave summoning spells
SPELL_SUMMON_LASHERS = 62687,
@@ -219,6 +220,7 @@ enum FreyaEvents
#define WAVE_TIME 60000 // Normal wave is one minute
#define TIME_DIFFERENCE 10000 // If difference between waveTime and WAVE_TIME is bigger then TIME_DIFFERENCE, schedule EVENT_WAVE in 10 seconds
+#define DATA_KNOCK_ON_WOOD 1
class npc_iron_roots : public CreatureScript
{
@@ -340,6 +342,8 @@ class boss_freya : public CreatureScript
me->DeleteThreatList();
me->CombatStop(true);
me->ForcedDespawn(7500);
+ if (elderCount)
+ me->CastSpell(me, SPELL_KNOCK_ON_WOOD_CREDIT, true);
Creature* Elder[3];
for (uint8 n = 0; n < 3; ++n)
@@ -406,6 +410,14 @@ class boss_freya : public CreatureScript
events.ScheduleEvent(EVENT_SUNBEAM, urand(5000, 15000));
}
+ uint32 GetData(uint32 type)
+ {
+ if (type == DATA_KNOCK_ON_WOOD)
+ return elderCount;
+
+ return 0;
+ }
+
void UpdateAI(uint32 const diff)
{
if (!UpdateVictim())
@@ -1593,6 +1605,57 @@ class spell_freya_iron_roots : public SpellScriptLoader
}
};
+class achievement_knock_on_wood : public AchievementCriteriaScript
+{
+ public:
+ achievement_knock_on_wood() : AchievementCriteriaScript("achievement_knock_on_wood")
+ {
+ }
+
+ bool OnCheck(Player* /*player*/, Unit* target)
+ {
+ if (Creature* Freya = target->ToCreature())
+ if (Freya->AI()->GetData(DATA_KNOCK_ON_WOOD) >= 1)
+ return true;
+
+ return false;
+ }
+};
+
+class achievement_knock_knock_on_wood : public AchievementCriteriaScript
+{
+ public:
+ achievement_knock_knock_on_wood() : AchievementCriteriaScript("achievement_knock_knock_on_wood")
+ {
+ }
+
+ bool OnCheck(Player* /*player*/, Unit* target)
+ {
+ if (Creature* Freya = target->ToCreature())
+ if (Freya->AI()->GetData(DATA_KNOCK_ON_WOOD) >= 2)
+ return true;
+
+ return false;
+ }
+};
+
+class achievement_knock_knock_knock_on_wood : public AchievementCriteriaScript
+{
+ public:
+ achievement_knock_knock_knock_on_wood() : AchievementCriteriaScript("achievement_knock_knock_knock_on_wood")
+ {
+ }
+
+ bool OnCheck(Player* /*player*/, Unit* target)
+ {
+ if (Creature* Freya = target->ToCreature())
+ if (Freya->AI()->GetData(DATA_KNOCK_ON_WOOD) == 3)
+ return true;
+
+ return false;
+ }
+};
+
void AddSC_boss_freya()
{
new boss_freya();
@@ -1612,4 +1675,7 @@ void AddSC_boss_freya()
new npc_iron_roots();
new spell_freya_attuned_to_nature_dose_reduction();
new spell_freya_iron_roots();
+ new achievement_knock_on_wood();
+ new achievement_knock_knock_on_wood();
+ new achievement_knock_knock_knock_on_wood();
}