Jump to content

AOE Heal spell condition


Lord

Recommended Posts

Hey mates ! 

I'am trying to do a Healing Holy priest fightclass. 
I can't find the way to put condition for healing AOEs

I'am not good in LUA or C#, so if anyone can help :)

For example, this fightclass is kinda rocking, but i can't tweak it beceause i don't knw shit in programming .. If anyone can improve it for me, i'am ready to pay the price. Or better if someone could learn me how to tweaj kind of fightclass .. ( i'am ready to give some money too :D for a little of your time & your knowledge :D )
 

Thanks

 

Link to comment
Share on other sites

The xml does not support to check several players health at the same time.

But you could add a c# code to check players health near the tank/target :) and if that is below x it could cast an aoe spell

 

Is this what you are looking for?

 

Link to comment
Share on other sites

For example; i'am trying to add the spell Light of T'uure to the fightclass.

In first part i have that 

Spoiler

        // Spells:

        private Spell _bodyandmind;
        private Spell _heal;
        private Spell _flasheal;
        private Spell _serenity;
        private Spell _resurrection;
        private Spell _massresurrection;
        private Spell _prayerofhealing;
        private Spell _purify;
        private Spell _prayerofmending;
        private Spell _renew;
        private Spell _sanctify;
        private Spell _DivineHymn;
        private Spell _Halo;
        private Spell _GuardianSpirit;
        private Spell _HolyFire;
        private Spell _Smite;
        private Spell _Chastise;
        private Spell _CircleofHealing;
        private Spell _Light of T'uure;

        public PriestHoly()
        {
            _bodyandmind = new Spell("Body and Mind");
            _serenity = new Spell("Holy Word: Serenity");
            _heal = new Spell("Heal");
            _flasheal = new Spell("Flash Heal");
            _resurrection = new Spell("Resurrection");
            _massresurrection = new Spell("Mass Resurrection");
            _prayerofhealing = new Spell("Prayer of Healing");
            _purify = new Spell("Purify");
            _prayerofmending = new Spell("Prayer of Mending");
            _sanctify = new Spell("Holy Word: Sanctify");
            _renew = new Spell("Renew");
            _DivineHymn = new Spell("Divine Hymn");
            _Halo = new Spell("Halo");
            _GuardianSpirit = new Spell("Guardian Spirit");
            _CircleofHealing = new Spell("Circle of Healing");
            _Light of T'uure = new Spell("Light of T'uure");
 

Then : 

Spoiler

{
            if (!Conditions.InGameAndConnectedAndAlive || ObjectManager.Me.IsMounted || ObjectManager.Me.IsStunned || ObjectManager.Me.Silenced)
            {
                return;
            }

            if (!ObjectManager.Me.InCombat && !ObjectManager.Me.IsMounted )
            {
                BodyAndMind();
                Resurrection();
                PrayerofHealing();
                FlashHeal();
                Renew();
                Purify();
                CircleofHealing();
                FollowTank();
                return;
            }
            // if (!Conditions.InGameAndConnectedAndAlive || ObjectManager.Me.IsMounted || !ObjectManager.Me.InCombat) // || !ObjectManager.Me.InCombat return;

            if (GuardianSpirit()) return;
            if (DivineHymn()) return;
            if (Sanctify()) return;
            if (Halo()) return;
            if (Serenity()) return;
            if (CircleofHealing()) return;
            if (Light of Tuure()) return;

            if (PrayerofHealing()) return;
            if (PrayerofMending()) return;

            if (FlashHeal()) return;
            if (Renew()) return;
            if (Heal()) return;
            if (Purify()) return;
            if (BodyAndMind()) return;

            if (FollowTank()) return;

            if (Chastise()) return;
            if (HolyFire()) return;
            if (Smite()) return;
        }
        #endregion

And finally the spell himself : 

Spoiler

  #region Light of T'uure
        bool Light of T'uure()
        {
            if (!_Light of T'uure.KnownSpell) return false;
            if (!_Light of T'uure.IsSpellUsable) return false;
            if (PriestHolySettings.CurrentSetting.PercentLightofTuureHealth == null) return false;
            int HandsHealth = PriestHolySettings.CurrentSetting.PercentLightofTuureHealth;
            if (HandsHealth == 0) return false;

            var members = getPartymembers().Where(o => o.IsValid
                && o.IsAlive
                && o.HealthPercent <= HandsHealth
                && !TraceLine.TraceLineGo(o.Position)).OrderBy(o => o.HealthPercent);
            if (members.Count() > 0)
            {
                var u = members.First();
                WoWPlayer healTarget = new WoWPlayer(u.GetBaseAddress);
                if (healTarget.IsAlive || healTarget.HealthPercent > 0)
                {
                    while (TraceLine.TraceLineGo(healTarget.Position))
                    Interact.InteractGameObject(healTarget.GetBaseAddress, false);
                    _Light of T'uure.Launch();
                    return true;
                }

            }
            return false;
        }
        #endregion

( in last part i have a part with the option of the spell, but pretty sure the mistake isnt coming from here )

 

The obvious point i see is because of the ' that i missplaced. When i use something like sublime text ( that i use like a noob ), i see that the color of the line changing after the ' of Light of T'uure. But i need somewhere to put it no ? because its the spell name ingame, how the fightclass will find it if i can't put it 

Link to comment
Share on other sites

Its an artifact talent and thats why you are not able to select it as spell, i could be wrong tho :D perhaps you could do with Lua

 

Edit: Try with ID instead of name _Light of T'uure = new Spell(208065);

Link to comment
Share on other sites

Thanks for your answer :)

I tried to edit my fightclass, but still having a compilation error 

 

Is the error coming from the spell list, or should i look further in the spell conditions ? :(
 

        // Spells:

        private Spell _bodyandmind;
        private Spell _heal;
        private Spell _flasheal;
        private Spell _serenity;
        private Spell _resurrection;
        private Spell _massresurrection;
        private Spell _prayerofhealing;
        private Spell _purify;
        private Spell _prayerofmending;
        private Spell _renew;
        private Spell _sanctify;
        private Spell _DivineHymn;
        private Spell _Halo;
        private Spell _GuardianSpirit;
        private Spell _HolyFire;
        private Spell _Smite;
        private Spell _Chastise;
        private Spell _CircleofHealing;
        private Spell _LightofTuure;

        public PriestHoly()
        {
            _bodyandmind = new Spell("Body and Mind");
            _serenity = new Spell("Holy Word: Serenity");
            _heal = new Spell("Heal");
            _flasheal = new Spell("Flash Heal");
            _resurrection = new Spell("Resurrection");
            _massresurrection = new Spell("Mass Resurrection");
            _prayerofhealing = new Spell("Prayer of Healing");
            _purify = new Spell("Purify");
            _prayerofmending = new Spell("Prayer of Mending");
            _sanctify = new Spell("Holy Word: Sanctify");
            _renew = new Spell("Renew");
            _DivineHymn = new Spell("Divine Hymn");
            _Halo = new Spell("Halo");
            _GuardianSpirit = new Spell("Guardian Spirit");
            _CircleofHealing = new Spell("Circle of Healing");
            _Light of Tuure = new Spell("208065");

            _HolyFire = new Spell("Holy Fire");
            _Smite = new Spell("Smite");
            _Chastise = new Spell("Holy Word: Chastise");

 

Link to comment
Share on other sites

1 hour ago, Lord said:

I post the all fightclass, so you can have an idea of the mess i'am doing in it x) (its based on a fightclass from a member wich i'am trying to updated)

Lord Priest Heal V0.cs

Spell(ID) not Spell("ID")
You need to read the type the constructor of the class wants.

And spaces are not allowed in variable names
 

_lightOfTuure = new Spell("Light of T'uure");
OR
_lightOfTuure = new Spell(208065);

Btw please don't mix the variable style ;) if you start with _justStartWithASmallLetter; 
Link to comment
Share on other sites

Quote
  1 hour ago, Lord said:

I post the all fightclass, so you can have an idea of the mess i'am doing in it x) (its based on a fightclass from a member wich i'am trying to updated)

Lord Priest Heal V0.cs

Spell(ID) not Spell("ID")
You need to read the type the constructor of the class wants.

And spaces are not allowed in variable names
 


_lightOfTuure = new Spell("Light of T'uure");
OR
_lightOfTuure = new Spell(208065);

Btw please don't mix the variable style ;) if you start with _justStartWithASmallLetter; 

I tried both, but i always got a compilation error .. Even if i just add the _lightOfTuure = new Spell("Light of T'uure");  or _lightOfTuure = new Spell(208065); in the spell list, without any configuration

(The compilation error is pointing a line wich i didnt even modify to add the spell .. x) & ofc the fightclass work when i get off the line i just added )

Painful ...( but that make it more interesting :D )

Link to comment
Share on other sites

3 hours ago, Lord said:

I tried both, but i always got a compilation error .. Even if i just add the _lightOfTuure = new Spell("Light of T'uure");  or _lightOfTuure = new Spell(208065); in the spell list, without any configuration

(The compilation error is pointing a line wich i didnt even modify to add the spell .. x) & ofc the fightclass work when i get off the line i just added )

