Looks like it is calling CGUnit_C__HasAura to check for a spell aura, and based on if you have that aura it determines direction.
Auras:
http://www.wowhead.com/spell=67483
http://www.wowhead.com/spell=67484
IDA Pseudocode:
Code:
void *__cdecl Script_GetEclipseDirection(int a1)
{
void *result; // eax@1
__int64 v2; // qax@1
v2 = ClntObjMgrGetActivePlayer();
result = ClntObjMgrObjectPtr(v2, TYPEMASK_PLAYER);
if ( result )
{
if ( (unsigned __int8)CGUnit_C__HasAura(67483, 0, 0) )
{
lua_pushstring(a1, "sun");
result = (void *)1;
}
else
{
if ( (unsigned __int8)CGUnit_C__HasAura(67484, 0, 0) )
{
lua_pushstring(a1, "moon");
result = (void *)1;
}
else
{
lua_pushstring(a1, "none");
result = (void *)1;
}
}
}
return result;
}