//////////////////////////////////////////////
//	Author: Drammel							//
//	Date: 4/10/2009							//
//	Title: gui_execute_sf					//
//	Description: Enables feats which require//
//	a swift or free action to activate.		//
//////////////////////////////////////////////

void main(int nTarget)
{
	object oOrigin = OBJECT_SELF;
	object oPC = GetControlledCharacter(oOrigin);
	string sToB = GetFirstName(oPC) + "tob";
	object oToB = GetObjectByTag(sToB);
	string sData = GetLocalString(oToB, "BlackBox");
	string sClass = GetStringRight(sData, 3);
	string sNumber;

	if ((GetCurrentHitPoints(oPC) < 1) || (GetLocalInt(oToB, "RedCrusader") == 1))
	{
		return;
	}

	effect eSuck;

	eSuck = GetFirstEffect(oPC);

	while (GetIsEffectValid(eSuck))
	{
		if (GetEffectType(eSuck) == EFFECT_TYPE_CHARMED || GetEffectType(eSuck) == EFFECT_TYPE_CONFUSED || GetEffectType(eSuck) == EFFECT_TYPE_CUTSCENE_PARALYZE
		|| GetEffectType(eSuck) == EFFECT_TYPE_DAZED || GetEffectType(eSuck) == EFFECT_TYPE_DOMINATED
		|| GetEffectType(eSuck) == EFFECT_TYPE_ENTANGLE || GetEffectType(eSuck) == EFFECT_TYPE_FRIGHTENED
		|| GetEffectType(eSuck) == EFFECT_TYPE_PARALYZE || GetEffectType(eSuck) == EFFECT_TYPE_PETRIFY
		|| GetEffectType(eSuck) == EFFECT_TYPE_STUNNED || GetEffectType(eSuck) == EFFECT_TYPE_TIMESTOP)
		{
			SendMessageToPC(oPC, "<color=red>You cannot take this action in your current state.</color>");
			return;
		}

		eSuck = GetNextEffect(oPC);
	}

	if (GetSubString(sData, 1, 1) == "_") // Number of Digits
	{
		sNumber = GetStringLeft(sData, 1);
	}
	else sNumber = GetStringLeft(sData, 2);

	int nRow = GetLocalInt(oToB, "BlueBoxF" + sNumber + sClass);
	string sScript = GetLocalString(oToB, "maneuvers_Script" + IntToString(nRow));

	SetLocalInt(oToB, "Target", nTarget);
	ExecuteScript(sScript, oPC);
}