Nightskine
Member
- Joined
- Oct 30, 2010
- Messages
- 150
- Reaction score
- 1
Hi all,
I'm trying to cast spells on my focus target but am not having any luck.
I searched the forums and found this code but I couldnt get it to work for me.
What i need is a code to return WoWPlayer as who ever my focus target is and null if i have no target so I could later call them by WoWPlayer p = GetFocus();
I appreciate any help since I've been stumped with this for quite a while now.
Thanks,
NightS
I'm trying to cast spells on my focus target but am not having any luck.
I searched the forums and found this code but I couldnt get it to work for me.
Code:
public WoWUnit GetFocus
{
get
{
string name = Lua.GetReturnVal("return GetUnitName(\"" + "focus" + "\");",0);
WoW units = ObjectManager.GetObjectsOfType(true, true).First((unit) => unit.Name == name && name != null && name != string.Empty && name.ToLower() != "nil");
if (units != null)
{
return units;
}
return null;
}
}
What i need is a code to return WoWPlayer as who ever my focus target is and null if i have no target so I could later call them by WoWPlayer p = GetFocus();
I appreciate any help since I've been stumped with this for quite a while now.
Thanks,
NightS