What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal
RebornBuddy Forums

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Fixing Healing

alltrueist

Active Member
Joined
Dec 10, 2012
Messages
1,424
We need to fix healing. Here's some code I butchered from my Discipline Priest routine from WoW, adapted to Buddywing the best I could:

PHP:
        #region TestStuff
        public static IEnumerable<TorPlayer> PartyMembers { get { return getPartyMembers(); } }
        public static IEnumerable<TorPlayer> Tanks { get { return getTanks(); } }

        public static IEnumerable<TorPlayer> getPartyMembers()
        {
            var t = ObjectManager.GetObjects<TorPlayer>().Where(p => p.IsFriendly).ToList();
                return t;
        }
        public static IEnumerable<TorPlayer> getTanks()
        {
            var t = ObjectManager.GetObjects<TorPlayer>().Where(p => p != null && (p.Discipline == CharacterDiscipline.Defense
                                                                                    || p.Discipline == CharacterDiscipline.Darkness
                                                                                    || p.Discipline == CharacterDiscipline.Immortal
                                                                                    || p.Discipline == CharacterDiscipline.KeneticCombat
                                                                                    || p.Discipline == CharacterDiscipline.ShieldSpecialist
                                                                                    || p.Discipline == CharacterDiscipline.ShieldTech)).ToList();
                return t;
        }

        public static TorPlayer experimentalhealTarget
        {
            get
            {
                if (!Me.InCombat) return null;
                var t = PartyMembers.Where(p => p != null
                    && !p.IsDead
                    && p.InLineOfSight
                    && p.HealthPercent <= 80
                    && p.Distance <= 40).OrderBy(p => p.HealthPercent).FirstOrDefault();
                return t != null ? t : null;
            }
        }

        public static TorPlayer experimentalhealTank
        {
            get
            {
                if (!Me.InCombat) return null;
                var t = Tanks.Where(p => p != null
                    && !p.IsDead
                    && p.InLineOfSight
                    && p.HealthPercent <= 95
                    && p.Distance <= 40).OrderBy(p => p.HealthPercent).FirstOrDefault();
                return t != null ? t : null;
            }
        }
        #endregion

Then, in the individual healing file, you'd call it doing something like this (using Seer.cs for example):

PHP:
Spell.Cast("Benevolence", onTarget => Targeting.experimentalhealTarget),

Theoretically, would this work? Could we add companions? I feel like the current way that DefaultCombat calls healing targets is way too complicated, but maybe that's for a reason.

Also, we super need a way to call GroupMembers and RaidMembers. I thought I was crazy because I couldn't find this, but it just isn't there. At the moment, it'll just heal any friendly player in range.
 
Okay so it loads up just fine. I ran solo, and it healed me just fine.

Immediate to-do:
1. Try to test in groups
2. Figure out how to target companion
 
I need to know the difference between
TorPlayer
TorCharacter
TorObject
TorNPC

Which one is OTHER PLAYERS? Which one is MY COMPANION?
 
Default calls companion with me.companion if that helps any. Found it under targeting.cs

public static List<TorCharacter> HealCandidates = new List<TorCharacter>();

looks like TorCharacter would be other players.

and these lines
private static TorPlayer Me
and
if (Me.Companion != null)

makes it look like comp is TorPlayer.Companion

Hope this helps
 
Last edited:
Default calls companion with me.companion if that helps any. Found it under targeting.cs

public static List<TorCharacter> HealCandidates = new List<TorCharacter>();

looks like TorCharacter would be other players.

and these lines
private static TorPlayer Me
and
if (Me.Companion != null)

makes it look like comp is TorPlayer.Companion

Hope this helps

Actually I figured it out, and also figured out why healing wasn't working before.

The companion is a TorNpc! That's why Default would never target him/her
 
Here is the updated Healing Fix. Put this in your Targeting.cs file in DefaultCombat. I've tested it solo but not yet in groups, and it works perfectly-- heals your companion 100% all the time.

