Quote Originally Posted by Wolfie View Post
Objects are created with multiple functions. NOCOMBAT restrictions can restrict which of these functions can be used in combat (i.e. the ones that don't require any player input).

Click or hover events require player input.

Please, please stop talking, because you are out of your element.
Sorry man you already tried to use that one on someone else. You are wrong in this case though.

Yes you can create objects within functions by calling on them which in turn the function can return that object if that is it's function.

NOCOMBAT is a function call restriction, it does not prevent you from passing a returned object, or variable when calling another function. All it does is prevent you from calling that function in order to pass in an object in order to get the return.

So in your case, since the OnHover or OnClick function can be called in combat then you can get the target returned during combat. You can then pass in that object to any other function that is not restricted by NOCOMBAT if you are in combat. So unless GetPlayerHP() is NOCOMBAT restricted then there is no reason you can't get the HP returned by passing in your already acquired target object. And then from there you can pass your HP value into a Lua script, have the script spit out a command object then pass that to CastAbility(). Again all functions that aren't restricted by NOCOMBAT.

It seems like you are under the impression that you can somehow strip out an object or variable. This isn't possible as long as you can call the function and get the return.