Scripts/Achievements: Fixed a crash in Heigan's achievement script & more possible crashes & small improvements to handling datas for achievements

This commit is contained in:
Lopin
2011-06-25 19:11:56 +02:00
parent af023a40f7
commit 0cf40b897c
21 changed files with 88 additions and 35 deletions
@@ -283,6 +283,9 @@ class achievement_king_dred : public AchievementCriteriaScript
bool OnCheck(Player* /*player*/, Unit* target)
{
if (!target)
return false;
if (Creature* Dred = target->ToCreature())
if (Dred->AI()->GetData(DATA_KING_DRED) >= 6)
return true;
@@ -352,6 +352,9 @@ class achievement_oh_novos : public AchievementCriteriaScript
bool OnCheck(Player* /*player*/, Unit* target)
{
if (!target)
return false;
if (Creature* Novos = target->ToCreature())
if (Novos->AI()->GetData(DATA_OH_NOVOS))
return true;
@@ -204,6 +204,9 @@ class achievement_consumption_junction : public AchievementCriteriaScript
bool OnCheck(Player* /*player*/, Unit* target)
{
if (!target)
return false;
if (Creature* Trollgore = target->ToCreature())
if (Trollgore->AI()->GetData(DATA_CONSUMPTION_JUNCTION))
return true;