//::///////////////////////////////////////////////
//:: gui_2d2f_sp_reckless_dweomer
//::///////////////////////////////////////////////
/*
Recieves exported data from the reckless spellbook gui 
and set some local variables
*/
//::///////////////////////////////////////////////
//:: Created By: 2DruNk2Frag
//:: Created On: 02-12-2008
//:: Last Update: 09-04-2008
//::///////////////////////////////////////////////

#include "jx_inc_magic_info"
#include "2d2f_includes"

void main(int nSpellId, int nMeta)
{
	object oPC = OBJECT_SELF;	
	
	if(GetName(GetControlledCharacter(oPC)) == GetGlobalString("recklessCaller"))
	{	
		SetLocalInt(oPC,"nRecklessSpellId",	nSpellId);
		SetLocalInt(oPC,"nRecklessMeta", nMeta);
		SetLocalInt(oPC,"nReclessSelected", 1);
		//SetLocalInt(oPC,"nReckless", 1);
		string sMetaName;
		
		switch(nMeta)
		{
		case 1 : sMetaName = "Empower"; break;
		case 2 : sMetaName = "Extend"; break;
		case 4 : sMetaName = "Maximize"; break;
		case 8 : sMetaName = "Quicken"; break;
		case 16 : sMetaName = "Silence"; break;
		case 32 : sMetaName = "Still"; break;
		case 64 : sMetaName = "Persistant"; break;
		default : break;
		}
		
		
			if(nMeta > 0)
			{
			SendMessageToPC(oPC, "You have selected the spell:  " + JXGetSpellName(nSpellId)
			 + ". Metamagic Feat: " + sMetaName);
			}
			else
			{
			SendMessageToPC(oPC, "You have selected the spell:  " + JXGetSpellName(nSpellId));
			}
	}
	else
	{
		SpeakString("Spell Selection Failed.");
	}
	
	/*DisplayMessageBox( oPC,0,
	"You have selected the spell:  " + JXGetSpellName(nSpellId),
	"",	"", FALSE,"SCREEN_MESSAGEBOX_DEFAULT", 0, "Ok", 0, "");*/	
	
	
	CloseGUIScreen(OBJECT_SELF, "SCREEN_RECKLESS_SPBK");
	CloseGUIScreen(OBJECT_SELF, "SCREEN_SPELLS_MEMORIZED");
	
	return;
}