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

CC api debufs question...

dylan127

New Member
Joined
May 20, 2010
Messages
18
Reaction score
0
Hi could someone link the HB api for combat?

I have been raiding with warlocks for a few years and im working on improving the CC's already posted, I would also like to contribute to code rather then just request logic be added by others...

I have a modified warlock CC, few new dots/checks but I'm looking to a:

IF( EXISTS [debuff] )
{
[debuff].(return time remaining)
}

type scenario, I would like to cast based on time and in the case of immolate/UA renew with felfire after shadowbolts as its instant....

(will give credit to original CC authors once I post :) )

Also im was unable to find much on the wiki but do we have a API reference or something I can download for logic development?

Cheers,
Dyl
 
There is no current API reference, try using visual studio, with a bit of thinking/working out, you can get the information you need.
 
PHP:
if (Me.CurrentTarget != null && Me.CurrentTarget.ActiveAuras.Any(x => x.Value.id == 1234 && x.Value.CreatorGuid == Me.Guid && x.Value.TimeLeft.TotalSeconds < 5)) {
WoWSpell.FromId(5678).Cast();
}

1234 = debuff id
 
Thanks guys, will do.

Cheers for that cowdude I will have a play with CC tonight. I think a few of these tests could optimise combat quite a lot :)
 
Hey cowdude firstly thanks for your existing CC, second I need to read this forum more lol you new PriceOfDarness as many changes I previously implemented myself a while ago lol

SO on that note i'm tweaking your 1.31 CC with a few changes although its awesome for the most part already :D

Q: Are the dot checks in your POD CC taking into account yours specifically or just generally checking for dot?

ie //corr
if (Spells.CanCast(Spells.Corruption)
&& !UnitHelper.HasBuff(Me.CurrentTarget, Spells.Corruption))
{
Debug("Target needs corruption");
Spells.Cast(Spells.Corruption, Me.CurrentTarget);
return;
}

Is HasBuff method checking for ownership?

If not I might build that into the logic of other dots...

WIP but so far using the above you gave me:

Code:
//immolate / UA
            var castDot = Immolate_OR_UnstableAffliction;
            if (castDot != null
                && Spells.CanCast(castDot)
                && UnitHelper.MustRefreshBuff(Me.CurrentTarget, castDot))
            {
                Debug("Target needs " + castDot.Name);
                Spells.Cast(castDot, Me.CurrentTarget);
                return;
            }
            else //if dot is on, check for Fel Flame renew
            {
                if (Me.CurrentTarget != null &&
                    Me.CurrentTarget.ActiveAuras.Any( //check if my dot on & active time < 5 sec
                        x => x.Value.SpellId == castDot.Id &&
                        x.Value.CreatorGuid == Me.Guid &&
                        x.Value.TimeLeft.TotalSeconds < 5) &&
                    Spells.CanCast(Spells.FelFlame) // Have Fel Flame?
                    )
                {
                    Debug("Renewing with Fel Flame... ");
                    Spells.Cast(Spells.FelFlame, Me.CurrentTarget, true); //Renew with Fel Flame
                }
            }

Im just on lunch at work now so I will be doing some more over the next few days (raiding tonight lol)

CHeers,
Dyl
 
PHP:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Styx.Logic.Combat;
using Styx.WoWInternals.WoWObjects;

namespace PrinceOfDarkness
{
    public class UnitHelper
    {
        public static bool HasBuff(WoWUnit unit, WoWAura aura)
        {
            return HasBuff(unit, aura.Spell);
        }

        public static bool HasBuff(WoWUnit unit, WoWSpell spell)
        {
            if (unit == null)
                return false;
            
            var auras = unit.GetAllAuras();
            foreach (var a in auras)
            {
                //PrinceOfDarkness.Debug("hasbuff: name={0}, spellName={1}, spellID={2}", a.Name, a.Spell.Name, a.Spell.Id);
                if (a.SpellId == spell.Id && a.CreatorGuid == PrinceOfDarkness.Me.Guid)
                    return true;
            }
            return false;
        }

        public static bool MustRefreshBuff(WoWUnit unit, WoWSpell spell)
        {
            if (unit == null)
                return false;

            var auras = unit.GetAllAuras();
            foreach (var a in auras)
            {
                //PrinceOfDarkness.Debug("hasbuff: name={0}, spellName={1}, spellID={2}", a.Name, a.Spell.Name, a.Spell.Id);
                if (a.SpellId == spell.Id && a.CreatorGuid == PrinceOfDarkness.Me.Guid)
                    return a.TimeLeft.TotalSeconds <= 1.0;
            }
            //not found
            return true;
        }
    }
}

By the way, you should not refresh it using fel flame. Costs a lot of mana and you're wasting 2-3 gcd for nothing. It's mostly useful when you need to refresh it while moving (special raid bosses, pvp...).
 
Last edited:
By the way, you should not refresh it using fel flame. Costs a lot of mana and you're wasting 2-3 gcd for nothing. It's mostly useful when you need to refresh it while moving (special raid bosses, pvp...).

Yeh i just got home and realized that was horrible given you already had stuff in the UnitHelper so must of that notepad junk I posted above is useless lol:)

Im going to have and crunch the numbers but I often find if I follow a hard cast with the instant Fel Flame it almost negates the CD... basically i spam one out straight away after shadowbolt or haunt to keep UA up but maybe that because im always > 200ping?

Either way I will have to check that out because if its a dps loss there is no point bothering... Thanks for the help tho.

T
 
Back
Top