PHP:
#region TestStuff
        public static IEnumerable<TorCharacter> PartyMembers { get { return getPartyMembers(); } }
        public static IEnumerable<TorCharacter> Tanks { get { return getTanks(); } }

        public static IEnumerable<TorCharacter> getPartyMembers()
        {
            var t = ObjectManager.GetObjects<TorPlayer>().Where(p => p != null && p.IsTargetable && p.GroupId == Me.GroupId).ToList();
                return t;
        }
        public static IEnumerable<TorCharacter> getTanks()
        {
            if (Me.GroupId == 0 && Me.InCombat)
            {
                return ObjectManager.GetObjects<TorNpc>().Where(p => p != null && p.IsTargetable && p.Guid == Me.Companion.Guid);
            }
            else
            {
                var t = ObjectManager.GetObjects<TorPlayer>().Where(p => p != null && p.GroupId == Me.GroupId && p.IsTargetable && (p.Discipline == CharacterDiscipline.Defense
                                                                                                                      || p.Discipline == CharacterDiscipline.Darkness
                                                                                                                      || p.Discipline == CharacterDiscipline.Immortal
                                                                                                                      || p.Discipline == CharacterDiscipline.KeneticCombat
                                                                                                                      || p.Discipline == CharacterDiscipline.ShieldSpecialist
                                                                                                                      || p.Discipline == CharacterDiscipline.ShieldTech)).ToList();
                return t;
            }
        }

        public static TorCharacter hTarget
        {
            get
            {
                if (!Me.InCombat) return null;
                var t = PartyMembers.Where(p => p != null
                    && !p.IsDead
                    && p.InLineOfSight
                    && p.Distance <= 30).OrderBy(p => p.HealthPercent).FirstOrDefault();
                return t != null ? t : null;
            }
        }

        public static TorCharacter hTank
        {
            get
            {
                if (!Me.InCombat) return null;
                var t = Tanks.Where(p => p != null
                    && !p.IsDead
                    && p.InLineOfSight
                    && p.Distance <= 30).OrderBy(p => p.HealthPercent).FirstOrDefault();
                return t != null ? t : null;
            }
        }
        #endregion

Here is my sample Seer.cs file, with the new fixes for healing implemented. You'll find them in the AoE section:

PHP:
// Copyright (C) 2011-2015 Bossland GmbH
// See the file LICENSE for the source code's detailed license

using Buddy.BehaviorTree;
using DefaultCombat.Core;
using DefaultCombat.Helpers;
using T = DefaultCombat.Core.Targeting;

namespace DefaultCombat.Routines
{
	internal class Seer : RotationBase
	{
		public override string Name
		{
			get { return "Sage Seer"; }
		}

		public override Composite Buffs
		{
			get
			{
				return new PrioritySelector(
					Spell.Buff("Force Valor")
					);
			}
		}

		public override Composite Cooldowns
		{
			get
			{
				return new PrioritySelector(
					Spell.Buff("Force Potency", ret => Targeting.ShouldAoeHeal),
					Spell.Buff("Mental Alacrity", ret => Targeting.ShouldAoeHeal),
					Spell.Buff("Vindicate", ret => NeedForce()),
					Spell.Buff("Force Mend", ret => Me.HealthPercent <= 75)
					);
			}
		}

		public override Composite SingleTarget
		{
			get
			{
				return new PrioritySelector(
					//Movement
					CombatMovement.CloseDistance(Distance.Ranged),
					Spell.Cast("Mind Snap", ret => Me.CurrentTarget.IsCasting && !DefaultCombat.MovementDisabled),
					Spell.Cast("Force Stun", ret => Me.CurrentTarget.IsCasting && !DefaultCombat.MovementDisabled),
					Spell.Cast("Forcequake", ret => Targeting.ShouldAoe),
					Spell.Cast("Mind Crush"),
					Spell.DoT("Weaken Mind", "Weaken Mind"),
					Spell.Cast("Project"),
					Spell.Cast("Telekinetic Throw"),
					Spell.Cast("Disturbance")
					);
			}
		}

