Pour lancer un sort sur les focus:
// lua id: http://wow.gamepedia.com/UnitId
var intimidatingShout = new Spell("Intimidating Shout");
if (intimidatingShout.KnownSpell && intimidatingShout.IsSpellUsable)//...
{
intimidatingShout.Launch(intimidatingShout.CastTime > 0, true, false, "focus");
// Si vous voulez gérer manuellement le lancement utiliser: SpellManager.CastSpellByNameOn(intimidatingShout.NameInGame, "focus");
}
Pour obtenir le focus (en objet "WowUnit"), ajouter cette methode dans votre code:
static WoWUnit GetFocus()
{
uint offsetFocus = 0xEAEF10; // offset wow 6.2.3.20886
var unit = new WoWUnit(0);
try
{
var focusGuid = wManager.Wow.Memory.WowMemory.Memory.ReadInt128(wManager.Wow.Memory.WowMemory.Memory.RebaseAddress(offsetFocus));
if (focusGuid.IsNotZero())
{
var obj = ObjectManager.GetObjectByGuid(focusGuid);
if (obj.Type == WoWObjectType.Player || obj.Type == WoWObjectType.Unit)
unit = new WoWUnit(obj.GetBaseAddress);
}
}
catch (Exception e)
{ }
return unit;
}
Et vous pouvez utiliser le code comme ca par exemple:
var focus = GetFocus();
if (focus.IsValid)
{
var intimidatingShout = new Spell("Intimidating Shout");
if (intimidatingShout.KnownSpell &&
intimidatingShout.IsSpellUsable &&
focus.GetDistance < intimidatingShout.MaxRange + focus.CombatReach &&
!focus.HaveBuff("Intimidating Shout"))
{
intimidatingShout.Launch(intimidatingShout.CastTime > 0, true, false, "focus");
}
}
PS: Je vais rajouter le focus directement dans WRobot dans les prochaines maj.