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
@@ -1707,6 +1707,9 @@ class achievement_twilight_assist : public AchievementCriteriaScript
bool OnCheck(Player* player, Unit* target)
{
if (!target)
return false;
if (Creature* Sartharion = target->ToCreature())
if (Sartharion->AI()->GetData(TWILIGHT_ACHIEVEMENTS) >= 1)
return true;
@@ -1724,6 +1727,9 @@ class achievement_twilight_duo : public AchievementCriteriaScript
bool OnCheck(Player* player, Unit* target)
{
if (!target)
return false;
if (Creature* Sartharion = target->ToCreature())
if (Sartharion->AI()->GetData(TWILIGHT_ACHIEVEMENTS) >= 2)
return true;
@@ -1741,6 +1747,9 @@ class achievement_twilight_zone : public AchievementCriteriaScript
bool OnCheck(Player* player, Unit* target)
{
if (!target)
return false;
if (Creature* Sartharion = target->ToCreature())
if (Sartharion->AI()->GetData(TWILIGHT_ACHIEVEMENTS) == 3)
return true;