Fix progression stalls and add normal class trainer visits
Core tests / core (push) Successful in 29s
Core tests / core (push) Successful in 29s
This commit is contained in:
+8
-6
@@ -26,7 +26,7 @@ function latestObservationFor(bot:Bot,events:Awaited<ReturnType<typeof recentAle
|
||||
});
|
||||
}
|
||||
|
||||
function observationFrom(bot:Bot,event:Awaited<ReturnType<typeof recentAleEvents>>[number],events:Awaited<ReturnType<typeof recentAleEvents>>):Observation{
|
||||
function observationFrom(bot:Bot,event:Awaited<ReturnType<typeof recentAleEvents>>[number],events:Awaited<ReturnType<typeof recentAleEvents>>,hardcore=true):Observation{
|
||||
const p=payloadObject(event.payload);
|
||||
const zone=typeof p.zoneName==='string'&&p.zoneName.trim()?p.zoneName.trim().slice(0,120):bot.zone;
|
||||
const level=typeof p.level==='number'&&Number.isInteger(p.level)&&p.level>0&&p.level<=100?p.level:bot.level;
|
||||
@@ -39,7 +39,7 @@ function observationFrom(bot:Bot,event:Awaited<ReturnType<typeof recentAleEvents
|
||||
level,
|
||||
alive:bot.status!=='dead',
|
||||
availableActions:[...bot.personality.activities],
|
||||
summary:`Authoritative live Playerbot observation in ${zone} at level ${level}. Recent server events: ${recent.join(', ')||'snapshot'}.`
|
||||
summary:`Realm death rules: ${hardcore?'permanent death':'normal resurrection; recover and resume progression after death'}. Authoritative live Playerbot observation in ${zone} at level ${level}. Recent server events: ${recent.join(', ')||'snapshot'}.`
|
||||
};
|
||||
}
|
||||
|
||||
@@ -56,7 +56,9 @@ export function compileLivePlayerbotIntent(botName:string,decision:Decision){
|
||||
`local ${ai}=${p}:GetBotAI()`,
|
||||
`if not ${ai} then error("PlayerbotAI unavailable") end`,
|
||||
`if ${ai}:HasGameClientMaster() then return "Human control preserved" end`,
|
||||
`if AzerothAISurvivalOverride and AzerothAISurvivalOverride(${p}) then return "Native survival action takes priority" end`
|
||||
`if ${p}:HasUnitState(0x00000100) then return "Native taxi flight takes priority" end`,
|
||||
`if AzerothAISurvivalOverride and AzerothAISurvivalOverride(${p}) then return "Native survival action takes priority" end`,
|
||||
`if AzerothAITrainingOverride and AzerothAITrainingOverride(${p}) then return "Class trainer visit takes priority" end`
|
||||
];
|
||||
const body:string[]=[];
|
||||
const clearStay=()=>body.push(strategy(ai,'-stay'));
|
||||
@@ -84,8 +86,8 @@ export function compileLivePlayerbotIntent(botName:string,decision:Decision){
|
||||
body.push(`${ai}:DoNextAction(false)`);
|
||||
break;
|
||||
case 'rest':
|
||||
body.push(strategy(ai,'+stay'));
|
||||
body.push(`${ai}:DoSpecificAction("sit",true,"")`);
|
||||
clearStay();
|
||||
body.push(`if ${p}:GetHealthPct()<95 or (${p}:GetPowerType()==0 and ${p}:GetPowerPct(0)<65) then ${ai}:DoSpecificAction("eat",true,"");${ai}:DoSpecificAction("drink",true,"") else ${ai}:DoNextAction(false) end`);
|
||||
break;
|
||||
}
|
||||
body.push(`return ${luaString(`intent ${decision.action} accepted for ${botName}`)}`);
|
||||
@@ -142,7 +144,7 @@ export async function runLiveAutonomyTick(
|
||||
}
|
||||
|
||||
let bot=pick.bot;
|
||||
const observation=observationFrom(bot,pick.obs,events);
|
||||
const observation=observationFrom(bot,pick.obs,events,s.settings.hardcore.enabled);
|
||||
const guild=s.community?.guilds.find(g=>g.id===bot.world?.guildId);
|
||||
if(guild)observation.summary+=` Your guild ${guild.name} works toward ${guild.goal}; confirmed progress ${guild.progress}/${guild.target}. Favor helpful actions toward that goal when safe.`;
|
||||
const brain=providerForBot(bot,s.settings,config);
|
||||
|
||||
Reference in New Issue
Block a user