I discovered this while doing the quest Storming the Beaches (25177). The Foaming Sea Elementals are ranged-only mobs. If I happened to aggro two at once, after killing the first, the bot just stood there and took a beating (until I manually moved it into range). Here's what the log looked like:
The first elemental dies at 3:12:41 PM:117. You can see that immediately after that, it starts trying to cast Victory Rush (34428) repeatedly. It finally casts Rend at 3:12:58 PM:059 when I manually moved into range. There were absolutely no LOS or terrain bug issues as it was only 10yd to the target over very open ground. I then saw this two more times on this quest and once on another. This prompted me to look for a solution.
Why It Wasn't Working:
I think the issue is in CreateApproachToCast(). It performs the following checks
I suspect that SpellManager.Spells["Victory Rush"].MaxRange does not return what we think it ought to.
Fix:
I was able to fix this by changing the order of spells in Warrior/Lowbie.cs. The previous order was:
I switched Rend and Victory Rush like so:
This makes slightly more sense to me anyway because if you cast Victory Rush immediately after a charge, most of the time the heal will go to waste. Range-checking for Rend works just fine, so casting it first get's you into melee range.
Code:
[3:12:28 PM:731] Activity: Setting Foaming Sea Elemental at 30 yards as your target
[3:12:29 PM:074] Changed POI to:Type: Kill, Name: Foaming Sea Elemental
[3:12:29 PM:295] Activity: Pulling
[3:12:30 PM:140] [Singular] Casting Charge on Foaming Sea Elemental
[3:12:30 PM:140] Spell_C::CastSpell(100, 0, 0xF13099680005AF60, 0) [134]
[3:12:30 PM:541] Spell_C::CastSpell(100, 0, 0xF13099680005AF60, 0) [135]
[3:12:31 PM:259] [Singular] Casting Rend on Foaming Sea Elemental
[3:12:31 PM:259] Spell_C::CastSpell(772, 0, 0xF13099680005AF60, 0) [136]
[3:12:31 PM:581] Activity: Combat
[3:12:35 PM:020] [Singular] Casting Strike on Foaming Sea Elemental
[3:12:35 PM:020] Spell_C::CastSpell(88161, 0, 0xF13099680005AF60, 0) [137]
[3:12:38 PM:572] Spell_C::CastSpell(88161, 0, 0xF13099680005AF60, 0) [138]
[3:12:40 PM:545] [Singular] Casting Rend on Foaming Sea Elemental
[3:12:40 PM:546] Spell_C::CastSpell(772, 0, 0xF13099680005AF60, 0) [139]
[3:12:40 PM:904] Spell_C::CastSpell(772, 0, 0xF13099680005AF60, 0) [140]
[3:12:41 PM:117] Cleared POI - Reason POI is dead from Combat
[3:12:41 PM:117] Cleared POI
[3:12:41 PM:268] [Singular] Target is invalid. Switching to Foaming Sea Elemental!
[3:12:41 PM:967] [Singular] Casting Victory Rush on Foaming Sea Elemental
[3:12:41 PM:967] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [141]
[3:12:42 PM:289] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [142]
[3:12:42 PM:614] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [143]
[3:12:42 PM:903] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [144]
[3:12:43 PM:227] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [145]
[3:12:43 PM:550] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [146]
[3:12:43 PM:837] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [147]
[3:12:44 PM:163] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [148]
[3:12:44 PM:485] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [149]
[3:12:44 PM:747] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [150]
[3:12:45 PM:001] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [151]
[3:12:45 PM:261] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [152]
[3:12:45 PM:583] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [153]
[3:12:45 PM:936] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [154]
[3:12:46 PM:259] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [155]
[3:12:46 PM:613] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [156]
[3:12:46 PM:934] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [157]
[3:12:47 PM:290] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [158]
[3:12:47 PM:644] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [159]
[3:12:47 PM:964] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [160]
[3:12:48 PM:318] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [161]
[3:12:48 PM:669] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [162]
[3:12:49 PM:022] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [163]
[3:12:49 PM:343] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [164]
[3:12:49 PM:665] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [165]
[3:12:50 PM:027] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [166]
[3:12:50 PM:349] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [167]
[3:12:50 PM:704] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [168]
[3:12:51 PM:041] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [169]
[3:12:51 PM:379] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [170]
[3:12:51 PM:742] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [171]
[3:12:52 PM:071] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [172]
[3:12:52 PM:403] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [173]
[3:12:52 PM:765] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [174]
[3:12:53 PM:126] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [175]
[3:12:53 PM:457] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [176]
[3:12:53 PM:756] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [177]
[3:12:54 PM:058] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [178]
[3:12:54 PM:249] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [179]
[3:12:54 PM:567] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [180]
[3:12:54 PM:829] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [181]
[3:12:55 PM:079] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [182]
[3:12:55 PM:336] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [183]
[3:12:55 PM:555] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [184]
[3:12:55 PM:797] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [185]
[3:12:56 PM:030] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [186]
[3:12:56 PM:297] Spell_C::CastSpell(34428, 0, 0xF13099680005B02A, 0) [187]
[3:12:58 PM:059] [Singular] Casting Rend on Foaming Sea Elemental
[3:12:58 PM:059] Spell_C::CastSpell(772, 0, 0xF13099680005B02A, 0) [188]
The first elemental dies at 3:12:41 PM:117. You can see that immediately after that, it starts trying to cast Victory Rush (34428) repeatedly. It finally casts Rend at 3:12:58 PM:059 when I manually moved into range. There were absolutely no LOS or terrain bug issues as it was only 10yd to the target over very open ground. I then saw this two more times on this quest and once on another. This prompted me to look for a solution.
Why It Wasn't Working:
I think the issue is in CreateApproachToCast(). It performs the following checks
Code:
ret => !SingularSettings.Instance.DisableAllMovement
&& SpellManager.Spells[spellName].MaxRange != 0
&& (unitSelector(ret).Distance > SpellManager.Spells[spellName].MaxRange - 2f
|| !unitSelector(ret).InLineOfSightOCD)
Fix:
I was able to fix this by changing the order of spells in Warrior/Lowbie.cs. The previous order was:
Code:
CreateEnsureTarget(),
CreateFaceUnit(),
CreateAutoAttack(true),
CreateSpellCast("Charge"),
CreateSpellCast("Victory Rush"),
CreateSpellCast("Rend", ret => !Me.CurrentTarget.HasAura("Rend")),
CreateSpellCast("Strike"),
CreateSpellCast("Thunder Clap"),
CreateMoveToAndFace(4f, ret => Me.CurrentTarget)
I switched Rend and Victory Rush like so:
Code:
CreateEnsureTarget(),
CreateFaceUnit(),
CreateAutoAttack(true),
CreateSpellCast("Charge"),
CreateSpellCast("Rend", ret => !Me.CurrentTarget.HasAura("Rend")),
CreateSpellCast("Victory Rush"),
CreateSpellCast("Strike"),
CreateSpellCast("Thunder Clap"),
CreateMoveToAndFace(4f, ret => Me.CurrentTarget)
This makes slightly more sense to me anyway because if you cast Victory Rush immediately after a charge, most of the time the heal will go to waste. Range-checking for Rend works just fine, so casting it first get's you into melee range.