Ok Guys,
So before we get going into this I just want to remind you all that I am not a coder, this method was found from logical trial and error, and i also had to edit my class routine (Sorcerer) and that's the only class i tested this on.
I am putting as much info into this thread as i can as to help the devs get a better understanding of what i did so maybe they can come up with a permanent fix.
This method does not "Fix" healing. All it does is makes the bot heal your target (will kind of include AOE) regardless of health. So it will just cast your healing rotation, at whatever priority is set first for your class routine.
Please also note that i have not got every part of the healing routine included yet but I am finding little things to fix daily which improve's the combat routine support. (for example i don't have cleanse working yet as i've not had chance to look into it but it's on my todo list)
I have included MY "up to date" spell.cs which you are free to download and edit to suit you.
I will happily answer any questions and help anyone who needs help setting their CR up but please remember that this isn't my area of expertise and all i have done is logically move things and change a few things to match what is already there
DOWNLOAD:
File: Spell.Txt
Replace all text in "%Buddywing%\Routines\DefaultCombat\Core\Spell.cs" with this file.
UPDATE 4 *** 20/04/17 ***
-1. Fixed - Seer.cs - Wasn't casting "Force Armor" due to wrong debuff set as variable. Fixed
UPDATE 3 *** 19/04/17 ***
-1. Added - Seer.cs - This is as close as i could get it to my Corruption routine at the minute as i don't have a Seer. Levelling one to test at the minute.
UPDATE 2 *** 19/04/17 ***
-1. Fixed a few little things in Spell.cs that were causing issues.
-2. Included my Sorcerer.cs - This heals your target, keeps a bubble on self while in combat, uses "Consuming Darkness" whenever "Force Surge" buff is up to keep mana uptime to max. Deals single target and AOE rotation to enemy targets.
feel free to request any changes and i will reply as soon as i can.
UPDATE 1 *** 18/04/17 ***
-1. Fixed - Bot should now not cast heals when targeting enemies (only heals when targeting friendly targets). This allows for "combat/non heal" spells to be cast on enemies and it removes healing attack rotation (for damage dealing / solo missions)
So before we get going into this I just want to remind you all that I am not a coder, this method was found from logical trial and error, and i also had to edit my class routine (Sorcerer) and that's the only class i tested this on.
I am putting as much info into this thread as i can as to help the devs get a better understanding of what i did so maybe they can come up with a permanent fix.
This method does not "Fix" healing. All it does is makes the bot heal your target (will kind of include AOE) regardless of health. So it will just cast your healing rotation, at whatever priority is set first for your class routine.
Please also note that i have not got every part of the healing routine included yet but I am finding little things to fix daily which improve's the combat routine support. (for example i don't have cleanse working yet as i've not had chance to look into it but it's on my todo list)
So firstly, i started off gathering a "basic" understanding of how default combat works. As i know nothing about c# i just went with what looked logical and then fixing any grammatical coding mistakes after.
I was looking around in the CORE Default Combat files and noticed that in Spell.cs the routine casts a heal differently as to casting a normal spell on an enemy target. When a spell is cast on an enemy target it basically uses this line of code for the casting:
But when a heal is cast it uses THIS code:
As you can see, the top one (spell cast) uses 'ret => Me.CurrentTarget' whereas the bottom one (heal cast) uses 'onUnit => Targeting.HealTarget' for the targeting.
I then edited the healing one to look more like the spell cast one and got this:
I then went through all the other parts of the 'Heal region' and edited them similar to the cast ones.
After this (and a about 30 mins of fixing a couple of other mistakes i had made) i was able to get "some" of my routine casting non stop on whatever target i selected.
I then went into my advance class routine (Corruption.cs for Sorcerer in my case) and made some adjustments to get things working in the right order etc, but this was mainly for my benefit.
I also notices that AOE casting wasn't working right in Madness spec for me (no AOE ever) and i fixed this by changing:
to this:
you'll notice all i did here was replace 'ctx' with 'ret' and that seemed to work, although i must admit i don't know the difference between those commands.
I was looking around in the CORE Default Combat files and noticed that in Spell.cs the routine casts a heal differently as to casting a normal spell on an enemy target. When a spell is cast on an enemy target it basically uses this line of code for the casting:
Code:
public static Composite Cast(string spell, Selection<bool> reqs = null)
{
return Cast(spell, ret => Me.CurrentTarget, reqs);
}
public static Composite Cast(string spell, UnitSelectionDelegate onUnit, Selection<bool> reqs = null)
{
return
new Decorator(
ret =>
onUnit != null && onUnit(ret) != null && (reqs == null || reqs(ret)) &&
AbilityManager.CanCast(spell, onUnit(ret)),
new PrioritySelector(
new Action(delegate
{
//added current target health percent check
Logger.Write(">> Casting << " + spell);
return RunStatus.Failure;
}),
new Action(ret => AbilityManager.Cast(spell, onUnit(ret))))
);
}
But when a heal is cast it uses THIS code:
Code:
public static Composite Heal(string spell, int hp = 100, Selection<bool> reqs = null)
{
return Heal(spell, onUnit => Targeting.HealTarget, hp, reqs);
}
public static Composite Heal(string spell, UnitSelectionDelegate onUnit, int hp = 100, Selection<bool> reqs = null)
{
return new Decorator(
ret =>
onUnit != null && onUnit(ret) != null && (reqs == null || reqs(ret)) && onUnit(ret).HealthPercent <= hp &&
Target(onUnit(ret)),
Cast(spell, onUnit, reqs));
}
As you can see, the top one (spell cast) uses 'ret => Me.CurrentTarget' whereas the bottom one (heal cast) uses 'onUnit => Targeting.HealTarget' for the targeting.
I then edited the healing one to look more like the spell cast one and got this:
Code:
public static Composite Heal(string spell, int hp = 100, Selection<bool> reqs = null)
{
return Cast(spell, ret => Me.CurrentTarget, reqs);
}
public static Composite Heal(string spell, UnitSelectionDelegate onUnit, int hp = 100, Selection<bool> reqs = null)
{
return new Decorator(
ret =>
onUnit != null && onUnit(ret) != null && (reqs == null || reqs(ret)) && onUnit(ret).HealthPercent <= hp &&
Target(onUnit(ret)),
Cast(spell, onUnit, reqs));
}
I then went through all the other parts of the 'Heal region' and edited them similar to the cast ones.
After this (and a about 30 mins of fixing a couple of other mistakes i had made) i was able to get "some" of my routine casting non stop on whatever target i selected.
I then went into my advance class routine (Corruption.cs for Sorcerer in my case) and made some adjustments to get things working in the right order etc, but this was mainly for my benefit.
I also notices that AOE casting wasn't working right in Madness spec for me (no AOE ever) and i fixed this by changing:
Code:
public static Composite CastOnGround(string spell, Selection<bool> reqs = null)
{
return
new Decorator(
ret =>
(reqs == null || reqs(ret)) && Me.CurrentTarget != null,
CastOnGround(spell, ctx => Me.CurrentTarget.Position, ctx => true));
}
to this:
Code:
public static Composite CastOnGround(string spell, Selection<bool> reqs = null)
{
return
new Decorator(
ret =>
(reqs == null || reqs(ret)) && Me.CurrentTarget != null,
CastOnGround(spell, ret => Me.CurrentTarget.Position, ret => true));
}
you'll notice all i did here was replace 'ctx' with 'ret' and that seemed to work, although i must admit i don't know the difference between those commands.
I have included MY "up to date" spell.cs which you are free to download and edit to suit you.
I will happily answer any questions and help anyone who needs help setting their CR up but please remember that this isn't my area of expertise and all i have done is logically move things and change a few things to match what is already there

DOWNLOAD:
File: Spell.Txt
Replace all text in "%Buddywing%\Routines\DefaultCombat\Core\Spell.cs" with this file.
UPDATE 4 *** 20/04/17 ***
-1. Fixed - Seer.cs - Wasn't casting "Force Armor" due to wrong debuff set as variable. Fixed
UPDATE 3 *** 19/04/17 ***
-1. Added - Seer.cs - This is as close as i could get it to my Corruption routine at the minute as i don't have a Seer. Levelling one to test at the minute.
UPDATE 2 *** 19/04/17 ***
-1. Fixed a few little things in Spell.cs that were causing issues.
-2. Included my Sorcerer.cs - This heals your target, keeps a bubble on self while in combat, uses "Consuming Darkness" whenever "Force Surge" buff is up to keep mana uptime to max. Deals single target and AOE rotation to enemy targets.
feel free to request any changes and i will reply as soon as i can.
UPDATE 1 *** 18/04/17 ***
-1. Fixed - Bot should now not cast heals when targeting enemies (only heals when targeting friendly targets). This allows for "combat/non heal" spells to be cast on enemies and it removes healing attack rotation (for damage dealing / solo missions)
Attachments
Last edited: