Skip to content

Commit

Permalink
Scripts/Naxxramas: Fixed achievement Just Can't Get Enough
Browse files Browse the repository at this point in the history
  • Loading branch information
Lopin committed Aug 20, 2011
1 parent b838aad commit feb3d9c
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 0 deletions.
@@ -0,0 +1,11 @@
UPDATE `creature_template` SET `AIName`='', `ScriptName`='npc_kelthuzad_abomination' WHERE `entry`=16428;

DELETE FROM `creature_ai_scripts` WHERE `creature_id`=16428;

DELETE FROM `achievement_criteria_data` WHERE `criteria_id` IN (7614, 7615) AND `type`=11;
INSERT INTO `achievement_criteria_data` (`criteria_id`,`type`,`value1`,`value2`,`ScriptName`)
VALUES
(7614,11,0,0,'achievement_just_cant_get_enough'),
(7615,11,0,0,'achievement_just_cant_get_enough');

DELETE FROM `disables` WHERE `entry` IN (7614, 7615);
83 changes: 83 additions & 0 deletions src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp
Expand Up @@ -74,6 +74,7 @@ enum Event
EVENT_TRIGGER,

EVENT_PHASE,
EVENT_MORTAL_WOUND,
};

enum Spells
Expand Down Expand Up @@ -121,6 +122,10 @@ enum Spells
//death knight
SPELL_PLAGUE_STRIKE = 49921,
SPELL_HOWLING_BLAST = 51411,

// Abomination spells
SPELL_FRENZY = 28468,
SPELL_MORTAL_WOUND = 28467,
};

enum Creatures
Expand Down Expand Up @@ -709,8 +714,86 @@ class at_kelthuzad_center : public AreaTriggerScript

};

class npc_kelthuzad_abomination : public CreatureScript
{
public:
npc_kelthuzad_abomination() : CreatureScript("npc_kelthuzad_abomination") { }

struct npc_kelthuzad_abominationAI : public ScriptedAI
{
npc_kelthuzad_abominationAI(Creature* creature) : ScriptedAI(creature)
{
instance = me->GetInstanceScript();
}

InstanceScript* instance;
EventMap events;

void Reset()
{
events.Reset();
events.ScheduleEvent(EVENT_MORTAL_WOUND, urand(2000, 5000));
DoCast(me, SPELL_FRENZY, true);
}

void UpdateAI(uint32 const diff)
{
if (!UpdateVictim())
return;

events.Update(diff);

while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_MORTAL_WOUND:
DoCastVictim(SPELL_MORTAL_WOUND, true);
events.ScheduleEvent(EVENT_MORTAL_WOUND, urand(10000, 15000));
break;
default:
break;
}
}
}

void JustDied(Unit* /*who*/)
{
if (instance)
instance->SetData(DATA_ABOMINATION_KILLED, instance->GetData(DATA_ABOMINATION_KILLED) + 1);
}
};

CreatureAI* GetAI(Creature* creature) const
{
return new npc_kelthuzad_abominationAI(creature);
}
};

class achievement_just_cant_get_enough : public AchievementCriteriaScript
{
public:
achievement_just_cant_get_enough() : AchievementCriteriaScript("achievement_just_cant_get_enough")
{
}

bool OnCheck(Player* /*player*/, Unit* target)
{
if (!target)
return false;

if (InstanceScript* instance = target->GetInstanceScript())
if (instance->GetData(DATA_ABOMINATION_KILLED) >= 18)
return true;

return false;
}
};

void AddSC_boss_kelthuzad()
{
new boss_kelthuzad();
new at_kelthuzad_center();
new npc_kelthuzad_abomination();
new achievement_just_cant_get_enough();
}
18 changes: 18 additions & 0 deletions src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp
Expand Up @@ -140,6 +140,8 @@ class instance_naxxramas : public InstanceMapScript
uint64 uiKelthuzadTrigger;
uint64 uiPortals[4];

uint32 AbominationCount;

GOState gothikDoorState;

time_t minHorsemenDiedTime;
Expand Down Expand Up @@ -273,9 +275,25 @@ class instance_naxxramas : public InstanceMapScript
maxHorsemenDiedTime = now;
}
break;
case DATA_ABOMINATION_KILLED:
AbominationCount = value;
break;
}
}

uint32 GetData(uint32 id)
{
switch (id)
{
case DATA_ABOMINATION_KILLED:
return AbominationCount;
default:
break;
}

return 0;
}

uint64 GetData64(uint32 id)
{
switch(id)
Expand Down
1 change: 1 addition & 0 deletions src/server/scripts/Northrend/Naxxramas/naxxramas.h
Expand Up @@ -48,6 +48,7 @@ enum Data
DATA_HORSEMEN1,
DATA_HORSEMEN2,
DATA_HORSEMEN3,
DATA_ABOMINATION_KILLED,
};

enum Data64
Expand Down

1 comment on commit feb3d9c

@Lordron
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

http://www.youtube.com/watch?v=OrTyD7rjBpw&ob=av3e

The Black Eyed Peas - Just Can't Get Enough)

Please sign in to comment.