fix(Scripts/ShatteredHalls): Prevent boss from being pulled early (#16389)

* init

* Update boss_nethekurse.cpp
This commit is contained in:
Gultask
2023-05-28 14:43:56 -03:00
committed by GitHub
parent 69af2ddbe4
commit ce788f68c2
2 changed files with 28 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
--
DELETE FROM `smart_scripts` WHERE (`entryorguid` IN (-151090,-151091,-151092,-151093)) AND (`source_type` = 0) AND (`id` IN (0));
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(-151090, 0, 1000, 0, 11, 0, 100, 0, 0, 0, 0, 0, 0, 18, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Hack: Fel Orc Convert - On Respawn - Set Flags Not Attackable'),
(-151091, 0, 1000, 0, 11, 0, 100, 0, 0, 0, 0, 0, 0, 18, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Hack: Fel Orc Convert - On Respawn - Set Flags Not Attackable'),
(-151092, 0, 1000, 0, 11, 0, 100, 0, 0, 0, 0, 0, 0, 18, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Hack: Fel Orc Convert - On Respawn - Set Flags Not Attackable'),
(-151093, 0, 1000, 0, 11, 0, 100, 0, 0, 0, 0, 0, 0, 18, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Hack: Fel Orc Convert - On Respawn - Set Flags Not Attackable');
UPDATE `creature_template` SET `flags_extra` = `flags_extra`|134217728 WHERE (`entry` IN (17083, 20567));

View File

@@ -111,6 +111,11 @@ struct boss_grand_warlock_nethekurse : public BossAI
});
instance->SetBossState(DATA_NETHEKURSE, NOT_STARTED);
if (!_canAggro)
{
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
}
}
void JustReachedHome() override
@@ -232,6 +237,19 @@ struct boss_grand_warlock_nethekurse : public BossAI
}
else if (action == ACTION_START_INTRO)
{
// Hack: Prevent from pulling from behind door
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
_canAggro = true;
std::list<Creature*> creatureList;
GetCreatureListWithEntryInGrid(creatureList, me, NPC_PEON, 60.0f);
for (Creature* creature : creatureList)
{
if (creature)
{
creature->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
}
}
IntroRP();
}
}
@@ -253,6 +271,7 @@ struct boss_grand_warlock_nethekurse : public BossAI
private:
uint8 PeonEngagedCount = 0;
uint8 PeonKilledCount = 0;
bool _canAggro = false;
};
class spell_tsh_shadow_bolt : public SpellScript