Painful ...( but that make it more interesting :D )

Could you post the exception error, please?

Edit:
Line 193 if (Light of Tuure()) return;
Line 589 _Light of Tuure.Launch();

Think about it ;) i could give you the answer but i think its better you really take a look at it to learn it :)
A hint: "The compilation error is pointing a line wich i didnt even modify to add the spell"

Link to comment
Share on other sites

The code don't support space, am i right ? :D 
So i did modify them to (Lightoftuure()) return; & _Lightoftuure.launch();

 

& here is the error i'am having

 

Thanks !

 ( the error say in english : the result of the expression is always false, because a value of the type XXX is never equal  to blablabla) & the ligne it shows are line from the creator of the fightclass, not mine :(error C.png

Link to comment
Share on other sites

I'am using you'r knowledge for another thing if i can .. :ph34r: 

The fightclass look to autoselect a character of the party when not in fight. I can't fine any line asking to do it .. and i'am pretty sure its coming from the FIghtclass because its always doing that, even in Wrotation, not in combat, & with settings "start when fight start" 

 

This fightclass will get me mad & go back to private. xD

Link to comment
Share on other sites

 Found cs file you posted, tomorrow il try to correct it and send to you to test
More info:

http://stackoverflow.com/questions/17550084/what-does-it-mean-when-it-says-int-is-never-equal-to-null-of-type-int

Edit: For HandsHealth you are missing       

//Line 1184 
public class PriestHolySettings : Settings
{   
  //Add this to existing list in settings
  [Setting, DefaultValue(0)]
  [Category("Artifact Healing Spells")]
  [DisplayName("Light Of Tuure HP%")]
  [Description("Cast Light of Tuure when HP% <= Value")]
  public int PercentLightOfTuure { get; set; }
  
//Line 575
if (PriestHolySettings.CurrentSetting.PercentLightOfTuure == null) return false;
int HandsHealth = PriestHolySettings.CurrentSetting.PercentLightOfTuure;
if (HandsHealth == 0) return false;

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...