public bool IsCastingTownPortalOrTeleport()
{
try
{
var commonData = ZetaDia.Me.CommonData;
if (CheckVisualEffectNoneForPower(commonData, SNOPower.UseStoneOfRecall))
{
Logger.LogVerbose("Player is casting 'UseStoneOfRecall'");
return true;
}
if (CheckVisualEffectNoneForPower(commonData, SNOPower.TeleportToPlayer_Cast))
{
Logger.LogVerbose("Player is casting 'TeleportToPlayer_Cast'");
return true;
}
if (CheckVisualEffectNoneForPower(commonData, SNOPower.TeleportToWaypoint_Cast))
{
Logger.LogVerbose("Player is casting 'TeleportToWaypoint_Cast'");
return true;
}
return false;
}
catch (Exception) { }
return false;
}
private static bool CheckVisualEffectNoneForPower(ACD commonData, SNOPower power)
{
if (commonData.GetAttribute<int>(((int) power << 12) + ((int) ActorAttributeType.PowerBuff0VisualEffectNone & 0xFFF)) == 1)
return true;
if (commonData.GetAttribute<int>(((int) power << 12) + ((int) ActorAttributeType.PowerBuff1VisualEffectNone & 0xFFF)) == 1)
return true;
if (commonData.GetAttribute<int>(((int) power << 12) + ((int) ActorAttributeType.PowerBuff2VisualEffectNone & 0xFFF)) == 1)
return true;
if (commonData.GetAttribute<int>(((int) power << 12) + ((int) ActorAttributeType.PowerBuff3VisualEffectNone & 0xFFF)) == 1)
return true;
if (commonData.GetAttribute<int>(((int) power << 12) + ((int) ActorAttributeType.PowerBuff4VisualEffectNone & 0xFFF)) == 1)
return true;
if (commonData.GetAttribute<int>(((int) power << 12) + ((int) ActorAttributeType.PowerBuff5VisualEffectNone & 0xFFF)) == 1)
return true;
return false;
}