		public override Composite AreaOfEffect
		{
			get
			{
				return new PrioritySelector(
					//Cleanse if needed
					Spell.Cleanse("Restoration"),

					//Emergency Heal (Insta-cast)
                    Spell.Cast("Benevolence", onTarget => T.hTarget, ret => T.hTarget.HealthPercent <= 80 && Me.HasBuff("Altruism")),

					//Aoe Heal
					Spell.HealGround("Salvation", ret => Targeting.ShouldAoe),

					//Single Target Healing
                    Spell.Cast("Healing Trance", onTarget => T.hTarget, ret => T.hTarget.HealthPercent <= 80),
                    Spell.Cast("Force Armor", onTarget => T.hTarget, ret => T.hTarget.HealthPercent <= 80 && !T.hTarget.HasDebuff("Force-imbalance") && !T.hTarget.HasBuff("Force Armor")),

					//Buff Tank
                    Spell.Cast("Force Armor", onTarget => T.hTank, ret => !T.hTank.HasDebuff("Force-imbalance") && !T.hTank.HasBuff("Force Armor")),
                    Spell.Cast("Wandering Mend", onTarget => T.hTank, ret => T.hTank.InCombat && Me.BuffCount("Wandering Mend Charges") <= 1),

					//Use Force Bending
					new Decorator(ret => Me.HasBuff("Conveyance"),
						new PrioritySelector(
                            Spell.Cast("Healing Trance", onTarget => T.hTarget, ret => T.hTarget.HealthPercent <= 90),
                            Spell.Cast("Deliverance", onTarget => T.hTarget, ret => T.hTarget.HealthPercent <= 50)
							)),

					//Build Force Bending
                    Spell.Cast("Rejuvenate", onTarget => T.hTank, ret => T.hTank.InCombat && !T.hTank.HasBuff("Rejuvenate")),
                    Spell.Cast("Rejuvenate", onTarget => T.hTarget, ret => T.hTarget.HealthPercent <= 80 && !T.hTarget.HasBuff("Rejuvenate")),

					//Single Target Healing 
                    Spell.Cast("Benevolence", onTarget => T.hTarget, ret => T.hTarget.HealthPercent <= 35),
                    Spell.Cast("Deliverance", onTarget => T.hTarget, ret => T.hTarget.HealthPercent <= 80)
					);
			}
		}

		private bool NeedForce()
		{
			if (Me.ForcePercent <= 20)
				return true;
			if (Me.HasBuff("Resplendence") && Me.ForcePercent < 80 && !Me.HasBuff("Amnesty"))
				return true;
			return false;
		}
	}
}

I ran through a couple of chapters on my Sage and never once had a targeting/healing issue. It appears to work 100% of the time. I haven't tested in groups yet, so I'm interested to see if that works, but so far the targeting works great for solo play. I'm going to tune up the other Republic classes and post here, then you guys can translate them to Empire.
 
Nice man, keep up the good work :)
Now for Party, FP and OPS.

Should work in Party & FP currently. I'm not sure how OPs will handle groups, and since we don't have a way to get Operation members it's potentially spotty.

Go ahead and test it in a group/FP and let me know how it works.
 
Here is the updated Healing Fix. Put this in your Targeting.cs file in DefaultCombat. I've tested it solo but not yet in groups, and it works perfectly-- heals your companion 100% all the time.

