Skip to content

Commit

Permalink
Fix Nerf Scrapbots achievement
Browse files Browse the repository at this point in the history
  • Loading branch information
M0ra committed Mar 16, 2015
1 parent b12eaff commit 68a6b5d
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp
Expand Up @@ -101,7 +101,8 @@ enum Events
EVENT_DISPOSE_HEART,
EVENT_EXPOSE_HEART,
EVENT_ENRAGE,
EVENT_ENTER_HARD_MODE
EVENT_ENTER_HARD_MODE,
EVENT_NERF_SCRAPBOTS
};

enum Timers
Expand Down Expand Up @@ -142,7 +143,8 @@ enum Creatures

enum Actions
{
ACTION_ENTER_HARD_MODE
ACTION_ENTER_HARD_MODE,
ACTION_INCREASE_SCRAPBOT_COUNT
};

enum XT002Data
Expand Down Expand Up @@ -207,6 +209,7 @@ class boss_xt002 : public CreatureScript
_healthRecovered = false;
_gravityBombCasualty = false;
_hardMode = false;
_scrapbotCount = 0;

_phase = 1;
_heartExposed = 0;
Expand Down Expand Up @@ -248,6 +251,15 @@ class boss_xt002 : public CreatureScript
// Heart is already dead
events.CancelEvent(EVENT_DISPOSE_HEART);
break;
case ACTION_INCREASE_SCRAPBOT_COUNT:
if (!_scrapbotCount)
events.ScheduleEvent(EVENT_NERF_SCRAPBOTS, 12000);

_scrapbotCount++;

if (_scrapbotCount >= 20)
instance->DoCastSpellOnPlayers(SPELL_ACHIEVEMENT_CREDIT_NERF_SCRAPBOTS);
break;
}
}

Expand Down Expand Up @@ -325,6 +337,10 @@ class boss_xt002 : public CreatureScript
_hardMode = true;
SetPhaseOne();
break;
case EVENT_NERF_SCRAPBOTS:
_scrapbotCount = 0;
events.CancelEvent(EVENT_NERF_SCRAPBOTS);
break;
}
}

Expand Down Expand Up @@ -445,6 +461,7 @@ class boss_xt002 : public CreatureScript

uint8 _phase;
uint8 _heartExposed;
uint8 _scrapbotCount;
};
};

Expand Down Expand Up @@ -531,7 +548,14 @@ class npc_scrapbot : public CreatureScript
if (who->GetTypeId() == TYPEID_PLAYER)
me->GetInstanceScript()->SetData(DATA_CRITERIA_XT_002, 1);
}


void JustDied(Unit* who) override
{
if (who->GetEntry() == NPC_XE321_BOOMBOT)
if (Creature* xt002 = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(BOSS_XT002)))
xt002->AI()->DoAction(ACTION_INCREASE_SCRAPBOT_COUNT);
}

void UpdateAI(uint32 diff) override
{
if (_rangeCheckTimer <= diff)
Expand Down

0 comments on commit 68a6b5d

Please sign in to comment.