Fix progression stalls and add normal class trainer visits
Core tests / core (push) Successful in 29s

This commit is contained in:
Codex
2026-09-24 09:24:57 +12:00
parent d57d793a84
commit 132bf75f9d
24 changed files with 343 additions and 31 deletions
+16 -7
View File
@@ -117,8 +117,9 @@ local function sample()
if ai and master and master:IsPlayerbot() and master:GetGUIDLow()==ownedMasters[id] and not ai:HasGameClientMaster() then ai:SetMaster(nil) end
ownedMasters[id]=nil
end
if ai and not ai:HasGameClientMaster() and not p:IsTaxi() and not p:IsRooted() and not ai:IsMovementImpaired() then
if ai and not ai:HasGameClientMaster() and not p:HasUnitState(0x00000100) and not p:IsRooted() and not ai:IsMovementImpaired() then
local g=safeGroup(p)
if (not p:GetGroup() or g) and hp>=95 and mana>=65 and ai:HasStrategy('stay',1) then ai:ChangeStrategy('-stay',1) end
-- Never intervene in a party containing humans, unregistered bots, or offline members.
if not p:GetGroup() or g then
local peers=g and g:GetMembers() or {p};local weak,support=0,0
@@ -140,18 +141,26 @@ local function sample()
-- Decide cohesion before restoring work flags, so native RPG cannot undo a wait/follow.
local leader=g and ai:GetGroupLeader() or nil
local regroup,waiting=false,false
local cohesion=enabled and now-enabledAt<180 and g and not p:IsInCombat() and not p:IsCasting() and not unsafe and not avoid and not resting
if cohesion and leader and managed(leader) and not leader:IsTaxi() then
local cohesion=not (AzerothAITrainingOverride and AzerothAITrainingOverride(p)) and enabled and now-enabledAt<180 and g and not p:IsInCombat() and not p:IsCasting() and not unsafe and not avoid and not resting
if cohesion and leader and managed(leader) and not leader:HasUnitState(0x00000100) then
if leader~=p and leader:GetMapId()==p:GetMapId() and leader:GetPhaseMask()==p:GetPhaseMask() then
local distance=p:GetDistance(leader)
-- Hysteresis prevents alternating independent work and follow at the boundary.
if distance<=6 or distance>=200 then r.catchingUp=false
elseif distance>12 then r.catchingUp=true end
if distance<=6 or distance>=200 then r.catchingUp=false;r.catchSince=nil;r.catchDistance=nil
elseif distance>12 and now>=(r.catchBlockedUntil or 0) then
r.catchingUp=true;r.catchSince=r.catchSince or now
if not r.catchDistance or distance<r.catchDistance-3 then r.catchProgress=now;r.catchDistance=distance end
if now-r.catchSince>=120 or now-(r.catchProgress or now)>=30 then
r.catchingUp=false;r.catchSince=nil;r.catchDistance=nil;r.catchBlockedUntil=now+120
if ownedMasters[id] and master and master:GetGUIDLow()==ownedMasters[id] then ai:SetMaster(nil);ownedMasters[id]=nil end
audit(p,'regroup-backoff','No useful reunion within bounded attempt; resume own activities')
end
end
regroup=r.catchingUp and hp>=95 and mana>=65 and not leader:IsInCombat()
elseif leader==p then
local separated=false
for _,m in pairs(peers) do
if m~=p and not m:IsTaxi() and m:GetMapId()==p:GetMapId() and m:GetPhaseMask()==p:GetPhaseMask() and p:GetDistance(m)<200 and (p:GetDistance(m)>15 or m:GetHealthPct()<85 or (m:GetPowerType()==0 and m:GetPowerPct(0)<35)) then separated=true;break end
if m~=p and not m:HasUnitState(0x00000100) and m:GetMapId()==p:GetMapId() and m:GetPhaseMask()==p:GetPhaseMask() and p:GetDistance(m)<200 and (p:GetDistance(m)>15 or m:GetHealthPct()<85 or (m:GetPowerType()==0 and m:GetPowerPct(0)<35)) then separated=true;break end
end
if separated then
r.waitSince=r.waitSince or now
@@ -179,7 +188,7 @@ local function sample()
p:MoveStop()
if now-(r.restAt or 0)>=20 then
r.restAt=now
ai:DoSpecificAction('eat',true);ai:DoSpecificAction('drink',true)
ai:DoSpecificAction('eat',true);ai:DoSpecificAction('drink',true);ai:DoSpecificAction('sit',true)
end
end
elseif regroup then