Hello, try
wManager.Wow.Helpers.Interact.InteractGameObject(unit1.GetBaseAddress, true);
if (wManager.Wow.ObjectManager.ObjectManager.Me.Target == unit1.Guid)
{
Lua.LuaDoString(String.Format("CastSpellByID({0}, 'target')", _Swarm.Id));
}
or
wManager.Wow.ObjectManager.ObjectManager.Me.FocusGuid = unit1.Guid;
if (wManager.Wow.ObjectManager.ObjectManager.Me.FocusGuid == unit1.Guid)
{
Lua.LuaDoString(String.Format("CastSpellByID({0}, 'focus')", _Swarm.Id));
}
or
wManager.Wow.Helpers.Interact.InteractGameObject(unit1.GetBaseAddress, true);
if (wManager.Wow.ObjectManager.ObjectManager.Me.Target == unit1.Guid)
{
wManager.Wow.Helpers.SpellManager.CastSpellByNameOn(_StarFire.NameInGame, "target");
}
or
wManager.Wow.ObjectManager.ObjectManager.Me.FocusGuid = unit1.Guid;
if (wManager.Wow.ObjectManager.ObjectManager.Me.FocusGuid == unit1.Guid)
{
wManager.Wow.Helpers.SpellManager.CastSpellByNameOn(_StarFire.NameInGame, "focus");
}