//////////////////////////////////////////////
//  Author: Drammel							//
//  Date: 10/22/2009						//
//  Title: menu_sublime_way					//
//  Description: Creates the Book of the    //
//  Nine Swords and Martial Journal for the //
//  Saint.  After these have been created   //
//  this button toggles on and off the      //
//  Saint's martial adept menu.             //
//////////////////////////////////////////////

#include "bot9s_inc_index"

void main()
{
	object oOrigin = OBJECT_SELF;
	object oPC = GetControlledCharacter(oOrigin);
	//Ensures that the game checks an item unique to the player.
	//This is to prevent script confusion with characters of the same class.
	string sToB = GetFirstName(oPC) + "tob";
	object oToB = GetObjectByTag(sToB);

	if (Bot9SHasItem(oPC, "mj_sa"))
	{
		if (GetLocalInt(oToB, "SublimeWay") == 1)
		{
			SetLocalInt(oToB, "SublimeWay", 0);
			DisplayGuiScreen(oPC, "SCREEN_MARTIAL_MENU_SA", FALSE, "martial_menu_sa.xml");
		}
		else
		{
			SetLocalInt(oToB, "SublimeWay", 1);
			CloseGUIScreen(oPC, "SCREEN_MARTIAL_MENU_SA");
		}
	}
	else CreateItemOnObject("mj_sa", oPC, 1, "mj_sa", 1);

	if (Bot9SHasItem(oPC, sToB))
	{

	}
	else CreateItemOnObject("tob", oPC, 1, sToB, 1);
}