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

StyxWoW.Me.HasAura false positive.

j0achim

New Member
Joined
Jan 15, 2010
Messages
532
Reaction score
15
Hi, im working on a CC but i have gotten stuck on two things, however over to the question at hand.


StyxWoW.Me.HasAura("Surge of Light") returns a false positive.

PHP:
 Spell.Heal("Flash Heal", ret => (WoWUnit)ret, ret => StyxWoW.Me.HasAura("Surge of Light") && ((WoWUnit)ret).HealthPercent <= 85),

As soon as WoWUnit goes below 85% it thinks this code is valid even tho i don't have the aura "Surge of Light", anyone have any suggestions?


My other problem is casting "Holy Word: Serenity", if i get the spell by id it works however since i am writing it in singular i cant add it by id when using Spell.Heal as it only works with string variables.

PHP:
 Spell.Heal("Holy Word: Serenity", ret => (WoWUnit)ret, ret => ((WoWUnit)ret).HealthPercent <= 64),


All input is very much appreciated :)
 
Was able to fix aura check by using:

PHP:
StyxWoW.Me.ActiveAuras.ContainsKey("Surge of Light")
 
Was able to fix aura check by using:

PHP:
StyxWoW.Me.ActiveAuras.ContainsKey("Surge of Light")

This will always work.
The problem with StyxWoWAura is the following: It takes also your talents into account. If you put a point into "Surge of Light" it will always return true.
I would always prefer ActiveAuras.ContainsKey as you discovered, because there are only "active" buffs observed. :-)


Your other problem...:
I guess you have to improve a little bit. :/
Code:
                        new Decorator(
                            ret =>
                            (<code><code>[COLOR=#000000][COLOR=#007700]TARGET[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]HealthPercent [/COLOR][COLOR=#007700]<= [/COLOR][COLOR=#0000BB]64[/COLOR][COLOR=#007700][/COLOR][/COLOR]</code></code>),
                            new Sequence(
                                new Action(ret => LegacySpellManager.CastSpellById(SPELLID, TARGET)
                                    )
                                )
                            ),
 
Thanks for the quick reply!

Does legacy spell manager have any sanity check if its possible to cast it?
 
PHP:
Styx.Logic.Combat.LegacySpellManager.CanCastSpell(uint)

Wont behave the way it should, it returns that the spell is ready to be cast even tho its not.


Made a StopWatch that way it can only try cast it once every 7 seconds+ gcd. however its ugly and performs really bad.
 
Thanks handnavi, as you mention on irc !SpellManager.Spells["Your Spellname"].Cooldown, instead i check spell by id then the cooldown gave me the result i was after.

Code:
                        new Decorator(
                            ret =>
                            (((WoWUnit)ret).HealthPercent <= 75 && !WoWSpell.FromId(88684).Cooldown),
                            new Sequence(
                                new Action(ret =>
                                    {
                                        Logger.Write("Casting Holy Word: Serenity on " + ((WoWUnit)ret).SafeName());
                                        SpellManager.Cast(WoWSpell.FromId(88684), (WoWUnit)ret);
                                    }
                                    )
                                )
                            ),

I probably should add check if i have the spell.
 
Last edited:
Thanks and i wont.

I got rid of any Legace spellmanager code when i got the above example working :)
 
This will always work.
The problem with StyxWoWAura is the following: It takes also your talents into account. If you put a point into "Surge of Light" it will always return true.
I would always prefer ActiveAuras.ContainsKey as you discovered, because there are only "active" buffs observed. :-)


Your other problem...:
I guess you have to improve a little bit. :/
Code:
                        new Decorator(
                            ret =>
                            (<code><code>[COLOR=#000000][COLOR=#007700]TARGET[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]HealthPercent [/COLOR][COLOR=#007700]<= [/COLOR][COLOR=#0000BB]64[/COLOR][/COLOR]</code></code>),
                            new Sequence(
                                new Action(ret => LegacySpellManager.CastSpellById(SPELLID, TARGET)
                                    )
                                )
                            ),

This explains why the test code was working for me in the other thread then!

you NEVER want to use the legacy spellmanager.

Without wishing to hi-jack the thread to much, can I quickly ask as to why. I remember when doing my Hunter CC a long time ago it had some handy stuff for throwing traps, or is this in the main spellmanager now?
 
Instead use this with the pesky spells that just wont go off normally with:

PHP:
SpellManager.Cast(WoWSpell.FromId(ID_OF_SPELL_HERE), WoWUnit);
 
Back
Top