ZG Hakkar: the raid stays on his platform, the Son is pulled up 45 s early

Both zg_hakkar runs of sweep-zg-1109z and run 1 of 1109w failed the same way:
Hakkar evaded (88%, 34%, 47%). He leaves the fight below z 45.8, and the
Sons of Hakkar stand below his platform (z ~41).

- 1109z run 2: a healer with Corrupted Blood ran from the platform (z 52.9)
  down to z 40.8, woke a Son there, the off-tank went down for it with
  Hakkar after it. A carrier run now ends on the carrier's own floor
  (within 4 y up or down).
- 1109w run 1 and 1109z run 1: the off-tank walked down to take a Son;
  Cause Insanity wiped the main tank's threat, Hakkar turned on the
  off-tank and followed it down. No tank walks down to a Son now: a hunter
  (else a mage, else a warlock) pulls it with one shot and keeps it
  (RaidOrder::keep_aggro: no Feign Death, Vanish or Fade, which made the
  Son leave the fight in 1109y) while it walks the Son to its tank on the
  platform, where the off-tank picks it up.
- The Son was still at 100% 7 s before the siphon (1109w run 2): the kill
  window opens 45 s before Blood Siphon instead of 25 s. Poisonous Blood
  lasts 90 s, so a Son killed then still covers the siphon.

