Scripts/Gundrak: Properly fixed achievement Less Rabi

This commit is contained in:
Lopin
2011-06-24 14:40:23 +02:00
parent 7954d9a099
commit 9582f596e2
2 changed files with 34 additions and 10 deletions
@@ -31,11 +31,6 @@ enum eSpells
SPELL_TRANSFORMATION = 55098, //Periodic, The caster transforms into a powerful mammoth, increasing Physical damage done by 25% and granting immunity to Stun effects.
};
enum eArchivements
{
ACHIEV_LESS_RABI = 2040
};
enum eSays
{
SAY_AGGRO = -1604010,
@@ -48,6 +43,8 @@ enum eSays
EMOTE_TRANSFORM = -1604017
};
#define DATA_LESS_RABI 1
class boss_moorabi : public CreatureScript
{
public:
@@ -146,17 +143,20 @@ public:
DoMeleeAttackIfReady();
}
uint32 GetData(uint32 type)
{
if (type == DATA_LESS_RABI)
return bPhase ? 0 : 1;
return 0;
}
void JustDied(Unit* /*pKiller*/)
{
DoScriptText(SAY_DEATH, me);
if (pInstance)
{
pInstance->SetData(DATA_MOORABI_EVENT, DONE);
if (IsHeroic() && !bPhase)
pInstance->DoCompleteAchievement(ACHIEV_LESS_RABI);
}
}
void KilledUnit(Unit* pVictim)
@@ -170,7 +170,25 @@ public:
};
class achievement_less_rabi : public AchievementCriteriaScript
{
public:
achievement_less_rabi() : AchievementCriteriaScript("achievement_less_rabi")
{
}
bool OnCheck(Player* /*player*/, Unit* target)
{
if (Creature* Moorabi = target->ToCreature())
if (Moorabi->AI()->GetData(DATA_LESS_RABI))
return true;
return false;
}
};
void AddSC_boss_moorabi()
{
new boss_moorabi();
new achievement_less_rabi();
}