Merge branch 'master' into Playerbot

This commit is contained in:
Yunfan Li
2023-06-13 01:04:01 +08:00
5 changed files with 100 additions and 6 deletions

View File

@@ -125,11 +125,12 @@ struct boss_murmur : public BossAI
void JustEngagedWith(Unit* who) override
{
if (!who->IsInCombatWith(me))
// Boss engages mobs during roleplay, this checks prevents it from setting the zone in combat before players engage it.
if (who->IsPlayer() || who->IsPet() || who->IsGuardian())
{
return;
_JustEngagedWith();
}
_JustEngagedWith();
scheduler.Schedule(28s, [this](TaskContext context)
{
Talk(EMOTE_SONIC_BOOM);
@@ -186,6 +187,7 @@ struct boss_murmur : public BossAI
context.Repeat(3650ms, 9150ms);
});
}
me->m_Events.CancelEventGroup(GROUP_OOC_CAST);
}
};

View File

@@ -37,16 +37,16 @@ struct npc_underbat : public ScriptedAI
void JustEngagedWith(Unit* /*who*/) override
{
_scheduler.Schedule(2200ms, 6900ms, [this](TaskContext context)
_scheduler.Schedule(1200ms, 12500ms, [this](TaskContext context)
{
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, [&](Unit* u)
{
return u->IsAlive() && !u->IsPet() && me->IsWithinCombatRange(u, 20.f) && !me->HasInArc(M_PI, u);
return u->IsAlive() && !u->IsPet() && me->IsWithinCombatRange(u, 5.0f) && !me->HasInArc(M_PI, u);
}))
{
DoCast(target, SPELL_TENTACLE_LASH);
}
context.Repeat(5700ms, 9700ms);
context.Repeat(1200ms, 12500ms);
});
}