Scripts/Ulduar: Fixed achievement Getting Back to Nature in Freya's encounter

This commit is contained in:
Lopin
2011-06-22 21:54:32 +02:00
parent 2b3ee302f7
commit 279bd87835
3 changed files with 35 additions and 3 deletions

View File

@@ -221,6 +221,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
#define DATA_GETTING_BACK_TO_NATURE 2
class npc_iron_roots : public CreatureScript
{
@@ -412,8 +413,13 @@ class boss_freya : public CreatureScript
uint32 GetData(uint32 type)
{
if (type == DATA_KNOCK_ON_WOOD)
return elderCount;
switch (type)
{
case DATA_KNOCK_ON_WOOD:
return elderCount;
case DATA_GETTING_BACK_TO_NATURE:
return attunedToNature;
}
return 0;
}
@@ -1656,6 +1662,23 @@ class achievement_knock_knock_knock_on_wood : public AchievementCriteriaScript
}
};
class achievement_getting_back_to_nature : public AchievementCriteriaScript
{
public:
achievement_getting_back_to_nature() : AchievementCriteriaScript("achievement_getting_back_to_nature")
{
}
bool OnCheck(Player* /*player*/, Unit* target)
{
if (Creature* Freya = target->ToCreature())
if (Freya->AI()->GetData(DATA_GETTING_BACK_TO_NATURE) >= 25)
return true;
return false;
}
};
void AddSC_boss_freya()
{
new boss_freya();
@@ -1678,4 +1701,5 @@ void AddSC_boss_freya()
new achievement_knock_on_wood();
new achievement_knock_knock_on_wood();
new achievement_knock_knock_knock_on_wood();
new achievement_getting_back_to_nature();
}