PlayerbotV2: tank leads in a raid, and stops before each boss
"lead on" (the Orders tab's Tank leads button) was refused in every raid group, "lead off" too, so each click of the button printed the refusal again. A raid group on a raid map is now led: its main tank (the raid frame's Main Tank mark, else a tank bot of the player's) leads the trash pack by pack, with the same waits as in a 5-man (mana, the dead, the player inside and within 60 yards) and the same pause and "go". Before every boss the tank stops where it would pull from and says "the boss is next: pull it when you are ready, or say go". The player pulls it himself, or says "go" and the tank pulls it through the usual gates. The stop ends once the boss fight is on, so after a wipe the tank stops at the same boss again. Only the main tank says the waits. A party that is not a raid group on a raid map is still not led (it follows its owner there); "lead on" says to convert it to a raid first. The addon button counts a raid as inside for the lead's end, and its tooltip says what the raid lead does.
This commit is contained in:
@@ -1459,8 +1459,9 @@ function UI.Hint(pane, y, text)
|
||||
return fs
|
||||
end
|
||||
|
||||
-- Tank leads (server: "lead on|pause|off", BotCommandParser::ApplyLeadOrder): in a 5-man dungeon the tank bot leads the group, the
|
||||
-- player follows. A click turns it on or off, a right-click pauses it or goes on. The button shows what was last sent: green on,
|
||||
-- Tank leads (server: "lead on|pause|off", BotCommandParser::ApplyLeadOrder): in a 5-man dungeon or a raid group the tank bot leads,
|
||||
-- the player follows (in a raid it stops before each boss for the player's pull or "go"). A click turns it on or off, a right-click
|
||||
-- pauses it or goes on. The button shows what was last sent: green on,
|
||||
-- blue paused. The server ends the lead when the group leaves the dungeon, and so does the button (UI.LeadZone).
|
||||
UI.leadState, UI.leadInside = "off", false
|
||||
function UI.RefreshLead()
|
||||
@@ -1500,11 +1501,11 @@ function UI.LeadPausedByOrder()
|
||||
UI.RefreshLead()
|
||||
end
|
||||
end
|
||||
-- Loading screens: inside a 5-man the lead is in force; leaving the dungeon again ends it (as on the server).
|
||||
-- Loading screens: inside a 5-man or a raid the lead is in force; leaving it again ends it (as on the server).
|
||||
function UI.LeadZone()
|
||||
local inside, kind = false, nil
|
||||
if IsInInstance then inside, kind = IsInInstance() end
|
||||
if inside and kind == "party" then
|
||||
if inside and (kind == "party" or kind == "raid") then
|
||||
UI.leadInside = true
|
||||
elseif UI.leadInside then
|
||||
UI.leadInside = false
|
||||
@@ -1560,7 +1561,7 @@ function UI.BuildOrders()
|
||||
UI.leadBtn = Btn(ordersGrid, 162, 18 + 4 * 32, 76, 26, L["short:Tank leads"], { size = 11 })
|
||||
UI.leadBtn:RegisterForClicks("LeftButtonUp", "RightButtonUp")
|
||||
UI.leadBtn:SetScript("OnClick", function(_, button) UI.LeadClick(button) end)
|
||||
Tip(UI.leadBtn, L["Tank leads"], L["In a dungeon your tank bot leads: it walks on, pulls pack by pack, waits for mana and for you, and goes boss to boss. You follow.\nClick: on or off. Right-click: pause (it holds where it stands) or go on.\nGreen: on. Blue: paused. It ends when you leave the dungeon. Follow, Stay and Come pause it: say go (or right-click) and it leads on."])
|
||||
Tip(UI.leadBtn, L["Tank leads"], L["In a dungeon or a raid your tank bot leads: it walks on, pulls pack by pack, waits for mana and for you, and goes boss to boss. You follow. In a raid it stops before each boss: pull it yourself, or say go.\nClick: on or off. Right-click: pause (it holds where it stands) or go on.\nGreen: on. Blue: paused. It ends when you leave the dungeon or raid. Follow, Stay and Come pause it: say go (or right-click) and it leads on."])
|
||||
UI.RefreshLead()
|
||||
|
||||
-- Two on/off check boxes at the bottom (the client's own check box). Area spells: on (the server's start setting) the bots use
|
||||
|
||||
@@ -593,6 +593,6 @@ ForeverBotsLocale = {
|
||||
["short:Tank leads"] = "Танк ведет", -- check
|
||||
["short:Lead paused"] = "Пауза",
|
||||
["Tank leads"] = "Танк ведет группу", -- check
|
||||
["In a dungeon your tank bot leads: it walks on, pulls pack by pack, waits for mana and for you, and goes boss to boss. You follow.\nClick: on or off. Right-click: pause (it holds where it stands) or go on.\nGreen: on. Blue: paused. It ends when you leave the dungeon. Follow, Stay and Come pause it: say go (or right-click) and it leads on."] = "В подземелье группу ведет ваш бот-танк: идет вперед, пулит по одной группе мобов, ждет ману и вас и идет от босса к боссу. Вы следуете за ним.\nЩелчок: вкл. или выкл. Правый щелчок: пауза (стоит на месте) или дальше.\nЗеленый: вкл. Синий: пауза. Заканчивается, когда вы выходите из подземелья. «За мной», «Стоять» и «Ко мне» ставят ведение на паузу: скажите go (или правый щелчок), и танк ведет дальше.", -- check
|
||||
["In a dungeon or a raid your tank bot leads: it walks on, pulls pack by pack, waits for mana and for you, and goes boss to boss. You follow. In a raid it stops before each boss: pull it yourself, or say go.\nClick: on or off. Right-click: pause (it holds where it stands) or go on.\nGreen: on. Blue: paused. It ends when you leave the dungeon or raid. Follow, Stay and Come pause it: say go (or right-click) and it leads on."] = "В подземелье или рейде группу ведет ваш бот-танк: идет вперед, пулит по одной группе мобов, ждет ману и вас и идет от босса к боссу. Вы следуете за ним. В рейде он останавливается перед каждым боссом: пульте его сами или скажите go.\nЩелчок: вкл. или выкл. Правый щелчок: пауза (стоит на месте) или дальше.\nЗеленый: вкл. Синий: пауза. Заканчивается, когда вы выходите из подземелья или рейда. «За мной», «Стоять» и «Ко мне» ставят ведение на паузу: скажите go (или правый щелчок), и танк ведет дальше.", -- check
|
||||
["the tank does not lead now: click the button first."] = "танк сейчас не ведет: сначала нажмите кнопку.",
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ The `.bot` commands for your own bots work for every account, no GM needed; each
|
||||
| `.bot add <class> [tank\|healer\|dps] [race] [male\|female]` | Creates a companion bound to you, levels it to you, teaches spells, sets role/talents/gear, brings it over and groups it. The role is kept across relog and `.bot call`. |
|
||||
| `.bot lfg [tank\|healer\|dps]` | Fills the missing tank / healer / damage places of your group (1 tank, 1 healer, 3 damage) with level-matched companions, now. The word is your own role. The Group Finder does the same on its own: post a dungeon listing and, if nobody joins within `Playerbot.Lfg.BotFillSeconds` (default 180), the missing roles are filled. |
|
||||
| `.bot dungeon [list \| <name\|any> [tank\|healer\|dps] \| leave \| cancel]` | Dungeon finder. `.bot dungeon any` (a random 5-player dungeon for your level) or `.bot dungeon <word>` (`rfc`, `vc`/`dm` Deadmines, `smgy`, `smlib`, `dme`, `strat`, `ubrs`...; `.bot dungeon list` shows them): the missing tank / healer / damage places are filled with your companions at your level, and once the group is complete (at most 90 s) you are put inside the dungeon's door and your bots are brought after you. Real players in your group get a summon. `.bot dungeon leave` takes you back to where you queued, bots follow; `cancel` stops a queue still forming. Only the group leader queues. `Playerbot.Lfg.Finder.Enable` turns it off. |
|
||||
| `.bot lead [on\|pause\|off]` | Tank leads: in a 5-man dungeon your tank bot leads and you follow (the same as `lead on` / `lead pause` / `lead off` in party chat and the Orders tab's Tank leads button). See section 8. |
|
||||
| `.bot lead [on\|pause\|off]` | Tank leads: in a 5-man dungeon or a raid your tank bot leads and you follow (in a raid it stops before each boss for you) (the same as `lead on` / `lead pause` / `lead off` in party chat and the Orders tab's Tank leads button). See section 8. |
|
||||
| `.bot call <name\|all>` | Brings back a companion (logs it in, joins your group). `all` = your saved roster plus every bot in your group. |
|
||||
| `.bot summon <name\|all\|saved>` | Every player, own bots only: `.bot summon all` brings only the bots that are in your group right now (it never logs anyone in), `.bot summon saved` your saved roster plus the grouped bots (logging them in), `.bot summon <name>` one of your companions. Any other name: "You can only summon your own bots". The GM `.summon` (other players) is unchanged and stays GM-only. |
|
||||
| `.bot goto <name>` | Every player, own bots only (companions and summoned alts): takes you to that bot, the other way round from `.bot summon`. Not in combat, dead or on a flight path, and not into or out of a battleground or arena. Into a dungeon or raid only when the bot is in your group, and the dungeon's own entry rules still apply. The GM `.appear` stays GM-only. |
|
||||
@@ -290,8 +290,12 @@ A group chat order reaches every bot of yours; to address only some, whisper the
|
||||
in party chat it says `waiting for mana` or `waiting for you`. `lead pause` holds it where it stands (it still fights what
|
||||
comes); `go` (also `lead on`, `вперед`) goes on. `lead off`, or leaving the dungeon, gives the lead back to you. `follow`,
|
||||
`stay`, `hold` and `come` (the buttons too) pause the lead and do their own thing; `go` picks it up again. `go` is the lead's
|
||||
word only while the lead is on or paused. It needs one of your bots in the tank role, and is for
|
||||
5-man dungeons only (a raid group runs its own pulls).
|
||||
word only while the lead is on or paused. It needs one of your bots in the tank role.
|
||||
In a raid group on a raid map the main tank (the raid frame's Main Tank mark, else a tank bot of yours) leads the trash the
|
||||
same way, but stops before every boss where it would pull from and says `the boss is next: pull it when you are ready, or
|
||||
say go`. Pull the boss yourself and the raid fights it as usual, or say `go` and the tank pulls it (still after the mana and
|
||||
the dead). After a wipe it stops again at the same boss. A party that is not a raid group on a raid map is not led: convert
|
||||
it to a raid first.
|
||||
|
||||
## 9. Battleground behaviour
|
||||
|
||||
|
||||
@@ -700,7 +700,8 @@ void BotAI::tick(BotSnapshotView snapshot,
|
||||
|
||||
bool BotAI::tank_leads_here(BotSnapshotView const& s) const
|
||||
{
|
||||
return tank_lead_engaged() && s.is_in_dungeon() && !s.is_in_raid() && !s.in_battleground();
|
||||
// Map::IsDungeon covers raid maps too; there only a raid group is led (a party there stays on its owner, raid_map_party_hold).
|
||||
return tank_lead_engaged() && s.is_in_dungeon() && !s.in_battleground() && (!s.is_in_raid() || s.in_raid_group());
|
||||
}
|
||||
|
||||
void BotAI::update_dungeon_autopilot_hold(BotSnapshotView s, GroupSnapshotView g)
|
||||
@@ -735,6 +736,18 @@ void BotAI::update_dungeon_autopilot_hold(BotSnapshotView s, GroupSnapshotView g
|
||||
tank_lead_inside_ms_ = 0;
|
||||
tank_lead_away_ms_ = 0;
|
||||
}
|
||||
// The raid lead's boss stop ends with the lead and once the boss fight is on (the player pulled, or "go" let the tank pull): the
|
||||
// next boss, or the same one after a wipe, stops again.
|
||||
if (tank_lead_boss_wait() != 0 || tank_lead_boss_go() != 0)
|
||||
{
|
||||
bool const boss_fight = s.is_encounter_in_progress() ||
|
||||
(s.in_combat() && !s.current_boss_guid().IsEmpty() && s.victim() == s.current_boss_guid());
|
||||
if (!tank_leads_now_ || tank_lead() != TankLead::On || !s.is_in_raid() || boss_fight)
|
||||
{
|
||||
set_tank_lead_boss_wait(0);
|
||||
set_tank_lead_boss_go(0);
|
||||
}
|
||||
}
|
||||
|
||||
// An owner Stay / Hold: the dungeon autopilot (converge, rejoin, advance, pull) walks nobody who was told to stay.
|
||||
owner_hold_ = holding_position(s.published_at_ms());
|
||||
|
||||
@@ -862,6 +862,8 @@ public:
|
||||
// bots alone: it walks the route, pulls pack by pack and goes boss to boss, and the player follows. It still waits for the
|
||||
// healer's and the casters' mana (PullManaGate), for the dead, and for the player when he is dead, outside or over
|
||||
// kTankLeadPlayerHoldYd away. Paused: the lead stays with the tank, which starts no new pull and walks no further until "lead on".
|
||||
// In a raid group on a raid map the main tank leads the trash the same way, but stops before each boss: it stands where it would
|
||||
// pull from and waits until the player pulls himself or says "go" (tank_lead_boss_wait / tank_lead_boss_go; chris 2026-11-14).
|
||||
// Ends on its own when the bot leaves the dungeon (update_dungeon_autopilot_hold). Every bot of the group holds it: the tank
|
||||
// leads, the rest stay on the tank and fight its pulls. Written by the chat handler (world thread), read by the bot worker.
|
||||
enum class TankLead : uint8 { Off = 0, On = 1, Paused = 2 };
|
||||
@@ -871,9 +873,17 @@ public:
|
||||
// Returns true when the value changed.
|
||||
bool set_tank_lead(TankLead m) { return tank_lead_.exchange(uint8(m), std::memory_order_relaxed) != uint8(m); }
|
||||
bool tank_lead_engaged() const { return tank_lead() != TankLead::Off; }
|
||||
// The bot is in a 5-man dungeon with the lead on (or paused): the human hold, the human-led passivity and the human-led
|
||||
// mana exemption do not apply.
|
||||
// The bot is in a 5-man dungeon, or in a raid group on a raid map, with the lead on (or paused): the human hold, the human-led
|
||||
// passivity and the human-led mana exemption do not apply. A party that is not a raid group on a raid map is not led
|
||||
// (raid_map_party_hold keeps it on its owner).
|
||||
bool tank_leads_here(BotSnapshotView const& s) const;
|
||||
// Raid lead, the boss stop: the entry of the boss the leading tank stands before (0: none), written by the tank's worker and read by
|
||||
// the chat handler, which answers "go" with the pull; and the entry the player said "go" for, which lets that one pull through.
|
||||
// Both are cleared once the boss fight starts, so a wipe stops again at the same boss.
|
||||
uint32 tank_lead_boss_wait() const { return tank_lead_boss_wait_.load(std::memory_order_relaxed); }
|
||||
void set_tank_lead_boss_wait(uint32 entry) { tank_lead_boss_wait_.store(entry, std::memory_order_relaxed); }
|
||||
uint32 tank_lead_boss_go() const { return tank_lead_boss_go_.load(std::memory_order_relaxed); }
|
||||
void set_tank_lead_boss_go(uint32 entry) { tank_lead_boss_go_.store(entry, std::memory_order_relaxed); }
|
||||
// The reason the leading tank last told the group it waits ("mana", "you", ...) and when, so it says it once per hold
|
||||
// (States: the advance gate). Bot worker only.
|
||||
char const* tank_lead_said() const { return tank_lead_said_; }
|
||||
@@ -3675,6 +3685,8 @@ private:
|
||||
bool human_lead_hold_ = false; // see human_lead_hold()
|
||||
uint32 human_seen_ms_ = 0; // last tick a leading human was in range (0 = never)
|
||||
std::atomic<uint8> tank_lead_{0}; // TankLead
|
||||
std::atomic<uint32> tank_lead_boss_wait_{0}; // see tank_lead_boss_wait()
|
||||
std::atomic<uint32> tank_lead_boss_go_{0}; // see tank_lead_boss_go()
|
||||
uint32 tank_lead_inside_ms_ = 0; // last tick inside a 5-man dungeon while the lead was on (0 = not yet)
|
||||
uint32 tank_lead_away_ms_ = 0; // first tick outside it since (0 = inside); the lead ends after kTankLeadLeaveMs
|
||||
char const* tank_lead_said_ = nullptr; // see tank_lead_said()
|
||||
|
||||
@@ -2469,10 +2469,13 @@ bool BotCommandParser::ApplyLeadOrder(Player* sender, std::string const& line, c
|
||||
answer.PSendSysMessage("%s", "You have no group yet: add a bot first.");
|
||||
return true;
|
||||
}
|
||||
// A raid group runs its own pulls (the raid autopilot); a companion party in a raid map follows its owner (raid_map_party_hold).
|
||||
if (grp->isRaidGroup())
|
||||
// A raid group is led too (chris, 2026-11-14): its main tank leads the trash and stops before each boss for the player. A party that
|
||||
// is not a raid group on a raid map follows its owner (raid_map_party_hold), so the lead waits for the raid group there.
|
||||
bool const raid = grp->isRaidGroup();
|
||||
Map const* here = sender->GetMap();
|
||||
if (want != BotAI::TankLead::Off && !raid && here && here->IsRaid())
|
||||
{
|
||||
answer.PSendSysMessage("%s", "'lead' is for a 5-man dungeon: in a raid group the bots run the pulls on their own.");
|
||||
answer.PSendSysMessage("%s", "In a raid the tank leads a raid group: convert your party to a raid first, then say 'lead on'.");
|
||||
return true;
|
||||
}
|
||||
std::vector<Player*> bots;
|
||||
@@ -2483,7 +2486,12 @@ bool BotCommandParser::ApplyLeadOrder(Player* sender, std::string const& line, c
|
||||
if (!m || m == sender) continue;
|
||||
if (!Services::Registry().has(m->GetGUID().GetCounter()) || !ControlsForGroupOrder(sender, m)) continue;
|
||||
bots.push_back(m);
|
||||
if (BotRole(m) == Role::Tank && (!tank || (!tank->IsAlive() && m->IsAlive())))
|
||||
if (BotRole(m) != Role::Tank)
|
||||
continue;
|
||||
// In a raid the main tank (the raid frame's Main Tank mark) leads: the autopilot's pulls are its own (pve_order.main_tank).
|
||||
bool const main = raid && (grp->GetMemberFlags(m->GetGUID()) & MEMBER_FLAG_MAINTANK) != 0;
|
||||
bool const tank_main = tank && raid && (grp->GetMemberFlags(tank->GetGUID()) & MEMBER_FLAG_MAINTANK) != 0;
|
||||
if (!tank || (main && !tank_main) || (main == tank_main && !tank->IsAlive() && m->IsAlive()))
|
||||
tank = m;
|
||||
}
|
||||
if (bots.empty())
|
||||
@@ -2505,8 +2513,18 @@ bool BotCommandParser::ApplyLeadOrder(Player* sender, std::string const& line, c
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Map const* here = sender->GetMap();
|
||||
bool const in_dungeon = here && here->IsDungeon() && !here->IsRaid();
|
||||
bool const in_dungeon = here && here->IsDungeon(); // a 5-man or a raid map
|
||||
bool const in_raid = in_dungeon && here->IsRaid();
|
||||
// "go" at a raid boss: the tank stands before it (tank_lead_boss_wait) and the player hands it the pull.
|
||||
uint32 boss_go = 0;
|
||||
if (go_word && raid)
|
||||
for (Player* m : bots)
|
||||
if (BotAI const* ai = Services::Registry().ai(m->GetGUID().GetCounter()); ai && ai->tank_lead() == BotAI::TankLead::On &&
|
||||
ai->tank_lead_boss_wait() != 0)
|
||||
{
|
||||
boss_go = ai->tank_lead_boss_wait();
|
||||
break;
|
||||
}
|
||||
uint32 changed = 0;
|
||||
for (Player* m : bots)
|
||||
{
|
||||
@@ -2520,8 +2538,15 @@ bool BotCommandParser::ApplyLeadOrder(Player* sender, std::string const& line, c
|
||||
ai->exit_manual();
|
||||
ai->release_owner_lead(false);
|
||||
Map const* bm = m->GetMap();
|
||||
if (bm && bm->IsDungeon() && !bm->IsRaid() && ai->dungeon_run_mode() != BotAI::DungeonRunMode::Active)
|
||||
if (bm && bm->IsDungeon() && ai->dungeon_run_mode() != BotAI::DungeonRunMode::Active)
|
||||
ai->set_dungeon_run_mode(BotAI::DungeonRunMode::Active);
|
||||
if (boss_go != 0)
|
||||
ai->set_tank_lead_boss_go(boss_go);
|
||||
}
|
||||
else
|
||||
{
|
||||
ai->set_tank_lead_boss_wait(0);
|
||||
ai->set_tank_lead_boss_go(0);
|
||||
}
|
||||
}
|
||||
std::string const name = tank ? tank->GetName() : std::string();
|
||||
@@ -2529,9 +2554,17 @@ bool BotCommandParser::ApplyLeadOrder(Player* sender, std::string const& line, c
|
||||
switch (want)
|
||||
{
|
||||
case BotAI::TankLead::On:
|
||||
reply = go_word ? fmt::format("{} leads on.", name) : in_dungeon
|
||||
? fmt::format("{} leads the dungeon now: it pulls pack by pack and waits for mana and for you. Say 'lead pause' to hold, 'lead off' to lead yourself.", name)
|
||||
: fmt::format("{} leads once you are inside a dungeon. Say 'lead off' to lead yourself.", name);
|
||||
if (boss_go != 0)
|
||||
reply = fmt::format("{} pulls the boss.", name);
|
||||
else if (go_word)
|
||||
reply = fmt::format("{} leads on.", name);
|
||||
else if (in_raid)
|
||||
reply = fmt::format("{} leads the raid now: it pulls pack by pack, waits for mana and for you, and stops before each boss for you to pull "
|
||||
"(or say 'go'). Say 'lead pause' to hold, 'lead off' to lead yourself.", name);
|
||||
else if (in_dungeon)
|
||||
reply = fmt::format("{} leads the dungeon now: it pulls pack by pack and waits for mana and for you. Say 'lead pause' to hold, 'lead off' to lead yourself.", name);
|
||||
else
|
||||
reply = fmt::format("{} leads once you are inside a dungeon or a raid. Say 'lead off' to lead yourself.", name);
|
||||
break;
|
||||
case BotAI::TankLead::Paused:
|
||||
reply = fmt::format("{} holds here and pulls nothing until you say 'go'.", name);
|
||||
@@ -2540,9 +2573,10 @@ bool BotCommandParser::ApplyLeadOrder(Player* sender, std::string const& line, c
|
||||
reply = "You lead again: your bots follow you.";
|
||||
break;
|
||||
}
|
||||
TC_LOG_INFO("playerbot.v2", "[tank_lead] {} ({}): lead {} for {} bot(s) ({} changed), tank {}, {}", sender->GetName(), via ? via : "?",
|
||||
TC_LOG_INFO("playerbot.v2", "[tank_lead] {} ({}): lead {} for {} bot(s) ({} changed), tank {}, {}{}", sender->GetName(), via ? via : "?",
|
||||
want == BotAI::TankLead::On ? "on" : want == BotAI::TankLead::Paused ? "pause" : "off", bots.size(), changed,
|
||||
name.empty() ? "-" : name, in_dungeon ? "in a dungeon" : "outside a dungeon");
|
||||
name.empty() ? "-" : name, in_raid ? "in a raid" : in_dungeon ? "in a dungeon" : "outside a dungeon",
|
||||
boss_go != 0 ? fmt::format(", boss pull for entry {}", boss_go) : std::string());
|
||||
answer.PSendSysMessage("%s", reply.c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -138,6 +138,46 @@ static bool PullManaGate(BotSnapshotView const& s, BotAI const& ai, GroupSnapsho
|
||||
return true;
|
||||
}
|
||||
|
||||
// "Tank leads" in a raid (chris, 2026-11-14: "Can it be done for RAIDs as well?"): the main tank leads the trash pack by pack, but a
|
||||
// boss is the player's to pull. Called by every out-of-combat boss pull of the autopilot right before it would start the fight: while
|
||||
// the lead is on in a raid and the player has not said "go" for this boss, the tank stays where it would have pulled from, says once
|
||||
// that the boss is next, and pulls nothing. The player pulls himself (the raid joins the fight as any boss fight), or says "go"
|
||||
// (BotCommandParser::ApplyLeadOrder sets tank_lead_boss_go) and the tank pulls it through the same gates (mana, the dead, the player).
|
||||
// BotAI::update_dungeon_autopilot_hold clears both once the fight is on.
|
||||
static bool LeadHoldsBossPull(BotSnapshotView const& s, BotAI& ai, BotIntentEmitter& emit, ObjectGuid boss, uint32 now_ms)
|
||||
{
|
||||
if (!s.is_in_raid() || !ai.tank_leads_here(s) || ai.tank_lead() != BotAI::TankLead::On || boss.IsEmpty())
|
||||
return false;
|
||||
uint32 const entry = boss.GetEntry();
|
||||
if (entry != 0 && ai.tank_lead_boss_go() == entry)
|
||||
return false;
|
||||
// Said once per stop, and again after a minute of waiting, in party chat like the other waits of the lead. Its own clock (not
|
||||
// tank_lead_said): a mana wait in between must not make the tank say the boss line again each time the mana comes back.
|
||||
constexpr uint32 kSayAgainMs = 60000;
|
||||
static std::mutex said_mu;
|
||||
static std::unordered_map<uint64, uint32> said_ms; // tank -> when it last said the boss line
|
||||
bool say = false;
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(said_mu);
|
||||
uint32& last = said_ms[uint64(s.raw().guid.GetCounter())];
|
||||
if (ai.tank_lead_boss_wait() != entry || last == 0 || now_ms - last >= kSayAgainMs)
|
||||
{
|
||||
last = now_ms ? now_ms : 1u;
|
||||
say = true;
|
||||
}
|
||||
}
|
||||
if (ai.tank_lead_boss_wait() != entry)
|
||||
{
|
||||
ai.set_tank_lead_boss_wait(entry);
|
||||
TC_LOG_INFO("playerbot.v2", "[tank_lead] {} stops before boss entry {} ({}): waits for the player's pull or 'go'",
|
||||
s.name(), entry, boss.GetCounter());
|
||||
}
|
||||
if (say)
|
||||
emit.say("the boss is next: pull it when you are ready, or say go");
|
||||
ai.set_last_rule_fired("idle:tank_lead_boss_stop");
|
||||
return true;
|
||||
}
|
||||
|
||||
// Score an item against the bot's spec stat weights. Used by the
|
||||
// equip-upgrade rule (Phase 1 of ITEM_VENDOR_SYSTEM_PLAN.md). Decision
|
||||
// flow:
|
||||
@@ -5022,6 +5062,10 @@ bool DungeonCombatPositioning(BotSnapshotView const& s, BotAI& ai,
|
||||
if (trash_on_tank && healer_in_pull && s.victim() != pb_boss->GetGUID() && ai.tank_diag_due(now_ms))
|
||||
TC_LOG_INFO("playerbot.v2", "[pull_gate] {} holds the boss pull: {} mob(s) still on the tank",
|
||||
s.name(), s.fightable_attackers_count());
|
||||
// Raid lead: the boss is the player's to pull (LeadHoldsBossPull).
|
||||
if (healer_in_pull && !dps_wait && !trash_on_tank && s.victim() != pb_boss->GetGUID() &&
|
||||
LeadHoldsBossPull(s, ai, emit, pb_boss->GetGUID(), now_ms))
|
||||
return true;
|
||||
if (healer_in_pull && !dps_wait && !trash_on_tank && s.victim() != pb_boss->GetGUID() &&
|
||||
!ai.action_recently_tried(BotAI::ActionKind::PveTargetSwitch, pull_key, now_ms) &&
|
||||
emit.start_attack(pb_boss->GetGUID()))
|
||||
@@ -9291,7 +9335,9 @@ bool DungeonDispatch(BotSnapshotView const& s, BotAI& ai,
|
||||
// The leading tank says what it waits for, once per hold (and again after kSayAgainMs of the same hold), in party chat, as a
|
||||
// real tank would: the player who handed it the lead sees why nothing moves. Out of combat and with the autopilot running
|
||||
// only; "paused" is the player's own order and the order's answer already said it.
|
||||
if (tank_leads && ai.effective_role(s) == Role::Tank && ai.dungeon_active() && s.is_alive() && !s.in_combat())
|
||||
// In a raid only the main tank leads; a spare tank on off-tank duty says nothing.
|
||||
if (tank_leads && ai.effective_role(s) == Role::Tank && ai.dungeon_active() && s.is_alive() && !s.in_combat() &&
|
||||
!(s.raw().pve_order.active && !s.raw().pve_order.main_tank.IsEmpty() && s.raw().pve_order.main_tank != s.guid()))
|
||||
{
|
||||
constexpr uint32 kSayAgainMs = 45000;
|
||||
char const* const said = ai.tank_lead_said();
|
||||
@@ -10240,6 +10286,9 @@ bool DungeonDispatch(BotSnapshotView const& s, BotAI& ai,
|
||||
// tank engages the boss directly below.
|
||||
if (engage_target && bd2 <= kBossEngageR2 && in_los)
|
||||
{
|
||||
// Raid lead: the tank stands here until the player pulls or says "go" (LeadHoldsBossPull).
|
||||
if (LeadHoldsBossPull(s, ai, emit, engage_target->GetGUID(), now_ms))
|
||||
return true;
|
||||
// Pull: stationary boss, chasing can't overshoot.
|
||||
if (!emit.start_attack(engage_target->GetGUID()))
|
||||
return false;
|
||||
@@ -12429,6 +12478,8 @@ bool DungeonDispatch(BotSnapshotView const& s, BotAI& ai,
|
||||
// Lockout-gate so a refused boss-engage doesn't claim
|
||||
// dispatch every tick. note_engage on success aligns this
|
||||
// with idle:tank_pull_next and idle:quest_kill.
|
||||
// Raid lead: the boss is the player's to pull (LeadHoldsBossPull).
|
||||
if (LeadHoldsBossPull(s, ai, emit, s.current_boss_guid(), now_ms)) return true;
|
||||
if (!emit.start_attack(s.current_boss_guid())) return false;
|
||||
ai.note_engage(s.current_boss_guid(), now_ms);
|
||||
ai.set_last_rule_fired("idle:dungeon_engage_boss");
|
||||
|
||||
@@ -729,19 +729,23 @@ std::vector<Catalog::Entry> const& RussianEntries()
|
||||
// Tank leads (BotCommandParser::ApplyLeadOrder, the leading tank's word in State_Idle). The command words stay English.
|
||||
{ "waiting for mana", "жду ману" },
|
||||
{ "waiting for you", "жду вас" },
|
||||
{ "the boss is next: pull it when you are ready, or say go", "дальше босс: пульте его, когда будете готовы, или скажите go" },
|
||||
{ "Tank leads: say 'lead on' (your tank bot leads the dungeon), 'lead pause' (it holds) or 'lead off' (you lead again).",
|
||||
"Танк ведет: скажите 'lead on' (ваш бот-танк ведет группу по подземелью), 'lead pause' (он ждет) или 'lead off' (снова ведете вы)." },
|
||||
{ "You have no group yet: add a bot first.", "У вас еще нет группы: сначала добавьте бота." },
|
||||
{ "'lead' is for a 5-man dungeon: in a raid group the bots run the pulls on their own.",
|
||||
"'lead' - для подземелья на 5 человек: в рейдовой группе боты сами начинают бои." },
|
||||
{ "In a raid the tank leads a raid group: convert your party to a raid first, then say 'lead on'.",
|
||||
"В рейде танк ведет рейдовую группу: сначала преобразуйте группу в рейд, затем скажите 'lead on'." },
|
||||
{ "{} leads the raid now: it pulls pack by pack, waits for mana and for you, and stops before each boss for you to pull (or say 'go'). Say 'lead pause' to hold, 'lead off' to lead yourself.",
|
||||
"{} ведет рейд: пулит по одной группе мобов, ждет ману и вас и останавливается перед каждым боссом, чтобы его пульнули вы (или скажите 'go'). Скажите 'lead pause', чтобы он ждал, 'lead off', чтобы вести самому." },
|
||||
{ "{} pulls the boss.", "{} пулит босса." },
|
||||
{ "No bot of yours in the group.", "В группе нет ваших ботов." },
|
||||
{ "None of your bots in the group is a tank: add one (.bot add warrior tank), then say 'lead on'.",
|
||||
"Ни один из ваших ботов в группе не танк: добавьте танка (.bot add warrior tank), затем скажите 'lead on'." },
|
||||
{ "Your tank does not lead now: say 'lead on' first.", "Ваш танк сейчас не ведет: сначала скажите 'lead on'." },
|
||||
{ "{} leads the dungeon now: it pulls pack by pack and waits for mana and for you. Say 'lead pause' to hold, 'lead off' to lead yourself.",
|
||||
"{} ведет группу по подземелью: пулит по одной группе мобов и ждет ману и вас. Скажите 'lead pause', чтобы он ждал, 'lead off', чтобы вести самому." },
|
||||
{ "{} leads once you are inside a dungeon. Say 'lead off' to lead yourself.",
|
||||
"{} поведет группу, когда вы войдете в подземелье. Скажите 'lead off', чтобы вести самому." },
|
||||
{ "{} leads once you are inside a dungeon or a raid. Say 'lead off' to lead yourself.",
|
||||
"{} поведет группу, когда вы войдете в подземелье или рейд. Скажите 'lead off', чтобы вести самому." },
|
||||
{ "{} holds here and pulls nothing until you say 'go'.", "{} ждет здесь и никого не пулит, пока вы не скажете 'go'." },
|
||||
{ "You lead again: your bots follow you.", "Снова ведете вы: ваши боты следуют за вами." },
|
||||
{ "{} leads on.", "{} ведет дальше." },
|
||||
|
||||
@@ -154,6 +154,17 @@ TEST_CASE("BotLocale: the tank lead lines keep the tank's name", "[BotLocale]")
|
||||
CHECK(Translate(Lang::Ru, "Raveni leads on.") == "Raveni ведет дальше.");
|
||||
CHECK(Translate(Lang::Ru, "Raveni pauses the lead: say 'go' when it should lead on.") ==
|
||||
"Raveni ждет: скажите 'go' (или 'вперед'), когда ему вести дальше.");
|
||||
// The raid lead: the main tank stops before each boss.
|
||||
CHECK(Translate(Lang::Ru, "Raveni leads the raid now: it pulls pack by pack, waits for mana and for you, and stops before each boss for you to pull "
|
||||
"(or say 'go'). Say 'lead pause' to hold, 'lead off' to lead yourself.") ==
|
||||
"Raveni ведет рейд: пулит по одной группе мобов, ждет ману и вас и останавливается перед каждым боссом, чтобы его пульнули вы (или скажите 'go'). "
|
||||
"Скажите 'lead pause', чтобы он ждал, 'lead off', чтобы вести самому.");
|
||||
CHECK(Translate(Lang::Ru, "Raveni pulls the boss.") == "Raveni пулит босса.");
|
||||
CHECK(Translate(Lang::Ru, "Raveni leads once you are inside a dungeon or a raid. Say 'lead off' to lead yourself.") ==
|
||||
"Raveni поведет группу, когда вы войдете в подземелье или рейд. Скажите 'lead off', чтобы вести самому.");
|
||||
CHECK(Translate(Lang::Ru, "the boss is next: pull it when you are ready, or say go") == "дальше босс: пульте его, когда будете готовы, или скажите go");
|
||||
CHECK(Translate(Lang::Ru, "In a raid the tank leads a raid group: convert your party to a raid first, then say 'lead on'.") ==
|
||||
"В рейде танк ведет рейдовую группу: сначала преобразуйте группу в рейд, затем скажите 'lead on'.");
|
||||
}
|
||||
|
||||
TEST_CASE("BotLocale: captured words are translated, names and numbers are not", "[BotLocale]")
|
||||
|
||||
Reference in New Issue
Block a user