PHP:
#region TestStuff
        public static IEnumerable<TorCharacter> PartyMembers { get { return getPartyMembers(); } }
        public static IEnumerable<TorCharacter> Tanks { get { return getTanks(); } }

        public static IEnumerable<TorCharacter> getPartyMembers()
        {
            var t = ObjectManager.GetObjects<TorPlayer>().Where(p => p != null && p.IsTargetable && p.GroupId == Me.GroupId).ToList();
                return t;
        }
        public static IEnumerable<TorCharacter> getTanks()
        {
            if (Me.GroupId == 0 && Me.InCombat)
            {
                return ObjectManager.GetObjects<TorNpc>().Where(p => p != null && p.IsTargetable && p.Guid == Me.Companion.Guid);
            }
            else
            {
                var t = ObjectManager.GetObjects<TorPlayer>().Where(p => p != null && p.GroupId == Me.GroupId && p.IsTargetable && (p.Discipline == CharacterDiscipline.Defense
                                                                                                                      || p.Discipline == CharacterDiscipline.Darkness
                                                                                                                      || p.Discipline == CharacterDiscipline.Immortal
                                                                                                                      || p.Discipline == CharacterDiscipline.KeneticCombat
                                                                                                                      || p.Discipline == CharacterDiscipline.ShieldSpecialist
                                                                                                                      || p.Discipline == CharacterDiscipline.ShieldTech)).ToList();
                return t;
            }
        }

        public static TorCharacter hTarget
        {
            get
            {
                if (!Me.InCombat) return null;
                var t = PartyMembers.Where(p => p != null
                    && !p.IsDead
                    && p.InLineOfSight
                    && p.Distance <= 30).OrderBy(p => p.HealthPercent).FirstOrDefault();
                return t != null ? t : null;
            }
        }

        public static TorCharacter hTank
        {
            get
            {
                if (!Me.InCombat) return null;
                var t = Tanks.Where(p => p != null
                    && !p.IsDead
                    && p.InLineOfSight
                    && p.Distance <= 30).OrderBy(p => p.HealthPercent).FirstOrDefault();
                return t != null ? t : null;
            }
        }
        #endregion

Here is my sample Seer.cs file, with the new fixes for healing implemented. You'll find them in the AoE section:

PHP:
// Copyright (C) 2011-2015 Bossland GmbH
// See the file LICENSE for the source code's detailed license

using Buddy.BehaviorTree;
using DefaultCombat.Core;
using DefaultCombat.Helpers;
using T = DefaultCombat.Core.Targeting;

namespace DefaultCombat.Routines
{
	internal class Seer : RotationBase
	{
		public override string Name
		{
			get { return "Sage Seer"; }
		}

		public override Composite Buffs
		{
			get
			{
				return new PrioritySelector(
					Spell.Buff("Force Valor")
					);
			}
		}

		public override Composite Cooldowns
		{
			get
			{
				return new PrioritySelector(
					Spell.Buff("Force Potency", ret => Targeting.ShouldAoeHeal),
					Spell.Buff("Mental Alacrity", ret => Targeting.ShouldAoeHeal),
					Spell.Buff("Vindicate", ret => NeedForce()),
					Spell.Buff("Force Mend", ret => Me.HealthPercent <= 75)
					);
			}
		}

		public override Composite SingleTarget
		{
			get
			{
				return new PrioritySelector(
					//Movement
					CombatMovement.CloseDistance(Distance.Ranged),
					Spell.Cast("Mind Snap", ret => Me.CurrentTarget.IsCasting && !DefaultCombat.MovementDisabled),
					Spell.Cast("Force Stun", ret => Me.CurrentTarget.IsCasting && !DefaultCombat.MovementDisabled),
					Spell.Cast("Forcequake", ret => Targeting.ShouldAoe),
					Spell.Cast("Mind Crush"),
					Spell.DoT("Weaken Mind", "Weaken Mind"),
					Spell.Cast("Project"),
					Spell.Cast("Telekinetic Throw"),
					Spell.Cast("Disturbance")
					);
			}
		}

