This commit is contained in:
Jelle Meeus
2025-07-13 10:34:59 +02:00
parent c22ba2b1cf
commit af0cc22a49

View File

@@ -15,7 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ScriptMgr.h"
#include "CreatureScript.h"
#include "ScriptedCreature.h"
#include "naxxramas.h"
@@ -30,7 +30,8 @@ enum Yells
enum Spells
{
SPELL_HATEFUL_STRIKE = 28308,
SPELL_HATEFUL_STRIKE_10 = 41926,
SPELL_HATEFUL_STRIKE_25 = 59192,
SPELL_FRENZY = 28131,
SPELL_BERSERK = 26662,
SPELL_SLIME_BOLT = 32309
@@ -44,6 +45,11 @@ enum Events
EVENT_BERSERK = 4
};
enum Misc
{
ACHIEV_TIMED_START_EVENT = 10286
};
class boss_patchwerk_40 : public CreatureScript
{
public:
@@ -57,12 +63,9 @@ public:
struct boss_patchwerk_40AI : public BossAI
{
explicit boss_patchwerk_40AI(Creature* c) : BossAI(c, BOSS_PATCHWERK)
{
pInstance = me->GetInstanceScript();
}
{}
EventMap events;
InstanceScript* pInstance;
void Reset() override
{
@@ -72,17 +75,13 @@ public:
void KilledUnit(Unit* who) override
{
if (who->GetTypeId() != TYPEID_PLAYER)
if (!who->IsPlayer())
return;
if (!urand(0, 3))
{
Talk(SAY_SLAY);
}
if (pInstance)
{
pInstance->SetData(DATA_IMMORTAL_FAIL, 0);
}
instance->StorePersistentData(PERSISTENT_DATA_IMMORTAL_FAIL, 1);
}
void JustDied(Unit* killer) override
@@ -96,9 +95,10 @@ public:
BossAI::JustEngagedWith(who);
Talk(SAY_AGGRO);
me->SetInCombatWithZone();
events.ScheduleEvent(EVENT_HATEFUL_STRIKE, 1200);
events.ScheduleEvent(EVENT_BERSERK, 7 * 60 * 1000); // 7 minutes enrange
events.ScheduleEvent(EVENT_HEALTH_CHECK, 1000);
events.ScheduleEvent(EVENT_HATEFUL_STRIKE, 1200ms);
events.ScheduleEvent(EVENT_BERSERK, 7min); // 7 minutes enrange
events.ScheduleEvent(EVENT_HEALTH_CHECK, 1s);
// instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
}
void UpdateAI(uint32 diff) override
@@ -156,19 +156,19 @@ public:
if (finalTarget)
{
int32 dmg = urand(22100,22850);
me->CastCustomSpell(finalTarget, SPELL_HATEFUL_STRIKE, &dmg, 0, 0, false);
me->CastCustomSpell(finalTarget, SPELL_HATEFUL_STRIKE_10, &dmg, 0, 0, false);
}
events.RepeatEvent(1200);
events.Repeat(1200ms);
break;
}
case EVENT_BERSERK:
Talk(EMOTE_BERSERK);
me->CastSpell(me, SPELL_BERSERK, true);
events.ScheduleEvent(EVENT_SLIME_BOLT, 3000);
events.ScheduleEvent(EVENT_SLIME_BOLT, 3s);
break;
case EVENT_SLIME_BOLT:
me->CastSpell(me, SPELL_SLIME_BOLT, false);
events.RepeatEvent(3000);
events.Repeat(3s);
break;
case EVENT_HEALTH_CHECK:
if (me->GetHealthPct() <= 5)
@@ -177,7 +177,7 @@ public:
me->CastSpell(me, SPELL_FRENZY, true);
break;
}
events.RepeatEvent(1000);
events.Repeat(1s);
break;
}
DoMeleeAttackIfReady();