(cherry picked from commit fbfb48c9ad5ada536fc68eea96f39e8f282a3580)
This commit is contained in:
Karrz1
2026-11-11 23:37:52 +00:00
parent 5d1f8c9664
commit a0a4bcff86
7 changed files with 52 additions and 54 deletions
+12 -1
View File
@@ -693,6 +693,7 @@ bool Escape(Player* bot, std::vector<Circle> const& circles, RaidOrder& out, std
// Best nearby point that increases the distance to every raid member in `others`.
std::string g_clearestWhy;
constexpr float kCarrierFloorDz = 4.0f; // a carrier run ends on the carrier's own floor: no more than this above or below it
bool Clearest(Player* bot, std::vector<Player*> const& others, float wanted, RaidOrder& out, char const* reason,
std::vector<Circle> const& avoid, bool urgent)
@@ -741,7 +742,7 @@ bool Clearest(Player* bot, std::vector<Player*> const& others, float wanted, Rai
}
std::stable_sort(candidates.begin(), candidates.end(), [](Candidate const& a, Candidate const& b) { return a.score > b.score; });
int pathChecks = 0, snapChecks = 0, offMesh = 0;
int pathChecks = 0, snapChecks = 0, offMesh = 0, offFloor = 0;
for (Candidate const& c : candidates)
{
if (pathChecks >= (urgent ? 14 : 12))
@@ -778,6 +779,14 @@ bool Clearest(Player* bot, std::vector<Player*> const& others, float wanted, Rai
++why[g_usableWhy];
continue;
}
// A carrier stays on the floor it stands on: a run down a stair or off a ledge takes it out of the boss's room and into what waits
// below. zg_hakkar (sweep-zg-1109z run 2): a healer with Corrupted Blood ran from Hakkar's platform (z 52.9) down to z 40.8, woke a
// Son of Hakkar there, the off-tank went down for the Son with Hakkar after it, and Hakkar evaded at 88% (he leaves the fight below z 45.8).
if (g_carrierRun && std::fabs(pz - bot->GetPositionZ()) > kCarrierFloorDz)
{
++offFloor;
continue;
}
return SetMove(out, cx, cy, pz, reason);
}
@@ -787,6 +796,8 @@ bool Clearest(Player* bot, std::vector<Player*> const& others, float wanted, Rai
w << "not better " << skippedNear << ", in hazard " << skippedAvoid;
if (offMesh)
w << ", off navmesh " << offMesh;
if (offFloor)
w << ", another floor " << offFloor;
for (int i = 1; i < 9; ++i)
if (why[i])
w << ", " << kUsableWhyName[i] << " " << why[i];
@@ -135,7 +135,7 @@ namespace Playerbot::Raid {
r.controlledMember.push_back({ 24327 });
r.noDispel.push_back(24321);
r.retaunt.push_back(14834);
// Poisonous Blood before each Blood Siphon is scripted (RaidMechanics_ZG.cpp, ZgHakkar.h): the DPS kill one Son 25 s before the
// Poisonous Blood before each Blood Siphon is scripted (RaidMechanics_ZG.cpp, ZgHakkar.h): the DPS kill one Son 45 s before the
// siphon is due and the raid gathers on it as it dies (its death gives everyone within 8 y the poison).
// ---------------------------------------------------------------------------------------------------------------
@@ -1,15 +1,15 @@
// Scripted Zul'Gurub mechanics that the rule tables cannot express. See RaidBrainInternal.h and ZgHakkar.h.
//
// * Hakkar's Blood Siphon: 25 s before each siphon the DPS kill one Son of Hakkar (ZgForcedFocus, taken by the fight script), and once it
// * Hakkar's Blood Siphon: 45 s before each siphon the DPS kill one Son of Hakkar (ZgForcedFocus, taken by the fight script), and once it
// is low every raider but Hakkar's tank and a Corrupted Blood carrier stands next to it (ZgMechanicsMove), so its death gives them
// Poisonous Blood. One [raid_siphon] line opens each kill window (Sons in the fight, idle, dead; who is poisoned) and one says how many
// carried the poison when the siphon came, so a run shows whether it worked.
// * The Sons stand idle round the room until somebody hits one. When a kill window opens with no Son in the fight, the off-tank (a bot
// tank Hakkar is not on) walks to the idle Son nearest to Hakkar and takes it (RaidOrder::attack_target), so the Son is held next to
// the raid while the DPS kill it. Before, a ranged bot pulled it with one shot and the Son ran at the shooter: the hunter fed it to
// Feign Death (LooseMobEscape), the Son left the fight, no Son died before a siphon (sweep-zg-1109y: 0 of 19 and 0 of 20 raiders
// poisoned at every siphon) and the loose Son killed a healer, a hunter and a rogue. Only with no off-tank alive does a ranged bot (a
// hunter first, then a mage, then a warlock) still pull with one shot (ZgMechanicsElect), walking into reach first (ZgMechanicsMove).
// * The Sons stand idle round the room, below Hakkar's platform, until somebody hits one. When a kill window opens with no Son in the
// fight, a ranged bot (a hunter first, then a mage, then a warlock; ZgMechanicsElect) walks into reach (ZgMechanicsMove) and pulls the
// idle Son nearest to Hakkar with one shot. The Son runs at it; the puller keeps it (RaidOrder::keep_aggro: no Feign Death, Vanish or
// Fade, which made the Son leave the fight in sweep-zg-1109y) and walks it to its tank, the off-tank picks it up on the platform and
// the DPS kill it there. No tank walks down to a Son: Cause Insanity turns Hakkar onto the off-tank, and an off-tank below the platform
// took him out of his room (he evades below z 45.8; sweep-zg-1109w).
#include "RaidBrainInternal.h"
#include "ZgHakkar.h"
@@ -41,7 +41,6 @@ struct SiphonClock
ObjectGuid son; // the Son the DPS are on (kept until it dies or the window closes)
ObjectGuid pullSon; // the idle Son being pulled (no Son in the fight yet)
ObjectGuid puller; // the bot that pulls it
bool pullerIsTank = false; // the puller is the off-tank: it walks in and takes the Son itself, no ranged walk
};
// The ranged openers of a pull: one shot from range makes the Son run at the shooter.
@@ -178,7 +177,6 @@ Creature* SonToPull(Plan const& plan, SiphonClock& c, Unit* hakkar, uint32_t t)
{
c.pullSon = ObjectGuid::Empty;
c.puller = ObjectGuid::Empty;
c.pullerIsTank = false;
return nullptr;
}
std::list<Creature*> sons;
@@ -197,7 +195,6 @@ Creature* SonToPull(Plan const& plan, SiphonClock& c, Unit* hakkar, uint32_t t)
{
c.pullSon = best->GetGUID();
c.puller = ObjectGuid::Empty;
c.pullerIsTank = false;
TC_LOG_INFO("playerbot.v2.raid", "[raid_siphon] group={} no Son of Hakkar in the fight: pulling the idle one {} y from Hakkar ({}), {} s before the siphon",
plan.groupLow, uint32_t(hakkar->GetExactDist2d(best)), best->GetGUID().GetCounter(), (SiphonDueMs(c.lastSiphon) - t) / 1000u);
}
@@ -225,43 +222,26 @@ void ZgMechanicsElect(Election& e, uint32_t now)
SiphonClock* c = Clock(e.plan, now, hakkar, t);
if (!c)
return;
// A Son of Hakkar on a raider who is not a tank: that raider carries it to its tank and drops no threat (Feign Death, Vanish, Fade),
// so the Son reaches the raid on Hakkar's platform, the off-tank picks it up there and it dies next to the crowd.
for (Unit* u : e.plan.enemies)
{
if (u->GetEntry() != kSonOfHakkar || !u->IsAlive())
continue;
Unit* v = u->GetVictim();
for (Member& m : e.plan.members)
if (m.p == v && !m.tank)
if (RaidOrder* o = e.OrderOf(m.p))
o->keep_aggro = true;
}
Creature* son = SonToPull(e.plan, *c, hakkar, t);
if (!son)
return;
// The off-tank takes the Son: a bot tank Hakkar is not on, the one nearest to the Son (kept while it stays one). It walks in and
// attacks; its own taunt and threat keep the Son on it, and the DPS focus (SonToKill) follows once the Son is in the fight.
Member* tank = nullptr;
for (Member& m : e.plan.members)
{
if (!m.bot || !m.tank || !m.p->IsAlive() || hakkar->GetVictim() == m.p)
continue;
if (m.p->GetGUID() == c->puller && c->pullerIsTank)
{
tank = &m;
break;
}
if (!tank || m.p->GetExactDist2d(son) < tank->p->GetExactDist2d(son))
tank = &m;
}
if (tank)
{
if (c->puller != tank->p->GetGUID() || !c->pullerIsTank)
{
c->puller = tank->p->GetGUID();
c->pullerIsTank = true;
TC_LOG_INFO("playerbot.v2.raid", "[raid_siphon] group={} the off-tank {} takes the Son of Hakkar ({}) from {:.0f} y", e.plan.groupLow,
tank->p->GetName(), son->GetGUID().GetCounter(), tank->p->GetExactDist2d(son));
}
if (RaidOrder* o = e.OrderOf(tank->p))
{
o->attack_target = son->GetGUID();
e.busy.insert(tank->p->GetGUID().GetCounter());
e.dump << " Hakkar: " << tank->p->GetName() << " (off-tank) takes a Son of Hakkar\n";
}
return;
}
c->pullerIsTank = false;
// No off-tank alive: a ranged bot pulls with one shot. The puller: kept while it can still pull, busy or not (its own walk into reach makes it "busy" for the election, which hands every
// No tank walks down to the Sons. Their spots lie below Hakkar's platform, and Cause Insanity (24327) wipes the main tank's threat, so
// Hakkar turns on the off-tank: an off-tank sent down to a Son took him off the platform with it and he evaded at 47% (sweep-zg-1109w
// run 1, Mctankwb at z 40.7; the boss leaves the fight below z 45.8). A ranged bot pulls with one shot instead and keeps the Son on it
// (keep_aggro above) until the off-tank, who stays up with the raid, takes it.
// The puller: kept while it can still pull, busy or not (its own walk into reach makes it "busy" for the election, which hands every
// bot with a move order no job; checking that here swapped the puller each pass, the one walking in lost the job to the other hunter
// and the other's walk took it back: sweep-zg-1109c, Mchunta and Mchuntb "pull" 122 times in turn, no shot fired). Else the free
// ranged DPS bot of the first class in the order, nearest to the Son, that is not Hakkar's target and carries no Corrupted Blood (it
@@ -332,7 +312,7 @@ bool ZgMechanicsMove(Plan const& plan, Member const& self, uint32_t now, RaidOrd
return false;
Player* bot = self.p;
// The puller of an idle Son walks into reach and sight of it (the shot itself is the elected job).
if (!c->puller.IsEmpty() && c->puller == bot->GetGUID() && !c->pullerIsTank)
if (!c->puller.IsEmpty() && c->puller == bot->GetGUID())
if (Creature* pull = SonToPull(plan, *c, hakkar, t))
{
if (bot->IsWithinDistInMap(pull, kPullReach + 2.0f) && bot->IsWithinLOSInMap(pull))
@@ -68,6 +68,10 @@ struct RaidOrder
// Melee soak (Patchwerk): keep attacking this enemy whatever the rotation would pick.
ObjectGuid attack_target;
// The bot carries the enemy on it to its tank instead of dropping threat (Feign Death, Vanish, Fade): the bot that pulled a Son of
// Hakkar brings it up to the raid, where the off-tank picks it up and it dies next to the crowd.
bool keep_aggro = false;
// Mind-controlled creature (Razuvious' understudies): what the bot makes it do. The bot itself only holds the channel.
ObjectGuid charm_attack; // attack and chase this enemy
uint32_t charm_spell = 0; // cast this creature spell now (Taunt, Shield Wall)
+3 -2
View File
@@ -8,7 +8,7 @@
// - Poisonous Blood 24321 (90 s, 100 nature every 3 s on the carrier) comes from a Son of Hakkar (11357) as it dies: its death spell 24320
// (smart_scripts "VMaNGOS EventAI 1135701") is a script effect on every enemy within 8 y of it (spell_zulgurub_poisonous_blood casts
// 24321 on each). There is no cloud on the ground: the raid has to stand next to the Son when it dies.
// So 20-25 s before each siphon the DPS kill one Son, and once it is low everybody gathers on it. 90 s of poison covers the siphon.
// So 45 s before each siphon the DPS kill one Son, and once it is low everybody gathers on it. 90 s of poison covers the siphon.
#pragma once
@@ -25,7 +25,8 @@ constexpr uint32_t kPoisonousBlood = 24321; // the aura that turns the sip
constexpr uint32_t kCorruptedBlood = 24328; // spreads within 10 y: a carrier does not join the crowd on the Son
constexpr uint32_t kSiphonFirstMs = 90000;
constexpr uint32_t kSiphonPeriodMs = 90000;
constexpr uint32_t kSiphonLeadMs = 25000; // a Son is killed from this long before the siphon is due
constexpr uint32_t kSiphonLeadMs = 45000; // a Son is pulled and killed from this long before the siphon is due (25 s was too short:
// sweep-zg-1109w, the Son was still at 100% 7 s before the siphon)
constexpr uint32_t kSiphonKillStopMs = 3000; // ... up to this close to it
constexpr float kSonDeathReach = 8.0f; // Poisonous Blood reaches this far from the dying Son (SpellRadius 14)
constexpr float kGatherYards = 4.0f; // a bot gathering on the Son stands this close to it
@@ -1081,7 +1081,9 @@ bool LooseMobEscape(BotAI& ai, BotSnapshotView const& s, GroupSnapshotView const
const float mdx = mob->x - bx, mdy = mob->y - by, mdz = mob->z - bz;
const float mob_d2 = mdx * mdx + mdy * mdy + mdz * mdz;
if (!s.is_casting())
// A bot the raid brain told to keep the mob (the Son of Hakkar puller) drops no threat: it only walks the mob to its tank.
bool const keep_aggro = s.raw().raid_order.active && s.raw().raid_order.keep_aggro;
if (!s.is_casting() && !keep_aggro)
{
uint32 drop = 0;
bool on_target = false;
+4 -4
View File
@@ -490,15 +490,15 @@ TEST_CASE("Hakkar: the raid kills a Son and gathers on it before each Blood Siph
// The first siphon 90 s after the pull, then 90 s after the last one seen.
CHECK(SiphonDueMs(0) == 90000u);
CHECK(SiphonDueMs(93000) == 183000u);
// A Son dies from 25 s before it to 3 s before it, while fewer than half of the raid carry the poison.
CHECK_FALSE(KillWindow(64000, 0, 0, 20));
CHECK(KillWindow(65000, 0, 0, 20));
// A Son dies from 45 s before it to 3 s before it, while fewer than half of the raid carry the poison.
CHECK_FALSE(KillWindow(44000, 0, 0, 20));
CHECK(KillWindow(45000, 0, 0, 20));
CHECK(KillWindow(86000, 0, 9, 20));
CHECK_FALSE(KillWindow(87000, 0, 0, 20));
CHECK_FALSE(KillWindow(70000, 0, 10, 20));
CHECK_FALSE(KillWindow(120000, 93000, 0, 20));
CHECK(KillWindow(160000, 93000, 0, 20));
// Poisonous Blood lasts 90 s: a Son killed 25 s before still covers the siphon.
// Poisonous Blood lasts 90 s: a Son killed 45 s before still covers the siphon.
CHECK(kSiphonLeadMs < 90000u);
// The gather: low enough Son, not poisoned, not excluded, in reach, not already on it (the death reaches 8 y).
CHECK(Gathers(false, false, 50.f, 20.f));