Added somme functions
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SPQR;
using MySPQR;
namespace SPQR.Engine
{
class Warlock : Engine.FightModule
{
public override string DisplayName
{
get { return "Affliction Warlock Affliction"; } //This is the name displayed in SPQR's Class selection DropdownList
}
internal enum Spells : int //This is a convenient list of all spells used by our combat routine
{ //you can have search on wowhead.com for spell name, and get the id in url
CurseOfElements = 1490,
MaleficGrasp = 686, //
Haunt = 48181,
DrainSoul = 1120,
Corruption = 172,
Agony = 980,
UnstableAffliction = 30108,
DSMisery = 77801, //
LifeTap = 1454,
DrainLife = 689,
UnendingResolve = 104773,
}
internal enum Auras : int //This is another convenient list of Auras used in our combat routine
{ //you can have those in wowhead.com (again) and get the id in url
Haunt = 48181,
Corruption = 146739, // aura
Agony = 980,
UnstableAffliction = 30108,
FireBreath = 34889, // CoE equiv
LightningBreath = 24844, // CoE equiv
MasterPoisoner = 93068, // CoE equiv
CurseOfElements = 1490, // CoE
SoulShards = 117198,
}
public override void CombatLogic() //This is the DPS / healing coutine, called in loop by SPQR all code here is executed
{
var TARGET = MySPQR.Internals.ObjectManager.Target;
var ME = MySPQR.Internals.ObjectManager.WoWLocalPlayer;
// if(TARGET.HealthPercent > 80)
// MySPQR.Internals.ActionBar.CastSpellById((int)Spells.DSMisery);
if(!TARGET.HasAurabyId((int)Auras.CurseOfElements) && !TARGET.HasAurabyId((int)Auras.FireBreath) && !TARGET.HasAurabyId((int)Auras.LightningBreath) && !TARGET.HasAurabyId((int)Auras.MasterPoisoner))
MySPQR.Internals.ActionBar.CastSpellById((int)Spells.CurseOfElements);
if(!HasMyDebuff((int)Auras.Agony))
MySPQR.Internals.ActionBar.CastSpellById((int)Spells.Agony);
if(!HasMyDebuff((int)Auras.Corruption))
MySPQR.Internals.ActionBar.CastSpellById((int)Spells.Corruption);
if (!HasMyDebuff((int)Auras.UnstableAffliction))
MySPQR.Internals.ActionBar.CastSpellById((int)Spells.UnstableAffliction);
if(!HasMyDebuff((int)Auras.Haunt))
MySPQR.Internals.ActionBar.CastSpellById((int)Spells.Haunt);
if(ME.HealthPercent > 60 && ME.ManaPercent < 40)
MySPQR.Internals.ActionBar.CastSpellById((int)Spells.LifeTap);
if(TARGET.HealthPercent <= 20)
MySPQR.Internals.ActionBar.CastSpellById((int)Spells.DrainSoul);
if(TARGET.HealthPercent > 20)
MySPQR.Internals.ActionBar.CastSpellById((int)Spells.MaleficGrasp);
}
public static bool HasMyDebuff(int spellID)
{
var TARGET = MySPQR.Internals.ObjectManager.Target;
foreach (var aura in TARGET.AuraList)
{
if( (aura.Id==spellID) && aura.IsMine)
return true;
}
return false;
}
public override void OnLoad() //This is called when the Customclass is loaded in SPQR
{
}
public override void OnClose() //This is called when the Customclass is unloaded in SPQR
{
}
public override void OnStart() //This is called once, when you hit CTRL+X to start SPQR combat routine
{
}
public override void OnStop() //This is called once, when you hit CTRL+X to stop SPQR combat routine
{
}
}
}