Compare commits

...

7 Commits

7 changed files with 36 additions and 17 deletions

View File

@ -234,7 +234,7 @@ def backtick_check(file: io, file_path: str) -> None:
# Skip SQL keywords
if word.upper() in {"SELECT", "FROM", "JOIN", "WHERE", "GROUP", "BY", "ORDER",
"DELETE", "UPDATE", "INSERT", "INTO", "SET", "VALUES", "AND",
"IN", "OR", "REPLACE"}:
"IN", "OR", "REPLACE", "NOT"}:
continue
# Make sure the word is enclosed in backticks

View File

@ -0,0 +1,3 @@
-- DB update 2025_02_22_00 -> 2025_02_24_00
--
UPDATE `creature_template` SET `flags_extra` = `flags_extra`|512|2147483648 WHERE `entry` = 25038;

View File

@ -633,6 +633,7 @@ void BossAI::_Reset()
me->ResetLootMode();
events.Reset();
scheduler.CancelAll();
me->m_Events.KillAllEvents(false);
summons.DespawnAll();
ClearUniqueTimedEventsDone();
_healthCheckEvents.clear();
@ -787,6 +788,20 @@ void BossAI::ScheduleHealthCheckEvent(std::initializer_list<uint8> healthPct, st
_nextHealthCheck = _healthCheckEvents.front();
}
void BossAI::ScheduleEnrageTimer(uint32 spellId, Milliseconds timer, uint8 textId /*= 0*/)
{
me->m_Events.AddEventAtOffset([this, spellId, textId]
{
if (!me->IsAlive())
return;
if (textId)
Talk(textId);
DoCastSelf(spellId, true);
}, timer);
}
// WorldBossAI - for non-instanced bosses
WorldBossAI::WorldBossAI(Creature* creature) :

View File

@ -485,6 +485,12 @@ public:
void ScheduleHealthCheckEvent(uint32 healthPct, std::function<void()> exec);
void ScheduleHealthCheckEvent(std::initializer_list<uint8> healthPct, std::function<void()> exec);
// @brief Casts the spell after the fixed time and says the text id if provided. Timer will run even if the creature is casting or out of combat.
// @param spellId The spell to cast.
// @param timer The time to wait before casting the spell.
// @param textId The text id to say.
void ScheduleEnrageTimer(uint32 spellId, Milliseconds timer, uint8 textId = 0);
// Hook used to execute events scheduled into EventMap without the need
// to override UpdateAI
// note: You must re-schedule the event within this method if the event

View File

@ -172,10 +172,10 @@ void World::LoadConfigSettings(bool reload)
LOG_ERROR("server.loading", "World settings reload fail: can't read settings.");
return;
}
}
sLog->LoadFromConfig();
sMetric->LoadFromConfigs();
sLog->LoadFromConfig();
sMetric->LoadFromConfigs();
}
// Set realm id and enable db logging
sLog->SetRealmId(realm.Id.Realm);

View File

@ -84,7 +84,6 @@ struct boss_sacrolash : public BossAI
_isSisterDead = false;
BossAI::Reset();
me->SetLootMode(0);
me->m_Events.KillAllEvents(false);
}
void DoAction(int32 param) override
@ -125,10 +124,7 @@ struct boss_sacrolash : public BossAI
if (alythess->IsAlive() && !alythess->IsInCombat())
alythess->AI()->AttackStart(who);
me->m_Events.AddEventAtOffset([&] {
Talk(YELL_BERSERK);
DoCastSelf(SPELL_ENRAGE, true);
}, 6min);
ScheduleEnrageTimer(SPELL_ENRAGE, 6min, YELL_BERSERK);
ScheduleTimedEvent(10s, [&] {
DoCastSelf(SPELL_SHADOW_BLADES);
@ -196,7 +192,6 @@ struct boss_alythess : public BossAI
_isSisterDead = false;
BossAI::Reset();
me->SetLootMode(0);
me->m_Events.KillAllEvents(false);
}
void DoAction(int32 param) override
@ -237,10 +232,7 @@ struct boss_alythess : public BossAI
if (sacrolash->IsAlive() && !sacrolash->IsInCombat())
sacrolash->AI()->AttackStart(who);
me->m_Events.AddEventAtOffset([&] {
Talk(YELL_BERSERK);
DoCastSelf(SPELL_ENRAGE, true);
}, 6min);
ScheduleEnrageTimer(SPELL_ENRAGE, 6min, YELL_BERSERK);
ScheduleTimedEvent(1s, [&] {
DoCastVictim(SPELL_BLAZE);

View File

@ -134,7 +134,7 @@ struct boss_felmyst : public BossAI
void JustEngagedWith(Unit* who) override
{
BossAI::JustEngagedWith(who);
me->CastSpell(me, SPELL_NOXIOUS_FUMES, true);
me->m_Events.AddEventAtOffset([&] {
Talk(YELL_BERSERK);
DoCastSelf(SPELL_BERSERK, true);
@ -144,7 +144,7 @@ struct boss_felmyst : public BossAI
Position landPos = who->GetPosition();
me->m_Events.AddEventAtOffset([&, landPos] {
me->GetMotionMaster()->MovePoint(POINT_GROUND, landPos, false, true);
me->GetMotionMaster()->MoveLand(POINT_GROUND, landPos);
}, 2s);
}
@ -168,11 +168,14 @@ struct boss_felmyst : public BossAI
void MovementInform(uint32 type, uint32 point) override
{
if (type != POINT_MOTION_TYPE)
if (type != EFFECT_MOTION_TYPE && type != POINT_MOTION_TYPE)
return;
if (point == POINT_GROUND)
{
if (!me->HasAura(SPELL_NOXIOUS_FUMES))
DoCastSelf(SPELL_NOXIOUS_FUMES, true);
me->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
me->SetCanFly(false);
me->SetDisableGravity(false);