Merge branch 'master' into Playerbot

This commit is contained in:
Yunfan Li
2024-04-26 18:56:32 +08:00
6 changed files with 22680 additions and 5 deletions

View File

@@ -1153,7 +1153,7 @@ void SmartAI::OnSpellClick(Unit* clicker, bool& /*result*/)
GetScript()->ProcessEventsFor(SMART_EVENT_ON_SPELLCLICK, clicker);
}
void SmartAI::PathEndReached(uint32 pathId)
void SmartAI::PathEndReached(uint32 /*pathId*/)
{
GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_DATA_ENDED, nullptr, 0, me->GetWaypointPath());
}

View File

@@ -91,14 +91,23 @@ bool ChaseMovementGenerator<T>::DoUpdate(T* owner, uint32 time_diff)
Unit* target = i_target.getTarget();
bool const mutualChase = IsMutualChase(owner, target);
bool mutualChase = IsMutualChase(owner, target);
bool const mutualTarget = target->GetVictim() == owner;
float const chaseRange = GetChaseRange(owner, target);
float const meleeRange = owner->GetMeleeRange(target);
float const minTarget = (_range ? _range->MinTolerance : 0.0f) + chaseRange;
float const maxRange = _range ? _range->MaxRange + chaseRange : owner->GetMeleeRange(target); // melee range already includes hitboxes
float const maxRange = _range ? _range->MaxRange + chaseRange : meleeRange; // melee range already includes hitboxes
float const maxTarget = _range ? _range->MaxTolerance + chaseRange : CONTACT_DISTANCE + chaseRange;
Optional<ChaseAngle> angle = mutualChase ? Optional<ChaseAngle>() : _angle;
// Prevent almost infinite spinning of mutual targets.
if (angle && !mutualChase && _mutualChase && mutualTarget && chaseRange < meleeRange)
{
angle = Optional<ChaseAngle>();
mutualChase = true;
}
// periodically check if we're already in the expected range...
i_recheckDistance.Update(time_diff);
if (i_recheckDistance.Passed())

View File

@@ -271,11 +271,11 @@ struct boss_alar : public BossAI
me->SummonCreature(NPC_FLAME_PATCH, *target, TEMPSUMMON_TIMED_DESPAWN, 2 * MINUTE * IN_MILLISECONDS);
}
}, 30s);
ScheduleTimedEvent(50s, [&]
ScheduleTimedEvent(34s, [&]
{
me->GetMotionMaster()->MovePoint(POINT_DIVE, alarPoints[POINT_DIVE], false, true);
scheduler.DelayAll(15s);
}, 50s);
}, 57s);
ScheduleUniqueTimedEvent(10min, [&]
{
DoCastSelf(SPELL_BERSERK);