Someone have reported a bug in aura, will check this before releasing new version.
Here is a sample CustomClass, documented.
The distance check is not yet available for you guys, you will have to wait for the release, be patient
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 Mage : Engine.FightModule
{
public override string DisplayName
{
get { return "Mage"; } //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
FrostfireBolt = 44614, //http://www.wowhead.com/spell=44614
FrostNova = 122, //http://www.wowhead.com/spell=122
FireBlast = 2136, //http://www.wowhead.com/spell=2136
Polymorph = 118, //http://www.wowhead.com/spell=118
Counterspell = 2139, //http://www.wowhead.com/spell=2139
IceLance = 30455, //http://www.wowhead.com/spell=30455
}
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
MoltenArmor = 30482, //http://www.wowhead.com/spell=30482
FrostArmor = 7302, //http://www.wowhead.com/spell=7302
Invisibility = 66, //http://www.wowhead.com/spell=66
Polymorph = 118, //http://www.wowhead.com/spell=118
Frozen = 50635, //http://www.wowhead.com/spell=50635
}
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.IsCasting) /*Check if the target is casting to interup */
CastSpellById((int)Spells.Counterspell);
if (TARGET.HasAurabyId((int)Auras.Frozen)) /*Check if TARGET have specified Aura (buff/debuff)*/
CastSpellById((int)Spells.IceLance);
CastSpellById((int)Spells.FireBlast);
if (TARGET.Position.Distance3DFromPlayer < 7) /*Check if the distance betwwen the target and your player is below 7 yards*/
{
CastSpellById((int)Spells.FrostNova);
}
CastSpellById((int)Spells.FrostfireBolt);
}
public static void CastSpellById(int spellId) //This is a *usermade* function to evaluate if the given spell (spellId) can be cast
{
if (MySPQR.Internals.ObjectManager.Target.IsValid) /*return true if the Target is valid(exist) or not dead*/
{
if (MySPQR.Internals.ActionBar.CanCast(spellId)) /*return true if your char can use the spell (check cooldown and global cooldown*/
{
MySPQR.Internals.ActionBar.GetSlotById(spellId).Execute(); /*if all is ok, this will get the ActionBarSlot for your spell,
and execute the right Keybind to cast it*/
}
}
}
public override void OnLoad() //This is called when the Customclass is loaded in SPQR
{
//Do some stuff like loading settings, display Hello in the SPQR Log...
SPQR.Logger.WriteLine("CustomClass " + DisplayName + " Loaded");
}
public override void OnClose() //This is called when the Customclass is unloaded in SPQR
{
//Do some stuff like saving settings, display goodbye in SPQR log...
SPQR.Logger.WriteLine("CustomClass " + DisplayName + " Unloaded, Goodbye !");
}
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
{
}
}
}