Scripts/Azjol'Nerub: Properly fixed achievement Watch Him Die and remove forgotten stuff from last recent commit
This commit is contained in:
+36
-31
@@ -75,11 +75,6 @@ enum Yells
|
||||
SAY_PREFIGHT_3 = -1601019
|
||||
};
|
||||
|
||||
enum Misc
|
||||
{
|
||||
ACHIEV_WATH_HIM_DIE = 1296
|
||||
};
|
||||
|
||||
const Position SpawnPoint[] =
|
||||
{
|
||||
{ 566.164f, 682.087f, 769.079f, 2.21657f },
|
||||
@@ -186,24 +181,8 @@ public:
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
|
||||
if (!pInstance)
|
||||
return;
|
||||
|
||||
pInstance->SetData(DATA_KRIKTHIR_THE_GATEWATCHER_EVENT, DONE);
|
||||
//Achievement: Watch him die
|
||||
Creature *pAdd = Unit::GetCreature(*me, pInstance->GetData64(DATA_WATCHER_GASHRA));
|
||||
if (!pAdd || !pAdd->isAlive())
|
||||
return;
|
||||
|
||||
pAdd = Unit::GetCreature(*me, pInstance->GetData64(DATA_WATCHER_SILTHIK));
|
||||
if (!pAdd || !pAdd->isAlive())
|
||||
return;
|
||||
|
||||
pAdd = Unit::GetCreature(*me, pInstance->GetData64(DATA_WATCHER_NARJIL));
|
||||
if (!pAdd || !pAdd->isAlive())
|
||||
return;
|
||||
|
||||
pInstance->DoCompleteAchievement(ACHIEV_WATH_HIM_DIE);
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_KRIKTHIR_THE_GATEWATCHER_EVENT, DONE);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
@@ -551,14 +530,40 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_watch_him_die : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_watch_him_die() : AchievementCriteriaScript("achievement_watch_him_die")
|
||||
{
|
||||
}
|
||||
|
||||
bool OnCheck(Player* /*player*/, Unit* target)
|
||||
{
|
||||
InstanceScript* instance = target->GetInstanceScript();
|
||||
Creature* Watcher[3];
|
||||
if (!instance)
|
||||
return false;
|
||||
|
||||
for (uint8 n = 0; n < 3; ++n)
|
||||
{
|
||||
Watcher[n] = ObjectAccessor::GetCreature(*target, instance->GetData64(DATA_WATCHER_GASHRA + n));
|
||||
if (Watcher[n] && !Watcher[n]->isAlive())
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_krik_thir()
|
||||
{
|
||||
new boss_krik_thir;
|
||||
new npc_skittering_infector;
|
||||
new npc_anub_ar_skirmisher;
|
||||
new npc_anub_ar_shadowcaster;
|
||||
new npc_watcher_gashra;
|
||||
new npc_anub_ar_warrior;
|
||||
new npc_watcher_silthik;
|
||||
new npc_watcher_narjil;
|
||||
new boss_krik_thir();
|
||||
new npc_skittering_infector();
|
||||
new npc_anub_ar_skirmisher();
|
||||
new npc_anub_ar_shadowcaster();
|
||||
new npc_watcher_gashra();
|
||||
new npc_anub_ar_warrior();
|
||||
new npc_watcher_silthik();
|
||||
new npc_watcher_narjil();
|
||||
new achievement_watch_him_die();
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ enum Spells
|
||||
SPELL_STAMPEDE = 55218,
|
||||
SPELL_WHIRLING_SLASH = 55250,
|
||||
H_SPELL_WHIRLING_SLASH = 59824,
|
||||
SPELL_ECK_RESIDUE = 55817
|
||||
};
|
||||
|
||||
//Yells
|
||||
@@ -50,11 +49,6 @@ enum Yells
|
||||
SAY_TRANSFORM_2 = -1604009
|
||||
};
|
||||
|
||||
enum Achievements
|
||||
{
|
||||
ACHIEV_WHAT_THE_ECK = 1864,
|
||||
};
|
||||
|
||||
enum Displays
|
||||
{
|
||||
DISPLAY_RHINO = 26265,
|
||||
@@ -276,21 +270,7 @@ public:
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
if (IsHeroic())
|
||||
{
|
||||
AchievementEntry const *achievWhatTheEck = GetAchievementStore()->LookupEntry(ACHIEV_WHAT_THE_ECK);
|
||||
if (achievWhatTheEck)
|
||||
{
|
||||
Map::PlayerList const &players = pInstance->instance->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
if (itr->getSource()->HasAura(SPELL_ECK_RESIDUE))
|
||||
itr->getSource()->CompletedAchievement(achievWhatTheEck);
|
||||
}
|
||||
}
|
||||
|
||||
pInstance->SetData(DATA_GAL_DARAH_EVENT, DONE);
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
|
||||
Reference in New Issue
Block a user