		public override Composite AreaOfEffect
		{
			get
			{
				return new PrioritySelector(
					//Cleanse if needed
					Spell.Cleanse("Restoration"),

					//Emergency Heal (Insta-cast)
                    Spell.Cast("Benevolence", onTarget => T.hTarget, ret => T.hTarget.HealthPercent <= 80 && Me.HasBuff("Altruism")),

					//Aoe Heal
					Spell.HealGround("Salvation", ret => Targeting.ShouldAoe),

					//Single Target Healing
                    Spell.Cast("Healing Trance", onTarget => T.hTarget, ret => T.hTarget.HealthPercent <= 80),
                    Spell.Cast("Force Armor", onTarget => T.hTarget, ret => T.hTarget.HealthPercent <= 80 && !T.hTarget.HasDebuff("Force-imbalance") && !T.hTarget.HasBuff("Force Armor")),

					//Buff Tank
                    Spell.Cast("Force Armor", onTarget => T.hTank, ret => !T.hTank.HasDebuff("Force-imbalance") && !T.hTank.HasBuff("Force Armor")),
                    Spell.Cast("Wandering Mend", onTarget => T.hTank, ret => T.hTank.InCombat && Me.BuffCount("Wandering Mend Charges") <= 1),

					//Use Force Bending
					new Decorator(ret => Me.HasBuff("Conveyance"),
						new PrioritySelector(
                            Spell.Cast("Healing Trance", onTarget => T.hTarget, ret => T.hTarget.HealthPercent <= 90),
                            Spell.Cast("Deliverance", onTarget => T.hTarget, ret => T.hTarget.HealthPercent <= 50)
							)),

					//Build Force Bending
                    Spell.Cast("Rejuvenate", onTarget => T.hTank, ret => T.hTank.InCombat && !T.hTank.HasBuff("Rejuvenate")),
                    Spell.Cast("Rejuvenate", onTarget => T.hTarget, ret => T.hTarget.HealthPercent <= 80 && !T.hTarget.HasBuff("Rejuvenate")),

					//Single Target Healing 
                    Spell.Cast("Benevolence", onTarget => T.hTarget, ret => T.hTarget.HealthPercent <= 35),
                    Spell.Cast("Deliverance", onTarget => T.hTarget, ret => T.hTarget.HealthPercent <= 80)
					);
			}
		}

		private bool NeedForce()
		{
			if (Me.ForcePercent <= 20)
				return true;
			if (Me.HasBuff("Resplendence") && Me.ForcePercent < 80 && !Me.HasBuff("Amnesty"))
				return true;
			return false;
		}
	}
}

I ran through a couple of chapters on my Sage and never once had a targeting/healing issue. It appears to work 100% of the time. I haven't tested in groups yet, so I'm interested to see if that works, but so far the targeting works great for solo play. I'm going to tune up the other Republic classes and post here, then you guys can translate them to Empire.



where as we suppose to add it? can you just uload an updated targeting.cs file?
 
where as we suppose to add it? can you just uload an updated targeting.cs file?

I'm going to have to upload the entire routine fix-- I rewrote targeting completely and it had tons of consequences for every other file in the routine. Works really well though, still haven't tested in a FP, I didn't have time this weekend.
 
I'm going to have to upload the entire routine fix-- I rewrote targeting completely and it had tons of consequences for every other file in the routine. Works really well though, still haven't tested in a FP, I didn't have time this weekend.

This is awesome alltrueist !

Can't wait to see healing completely working again .. been so long ... thanks again!
 
are you going to relaunch Pure routine or you just updating the default routine?

It's still Default, I just rewrote the entire Targeting.cs file (and every file that had a dependency on something in the old Targeting, which was almost everything).
 
This is awesome alltrueist !

Can't wait to see healing completely working again .. been so long ... thanks again!

Tell me about it! I hated playing my Sage and Scoundrel as the DPS specs, it's nice to be back to solo healing. I can wait to test stuff out in groups, or I can put it here for you guys to test out for me since I don't have a lot of playtime. I'll probably end up just uploading everything and let you guys be the QA ;)
 
Back
Top