//class DetailStatusWnd extends UIScript;
class DetailStatusWnd extends UICommonAPI;

const DIALOG_DetailStatusWnd = 90005;
const NSTATUS_SMALLBARSIZE = 85;
const NSTATUS_BARHEIGHT = 12;

struct SubjobInfo
{
	var int Id;
	var int ClassID;
	var int Level;
	var int Type;
};

var String m_WindowName;
var int m_UserID;
var HennaInfo m_HennaInfo;
//var UserInfo currentUserInfo;

var WindowHandle Me;

//Handle
var TextBoxHandle txtClassName;
var TextBoxHandle txtSP;
var TextBoxHandle txtName1;
var TextBoxHandle txtName2;
var TextBoxHandle txtHeadPledge;
var TextBoxHandle txtPledge;
var TextBoxHandle txtLvHead;
var TextBoxHandle txtLvName;
var TextBoxHandle txtHeadRank;
var TextBoxHandle txtRank;
var StatusBarHandle texHP;
var StatusBarHandle texMP;
var StatusBarHandle texExp;
var StatusBarHandle texCP;
var TextBoxHandle txtPhysicalAttack;
var TextBoxHandle txtPhysicalDefense;
var TextBoxHandle txtHitRate;
var TextBoxHandle txtCriticalRate;
var TextBoxHandle txtPhysicalAttackSpeed;
var TextBoxHandle txtMagicalAttack;
var TextBoxHandle txtMagicDefense;
var TextBoxHandle txtPhysicalAvoid;
var TextBoxHandle txtGmMoving;
var TextBoxHandle txtHeadMovingSpeed;
var TextBoxHandle txtMovingSpeed;
var TextBoxHandle txtHeadMagicCastingSpeed;
var TextBoxHandle txtMagicCastingSpeed;
var TextBoxHandle txtSTR;
var TextBoxHandle txtDEX;
var TextBoxHandle txtCON;
var TextBoxHandle txtINT;
var TextBoxHandle txtWIT;
var TextBoxHandle txtMEN;
var TextBoxHandle txtCriminalRate;
var TextBoxHandle txtPVP;
var TextBoxHandle txtSociality;
var TextBoxHandle txtBonusVote;
var TextBoxHandle txtRaidPoint;
var TextureHandle texHero;
var TextureHandle texPledgeCrest;
var TextureHandle VitalityTex;
var TextBoxHandle txtLUC;
var TextBoxHandle txtCHA;

var TextBoxHandle txtAttrAttackType;
var TextBoxHandle txtAttrAttackValue;
var TextBoxHandle txtAttrDefenseValFire;
var TextBoxHandle txtAttrDefenseValWater;
var TextBoxHandle txtAttrDefenseValWind;
var TextBoxHandle txtAttrDefenseValEarth;
var TextBoxHandle txtAttrDefenseValHoly;
var TextBoxHandle txtAttrDefenseValUnholy;

var TextBoxHandle txtHeadSTR;
var TextBoxHandle txtHeadDEX;
var TextBoxHandle txtHeadCON;
var TextBoxHandle txtHeadINT;
var TextBoxHandle txtHeadWIT;
var TextBoxHandle txtHeadMEN;

var TextBoxHandle txtHeadLUC;
var TextBoxHandle txtHeadCHA;

var ButtonHandle AbilityOpen;

var StatusBarHandle texVP;//ldw

var AnimTextureHandle APActive;

var int MaxVitality; //ldw

//var int nCanUseAP; //ldw

var L2Util util;//bluesun ЕшЖБ Б¦ѕо їл



//------------------------------
//    Е¬·ЎЅєєЇ°жёЮАО
//------------------------------
// ±фєэАМґВЗцАзЕ¬·ЎЅє, АМЖеЖ®
var AnimTextureHandle ClassChangeLightBig;

// ЗцАзЕ¬·ЎЅєЕШЅєГД
// ёЮАО: l2ui_ct1.PlayerStatusWnd_ClassBgMain_Big(»Ў°­)
// ј­єк: l2ui_ct1.PlayerStatusWnd_ClassBgSub_Big (Г»»ц)
var TextureHandle ClassBgMain_Big;

// Е¬·ЎЅєё¶Е©ЕШЅєГД
var TextureHandle ClassMarkBig;

//------------------------------
//     Е¬·ЎЅєєЇ°ж№цЖ°
//------------------------------
var AnimTextureHandle ClassChangeLightSmall1;

// Е¬·ЎЅє№и°жЕШЅєГД1,2,3
var TextureHandle ClassBgMain_Small1;

// Е¬·ЎЅєё¶Е©
var TextureHandle ClassMarkSmall1;

// µаѕу, ј­єкЕ¬·ЎЅєєЇ°ж№цЖ°
var ButtonHandle ClassFrameBtn1;

// ј·АвБ¤єё
var array<SubjobInfo> subjobInfoArray;
var SubjobInfo beforeSubjobInfo;

// ЗцАзИ°јєИ­µЗѕоАЦґВЕ¬·ЎЅє
var int currentSubjobClassNum;

// ЗцАз µаѕу Е¬·ЎЅє ј­єкАвАМ АЦґВ°Ў?
var bool    isDualClass;

// АУЅГ·О µаѕу Е¬·ЎЅє , ј­єкАв Б¤єёё¦ АъАеЗШј­ ГўАМ ї­ё±¶§ ё¶ґЩ °»ЅЕ ЗТ¶§ »зїлЗСґЩ.
// var string  saveUpdateSubjobInfoParam;

// ё¶Бцё·Аё·О №ЮАє ј­єкАв, µаѕу °ь·Г АМєҐЖ® °Є АъАе
// var int updateSubjobLastEvent;
/*
History: UObject::ProcessEvent <-(DamageText Transient.DamageText, Function Interface.DamageText.OnEvent) <- 
GFxUIManager::ExecuteUIEvent <- ID:580, param:Index=361 Param1=1209048809 Param2=1209050262 <- ExecuteUIEvent
<- NSystemMessageManager::EndSystemMessageParam <- NConsoleWnd::EndSystemMessageParam <- SystemMessagePacket <- 
UNetworkHandler::Tick <- Function Name=SystemMessagePa <- UGameEngine::Tick <- UpdateWorld <- MainLoop
 **/

var int race;

var int CurrentSubjobClassID;

/**
 * OnRegisterEvent
 **/
function OnRegisterEvent()
{
	//Level°ъExpґВUserInfoЖРЕ¶Аё·ОГіё®ЗСґЩ.
	RegisterEvent(EV_UpdateUserInfo);
	RegisterEvent(EV_UpdateHennaInfo);
	
	//JYLee, АЗ№МѕшґВ ЗФјцИЈГвА» ё·±в А§ЗШ status Б¤єёё¦ і» Б¤єёїН ґЩёҐ ДіёЇЕНАЗ Б¤єё·О єРё®
	RegisterEvent(EV_UpdateMyHP);
	RegisterEvent(EV_UpdateMyMaxHP);
	RegisterEvent(EV_UpdateMyMP);
	RegisterEvent(EV_UpdateMyMaxMP);
	RegisterEvent(EV_UpdateMyCP);
	RegisterEvent(EV_UpdateMyMaxCP);

	// И°·ВѕчµҐАМЖ®
	RegisterEvent(EV_VitalityPointInfo);	

	// ґЩАМѕу·О±Ч(ј­єкЕ¬·ЎЅєєЇ°жИ®АОїл)
	RegisterEvent(EV_DialogOK);
	RegisterEvent(EV_DialogCancel);

	//µаѕуЕ¬·ЎЅє№Чј­єкЕ¬·ЎЅєё®ЅєЖ®
	RegisterEvent(EV_NotifySubjob);
	// CurrentSubjobClassID=3 Count=3 SubjobID_1 SubjobClassID_1=44 SubjobLevel_1=55 SubjobType_1
	RegisterEvent(EV_CreatedSubjob);
	RegisterEvent(EV_ChangedSubjob);

// CurrentSubjobClassID=117 Count=3 SubjobID_1=1 SubjobClassID_1=3 SubjobLevel_1=55 SubjobType_1=0 SubjobID_2=1 SubjobClassID_2=73 SubjobLevel_2=55 SubjobType_2=1 SubjobID_3=1 SubjobClassID_3=131 SubjobLevel_3=55 SubjobType_3=2
	// µаѕуЕ¬·ЎЅє№Чј­єкЕ¬·ЎЅєё®ЅєЖ®
	// const EV_NotifySubjob = 5310;
	// const EV_CreatedSubjob = 5311;
	// const EV_ChangedSubjob = 5312;
	// ±жµе±Ч·Јµеё¶ЅєЕНЗСЕЧ°Ўј­
	// АПИёјєДщЅєЖ®234 1
	// АПИёјєДщЅєЖ®235 1
	// ј­єкГЯ°Ў

	//branch
	// F2P ј­єсЅє И°·В °іј± - gorillazin
	RegisterEvent(EV_VitalityEffectInfo);	
	//
	//end of branch
	
	//branch120703
	RegisterEvent(EV_ToggleDetailStatusWnd);
	
}

function OnLoad()
{
	SetClosingOnESC();
	
	InitializeCOD();

	Me.EnableWindow();

	// Е¬·ЎЅєєЇ°ж№цЖ°єсИ°јєИ­
	initClassChangeButton(false);
	MaxVitality = GetMaxVitality();//ldw
	txtHeadRank.HideWindow();
	txtRank.HideWindow();

	texExp.SetDecimalPlace(4);
}

/*
function onCallUCFunction(string functionName, string param)
{
	switch(functionName)
	{
		case "UpdateUseAP" :
			nCanUseAP = int(param);
			handleAbilityBtnTooltip();
		break;
	}
}


function handleAbilityBtnTooltip()
{
	local CustomTooltip T;
	local string tmpTooltipString;	

	T.MinimumWidth = 125; // 125 ·О јцБ¤ЗШѕЯЗФ

	util = L2Util(GetScript("L2Util"));//bluesun ДїЅєЕНё¶АМБо ЕшЖБ 
	util.setCustomTooltip(T);//bluesun ДїЅєЕНё¶АМБо ЕшЖБ	
	
	

//	Debug("handleAbilityBtnTooltip1");
	//№цЖ° И°јє		
	//ѕоєфё®Жј ЖчАМЖ® : ёо ЖчАОЖ® ¶уґВ ёЮЅГБц 		
	tmpTooltipString = MakeFullSystemMsg(GetSystemMessage(4194), String(nCanUseAP));
	util.ToopTipInsertText(tmpTooltipString , false, false);
	AbilityOpen.SetTooltipCustomType(util.getCustomToolTip());//bluesun ДїЅєЕНё¶АМБо ЕшЖБ
}
*/

function UpdateAbilityBtn()
{
	local UserInfo UserInfo;
	local AbilityUIWnd.AbilityPresetInfo presetInfo;
	local bool Enable;
	local string tempTooltipStr;
	local array<DrawItemInfo> drawListArr;

	if(Me.IsShowWindow() == false)
	{
		return;
	}
	if(GetPlayerInfo(UserInfo))
	{
		if(UserInfo.nLevel >= 85)
		{
			Enable = true;
		}
	}
	util = L2Util(GetScript("L2Util")); //bluesun ДїЅєЕНё¶АМБо ЕшЖБ 
	presetInfo = AbilityUIWnd(GetScript("AbilityUIWnd")).GetAbilityPresetInfo(); //bluesun ДїЅєЕНё¶АМБо ЕшЖБ
	if(presetInfo.currentPreset == 1)
	{
		AbilityOpen.SetTexture("L2UI_CT1.PlayerStatusWnd.abilityIcon_B_default", "L2UI_CT1.PlayerStatusWnd.abilityIcon_B_over", "L2UI_CT1.PlayerStatusWnd.abilityIcon_B_down");		
	}
	else
	{
		AbilityOpen.SetTexture("L2UI_CT1.PlayerStatusWnd.abilityIcon_A_default", "L2UI_CT1.PlayerStatusWnd.abilityIcon_A_over", "L2UI_CT1.PlayerStatusWnd.abilityIcon_A_down");
	}
	APActive.HideWindow();
	if(Enable)
	{
		//№цЖ° И°јє
		GetTextureHandle(m_WindowName $ ".abilityIconSlotBlank").HideWindow();
		AbilityOpen.ShowWindow();
		tempTooltipStr = (GetSystemString(14444) $ ":") @ string(presetInfo.aPresetRemainAP);
		if(presetInfo.currentPreset == 0)
		{
			drawListArr[drawListArr.Length] = addDrawItemText(tempTooltipStr, util.Yellow, "", true, true);			
		}
		else
		{
			drawListArr[drawListArr.Length] = addDrawItemText(tempTooltipStr, util.Gray, "", true, true);
		}
		tempTooltipStr = (GetSystemString(14445) $ ":") @ string(presetInfo.bPresetRemainAP);
		if(presetInfo.currentPreset == 1)
		{
			drawListArr[drawListArr.Length] = addDrawItemText(tempTooltipStr, util.Yellow, "", true, true);			
		}
		else
		{
			drawListArr[drawListArr.Length] = addDrawItemText(tempTooltipStr, util.Gray, "", true, true);
		}
		AbilityOpen.SetTooltipCustomType(MakeTooltipMultiTextByArray(drawListArr));
		if((presetInfo.aPresetRemainAP > 0) || presetInfo.bPresetRemainAP > 0)
		{
			APActive.ShowWindow();
			APActive.SetLoopCount(999);
			APActive.Play();
		}		
	}
	else
	{
		AbilityOpen.HideWindow();
		GetTextureHandle(m_WindowName $ ".abilityIconSlotBlank").ShowWindow();
		drawListArr[drawListArr.Length] = addDrawItemText(GetSystemMessage(4195), util.White, "", true, true);
		GetTextureHandle(m_WindowName $ ".abilityIconSlotBlank").SetTooltipCustomType(MakeTooltipMultiTextByArray(drawListArr));
	}	
}

/**
 * Е¬·ЎЅєєЇ°ж№цЖ°єсИ°јєИ­
 **/ 
function initClassChangeButton(bool visibleFlag)
{
	local int i;

	// №цЖ°єсИ°јєИ­
	for(i = 1; i < 2; i++)
	{
		// №цЖ°єсИ°јє, АЪ№°јиєёАМµµ·ПјјЖГ
		setClassTexture(i, "", "", false);
		
		GetButtonHandle(m_WindowName $ ".ClassFrameBtn" $ i).DisableWindow();
		GetButtonHandle(m_WindowName $ ".ClassFrameBtn" $ i).SetTexture("L2UI_ct1.Misc_DF_Blank",
																		  "L2UI_ct1.Misc_DF_Blank",
																		  "L2UI_ct1.Misc_DF_Blank");

		GetButtonHandle(m_WindowName $ ".ClassFrameBtn" $ i).SetTooltipCustomType(subjobButtonToolTips(-1));

		if(visibleFlag)
		{

			// GetTextureHandle(m_WindowName $ ".ClassSlotBlank" $ i).ShowWindow();
			// GetTextureHandle(m_WindowName $ ".ClassFrameBtn" $ i).ShowWindow();

		}
		else 
		{   
			// GetTextureHandle(m_WindowName $ ".ClassSlotBlank" $ i).HideWindow();
			// GetTextureHandle(m_WindowName $ ".ClassFrameBtn" $ i).HideWindow();			
		}
	}
}

function InitializeCOD()
{
	Me = GetWindowHandle("DetailStatusWnd");

	// Е¬·ЎЅєєЇ°ж±фєэАМЕШЅєГД
	ClassChangeLightBig = GetAnimTextureHandle(m_WindowName $ ".ClassChangeLightBig");
	ClassChangeLightSmall1 = GetAnimTextureHandle(m_WindowName $ ".ClassChangeLightSmall1");

	// Е¬·ЎЅєєЇ°ж№и°жЕШЅєГД
	ClassBgMain_Big = GetTextureHandle(m_WindowName $ ".ClassBgMain_Big");
	ClassBgMain_Small1 = GetTextureHandle(m_WindowName $ ".ClassBgMain_Small1");

	// Е¬·ЎЅєєЇ°ж№цЖ°	
	ClassFrameBtn1 = GetButtonHandle(m_WindowName $ ".ClassFrameBtn1");

	// Е¬·ЎЅєєЇ°жё¶Е©
	ClassMarkBig = GetTextureHandle(m_WindowName $ ".ClassMarkBig");
	ClassMarkSmall1 = GetTextureHandle(m_WindowName $ ".ClassMarkSmall1");
	txtClassName = GetTextBoxHandle(m_WindowName $ ".txtClassName");
	txtSP = GetTextBoxHandle(m_WindowName $ ".txtSP");
	txtName1 = GetTextBoxHandle(m_WindowName $ ".txtName1");
	txtName2 = GetTextBoxHandle(m_WindowName $ ".txtName2");
	txtHeadPledge = GetTextBoxHandle(m_WindowName $ ".txtHeadPledge");
	txtPledge = GetTextBoxHandle(m_WindowName $ ".txtPledge");
	txtLvHead = GetTextBoxHandle(m_WindowName $ ".txtLvHead");
	txtLvName = GetTextBoxHandle(m_WindowName $ ".txtLvName");
	txtHeadRank = GetTextBoxHandle(m_WindowName $ ".txtHeadRank");
	txtRank = GetTextBoxHandle(m_WindowName $ ".txtRank");
	texHP = GetStatusBarHandle(m_WindowName $ ".texHP");
	texMP = GetStatusBarHandle(m_WindowName $ ".texMP");
	texExp = GetStatusBarHandle(m_WindowName $ ".texExp");
	texCP = GetStatusBarHandle(m_WindowName $ ".texCP");
	txtPhysicalAttack = GetTextBoxHandle(m_WindowName $ ".txtPhysicalAttack");
	txtPhysicalDefense = GetTextBoxHandle(m_WindowName $ ".txtPhysicalDefense");
	txtHitRate = GetTextBoxHandle(m_WindowName $ ".txtHitRate");
	txtCriticalRate = GetTextBoxHandle(m_WindowName $ ".txtCriticalRate");
	txtPhysicalAttackSpeed = GetTextBoxHandle(m_WindowName $ ".txtPhysicalAttackSpeed");
	txtMagicalAttack = GetTextBoxHandle(m_WindowName $ ".txtMagicalAttack");
	txtMagicDefense = GetTextBoxHandle(m_WindowName $ ".txtMagicDefense");
	txtPhysicalAvoid = GetTextBoxHandle(m_WindowName $ ".txtPhysicalAvoid");
	txtGmMoving = GetTextBoxHandle(m_WindowName $ ".txtGmMoving");
	txtMovingSpeed = GetTextBoxHandle(m_WindowName $ ".txtMovingSpeed");
	txtMagicCastingSpeed = GetTextBoxHandle(m_WindowName $ ".txtMagicCastingSpeed");
	txtHeadMovingSpeed = GetTextBoxHandle(m_WindowName $ ".txtHeadMovingSpeed");
	txtHeadMagicCastingSpeed = GetTextBoxHandle(m_WindowName $ ".txtHeadMagicCastingSpeed");
	txtSTR = GetTextBoxHandle(m_WindowName $ ".txtSTR");
	txtDEX = GetTextBoxHandle(m_WindowName $ ".txtDEX");
	txtCON = GetTextBoxHandle(m_WindowName $ ".txtCON");
	txtINT = GetTextBoxHandle(m_WindowName $ ".txtINT");
	txtWIT = GetTextBoxHandle(m_WindowName $ ".txtWIT");
	txtMEN = GetTextBoxHandle(m_WindowName $ ".txtMEN");
	txtCriminalRate = GetTextBoxHandle(m_WindowName $ ".txtCriminalRate");
	txtPVP = GetTextBoxHandle(m_WindowName $ ".txtPVP");
	txtSociality = GetTextBoxHandle(m_WindowName $ ".txtSociality");
	txtBonusVote = GetTextBoxHandle(m_WindowName $ ".txtRemainSulffrage");
	txtRaidPoint = GetTextBoxHandle(m_WindowName $ ".txtRaidPoint");
	texHero = GetTextureHandle(m_WindowName $ ".texHero");
	texPledgeCrest = GetTextureHandle(m_WindowName $ ".texPledgeCrest");
	txtAttrAttackType = GetTextBoxHandle(m_WindowName $ ".txtAttrAttackType");
	txtAttrAttackValue = GetTextBoxHandle(m_WindowName $ ".txtAttrAttackValue");
	txtAttrDefenseValFire = GetTextBoxHandle(m_WindowName $ ".txtAttrDefenseValFire");
	txtAttrDefenseValWater = GetTextBoxHandle(m_WindowName $ ".txtAttrDefenseValWater");
	txtAttrDefenseValWind = GetTextBoxHandle(m_WindowName $ ".txtAttrDefenseValWind");
	txtAttrDefenseValEarth = GetTextBoxHandle(m_WindowName $ ".txtAttrDefenseValEarth");
	txtAttrDefenseValHoly = GetTextBoxHandle(m_WindowName $ ".txtAttrDefenseValHoly");
	txtAttrDefenseValUnholy = GetTextBoxHandle(m_WindowName $ ".txtAttrDefenseValUnholy");
	VitalityTex = GetTextureHandle(m_WindowName $ ".LifeForceTex");
	txtLUC = GetTextBoxHandle(m_WindowName $ ".txtLUC");
	txtCHA = GetTextBoxHandle(m_WindowName $ ".txtCHA");
	texVP = GetStatusBarHandle(m_WindowName $ ".texVP");//ldw //branch121212
	AbilityOpen = GetButtonHandle(m_WindowName $ ".AbilityOpen");//ldw
	txtHeadSTR = GetTextBoxHandle("DetailStatusWnd.txtHeadSTR");
	txtHeadDEX = GetTextBoxHandle("DetailStatusWnd.txtHeadDEX");
	txtHeadCON = GetTextBoxHandle("DetailStatusWnd.txtHeadCON");
	txtHeadINT = GetTextBoxHandle("DetailStatusWnd.txtHeadINT");
	txtHeadWIT = GetTextBoxHandle("DetailStatusWnd.txtHeadWIT");
	txtHeadMEN = GetTextBoxHandle("DetailStatusWnd.txtHeadMEN");
	txtHeadLUC = GetTextBoxHandle("DetailStatusWnd.txtHeadLUC");
	txtHeadCHA = GetTextBoxHandle("DetailStatusWnd.txtHeadCHA");
	txtHeadSTR.SetTooltipCustomType(MakeTooltipSimpleText(GetSystemString(3366), 154));
	txtHeadDEX.SetTooltipCustomType(MakeTooltipSimpleText(GetSystemString(3368), 154));
	txtHeadCON.SetTooltipCustomType(MakeTooltipSimpleText(GetSystemString(3370), 154));
	txtHeadINT.SetTooltipCustomType(MakeTooltipSimpleText(GetSystemString(3367), 154));
	txtHeadWIT.SetTooltipCustomType(MakeTooltipSimpleText(GetSystemString(3369), 154));
	txtHeadMEN.SetTooltipCustomType(MakeTooltipSimpleText(GetSystemString(3371), 154));
	txtHeadLUC.SetTooltipCustomType(MakeTooltipSimpleText(GetSystemString(3372), 154));
	txtHeadCHA.SetTooltipCustomType(MakeTooltipSimpleText(GetSystemString(3373), 154));
	APActive = GetAnimTextureHandle("DetailStatusWnd.APActive");
	isDualClass = false;
}

//branch
// F2P ј­єсЅє И°·В °іј± - gorillazin
function UpdateVp(int vitality)//ldw јцБ¤
{
	if(vitality < 2205 && vitality > 0)
	{
		// ГЦґл 140000 АП °жїм 1806 єОЕН ЅєЕИГўїЎ ґ«±ЭАМ ѕшѕо vp°Ў ѕшѕо єёАОґЩґВ јцБ¤ і»їлА» А§ЗС ї№їЬ Гіё® , statusbarWnd, lobbyMenuWnd їЎµµ °°АМ Гіё® µЗѕъАЅ ldw 2011.02.23
		texVP.SetPoint(2205, MaxVitality);
	}
	else
	{
		texVP.SetPoint(vitality, MaxVitality);
	}
}

// АМ functionАЗ ЗКїд ѕшґВ єОєР БЦј® Гіё®
//end of branch
function OnEnterState(name a_CurrentStateName)
{
	HandleUpdateUserInfo();
}

function OnShow()
{
	HandleUpdateUserInfo();
}

function OnEvent(int Event_ID, string param)
{
	if(Event_ID == EV_UpdateUserInfo)
	{
		HandleUpdateUserInfo();		
	}
	else if(Event_ID == EV_UpdateHennaInfo)
	{
		HandleUpdateHennaInfo(param);
	}
	else if(Event_ID == EV_UpdateMyHP)
	{
		HandleUpdateStatusGauge(param, 0);
	}
	else if(Event_ID == EV_UpdateMyMaxHP)
	{
		HandleUpdateStatusGauge(param, 0);
	}
	else if(Event_ID == EV_UpdateMyMP)
	{
		HandleUpdateStatusGauge(param,1);
	}
	else if(Event_ID == EV_UpdateMyMaxMP)
	{
		HandleUpdateStatusGauge(param,1);
	}
	else if(Event_ID == EV_UpdateMyCP)
	{
		HandleUpdateStatusGauge(param,2);
	}
	else if(Event_ID == EV_UpdateMyMaxCP)
	{
		HandleUpdateStatusGauge(param,2);
	}
	else if(Event_ID == EV_ToggleDetailStatusWnd)
	{
		HandleToggle();
	}
	else if(Event_ID == EV_VitalityPointInfo)	// И°·ВБ¤єёѕчµҐАМЖ®
	{
		HandleVitalityPointInfo(param);
	}
	else if(Event_ID == EV_NotifySubjob)
	{
		//Debug("-------------------------------");
		//Debug("EV_NotifySubjob:" @ param);
		// updateSubjobLastEvent = Event_ID;
		updateSubjobInfo(param, Event_ID);	

	}
	else if(Event_ID == EV_CreatedSubjob)
	{		
		updateSubjobInfo(param, Event_ID);
		
		// ѕЖ·№іЄ АО °жїм АЪµї ї­±в ±вґЙА» »зїл ЗПБц ѕКґВґЩ.
		if(Me.IsShowWindow() == false && !getInstanceUIData().getIsArenaServer())
		{
			Me.ShowWindow();
			Me.SetFocus();
		}
		ExecuteEvent(EV_NPCDialogWndHide);
	}
	else if(Event_ID == EV_ChangedSubjob)
	{
		// updateSubjobLastEvent = Event_ID;
		//Debug("EV_ChangedSubjob" @ param);
		updateSubjobInfo(param, Event_ID);
		ExecuteEvent(EV_NPCDialogWndHide);
	}

	else if	(Event_ID == EV_DialogOK)
	{
		HandleDialogOK();
	}
	else if	(Event_ID == EV_DialogCancel)
	{
		if(DialogIsMine())
		{
			Me.EnableWindow();
		}
	}
	//~ else if(Event_ID == EV_ShowWindow)
	//~ {
		//~ if(param == DetailStatusWnd)
		//~ {
			//~ ToggleOpenCharInfoWnd();
		//~ }
	//~ }

	//branch
	// F2P ј­єсЅє И°·В °іј± - gorillazin
	else if(Event_ID == EV_VitalityEffectInfo)
	{
		HandleVitalityEffectInfo(param);
	}
	//
	//end of branch
}

function hideAlchemyWindow(string winName) 
{	
	if(class'UIAPI_WINDOW'.static.IsShowWindow(winName))
	{
		class'UIAPI_WINDOW'.static.HideWindow(winName);
	}	
}

/**
 *  ГЦГКµйѕоїАґВј­єкАв, µаѕуµоАЗБ¤єёё¦№ЮѕЖ±в·ПЗСґЩ.
 **/
function updateSubjobInfo(string param, int Event_ID)
{	
	local int count, i;

	local UserInfo myUserInfo;

	local bool bFlag;

	local SubjobInfo tempSubjobInfo;

	// БѕБ·
	//local int  race;

	isDualClass = false;

	hideAlchemyWindow("AlchemyItemConversionWnd");			
	hideAlchemyWindow("AlchemyMixCubeWnd");

	// saveUpdateSubjobInfoParam = param;

	//GetMyUserInfo(myUserInfo);
	GetPlayerInfo(myUserInfo);


//	debug("ЗцАз Е¬·ЎЅє : " @ GetClassType(myUserInfo.nSubClass));
//	debug("ЗцАзАьБч»уЕВ: " @ GetClassTransferDegree(myUserInfo.nSubClass));

	// ЗШґзБчѕчјцё¦ё®ЕП№ЮґВґЩ.
	ParseInt(param, "Count"  , count);
	
	// ЗцАзБЯАОЕ¬·ЎЅєѕЖАМµр
	ParseInt(param, "currentSubjobClassID", CurrentSubjobClassID);

//	debug("ЗцАзАьБч»уЕВ->: " @ GetClassTransferDegree(CurrentSubjobClassID));
	//Debug("ЗцАзclassID ->: " @ CurrentSubjobClassID);
	// »иБ¦
	if(subjobInfoArray.Length > 0)
	{
		subjobInfoArray.Remove(0, subjobInfoArray.Length);
	}

	bFlag = false;
		

	
	ParseInt(param, "Race", race);

//	debug("БѕБ· race:" @ Race);
	//debug("БѕБ·АМё§ :" @ getRaceString(Race));

	// ј­єкАвё®ЅєЖ®ё¦№ЮґВґЩ.(0ёЮАО, ј­єкµаѕу°і1,2,3(ГЦґл))
	for(i = 0; i < count; i++)
	{
		subjobInfoArray.Insert(subjobInfoArray.Length, 1);

		ParseInt(param, "SubjobClassID_" $ i, subjobInfoArray[i].ClassID);
		ParseInt(param, "SubjobID_"      $ i, subjobInfoArray[i].Id);
		ParseInt(param, "SubjobLevel_"   $ i, subjobInfoArray[i].Level);
		ParseInt(param, "SubjobType_"    $ i, subjobInfoArray[i].Type);

		// Debug("subjobInfoArray[i].ClassID" @ subjobInfoArray[i].ClassID);
		// Debug("subjobInfoArray[i].Id" @ subjobInfoArray[i].Id);
		// Debug("subjobInfoArray[i].Level" @ subjobInfoArray[i].Level);
		// Debug("subjobInfoArray[i].Type" @ subjobInfoArray[i].Type);

		// µаѕу Е¬·ЎЅє°Ў ЗПіЄ¶уµµ АЦґЩёй..
		if(subjobInfoArray[i].Type == 1) 
		{ 
			isDualClass = true; 
		//	Debug("µаѕуАМ АЦґЩ! ");
		}
	}
	for(i = 0; i < count; i++)
	{
		if(CurrentSubjobClassID == subjobInfoArray[i].ClassID)
		{
//			Debug("°°ґЩ subjobInfoArray[i].ClassID" @ subjobInfoArray[i].ClassID);
			//			currentSubjobClassNum = i;

			// ј­·О±іГј
			tempSubjobInfo = subjobInfoArray[i];
			subjobInfoArray[i] = subjobInfoArray[0];
			subjobInfoArray[0] = tempSubjobInfo;

			currentSubjobClassNum = 0;
			break;
		}
	}

//	debug("subjobInfoArray ::::: " @ subjobInfoArray.Length);

	// ј­єк Е¬·ЎЅє°Ў АЦґЩёй.. №цЖ°µйАМ єёАМµµ·П ГК±вИ­
	if(count > 0) initClassChangeButton(true);
	else initClassChangeButton(false);

	// БчѕчБ¤єёѕчµҐАМЖ®
	//  1,2,3 ±оБцµйѕоїГјцАЦАЅ. ЗцАзДіёЇЕН1 + ј­№ц(µаѕу) 3°і= ГС4°і
	for(i = 1; i < count; i++)
	{
		if(i < count)
		{
			// Debug("-------------" @ i);
//			Debug("subjobInfoArray[i].ClassID" @ subjobInfoArray[i].ClassID);
			//---- 3Бѕ№цЖ°ѕчµҐАМЖ®-----
			// Debug("№цЖ°№иДЎАЫАє°Е" @ subjobInfoArray[i].ClassID);

			// АМАьАЗ»уЕВїН°°Ає°НАМїґґЩёй.. ±фєэАМґВАМЖСЖ®
			if(beforeSubjobInfo.ClassID == subjobInfoArray[i].ClassID) bFlag = true;
			else bFlag = false;

			// Debug("ј­єк, ёЮАО°Л»з subjobInfoArray[i].Type : " @subjobInfoArray[i].Type);
			// debug("GetClassTransferDegree(myUserInfo.nSubClass)"@ GetClassTransferDegree(myUserInfo.nSubClass));
			// debug("БѕБ· race:" @ myUserInfo.Race);
			// debug("БѕБ·АМё§ :" @ getRaceString(myUserInfo.Race));

			// ёЮАО:0, µаѕу:1 ј­єк:2

			// ј­єк: Г»»ц
			if(subjobInfoArray[i].Type == 2)
			{
				if(GetClassTransferDegree(subjobInfoArray[i].ClassID) >= 1)
					setclasstexture(i, "l2ui_ct1.playerstatuswnd_ClassBgSub_Small", "l2ui_ct1.PlayerStatusWnd_ClassMark_" $ subjobInfoArray[i].ClassID $ "_Small", bFlag);
				else 
					setclasstexture(i, "l2ui_ct1.playerstatuswnd_ClassBgSub_Small", "l2ui_ct1.PlayerStatusWnd_ClassMark_" $ getRaceString(race) $ "_Small", bFlag);
			}			
			// µаѕу : ЖД¶ы
			else if(subjobInfoArray[i].Type == 1)
			{	
				if(GetClassTransferDegree(subjobInfoArray[i].ClassID) >= 1)
					setClassTexture(i, "l2ui_ct1.PlayerStatusWnd_ClassBgDual_Small", "l2ui_ct1.PlayerStatusWnd_ClassMark_" $ subjobInfoArray[i].ClassID $ "_Small", bFlag);
				else
					setClassTexture(i, "l2ui_ct1.PlayerStatusWnd_ClassBgDual_Small", "l2ui_ct1.PlayerStatusWnd_ClassMark_" $ getRaceString(race) $ "_Small", bFlag);
			}
			//ёЮАО :»Ў°­
			else if(subjobInfoArray[i].Type == 0)
			{
				if(GetClassTransferDegree(subjobInfoArray[i].ClassID) >= 1)
					setClassTexture(i, "l2ui_ct1.PlayerStatusWnd_ClassBgMain_Small", "l2ui_ct1.PlayerStatusWnd_ClassMark_" $ subjobInfoArray[i].ClassID $ "_Small", bFlag);
				else
					setClassTexture(i, "l2ui_ct1.PlayerStatusWnd_ClassBgMain_Small", "l2ui_ct1.PlayerStatusWnd_ClassMark_" $ getRaceString(race) $ "_Small", bFlag);
			}

			GetButtonHandle(m_WindowName $ ".ClassFrameBtn" $ i).EnableWindow();
			GetButtonHandle(m_WindowName $ ".ClassFrameBtn" $ i).ShowWindow();

			// Debug("№цЖ° " @ m_WindowName $ ".ClassFrameBtn" $ i);
			// GetButtonHandle(m_WindowName $ ".ClassFrameBtn" $ i + 1).ShowWindow();

			GetButtonHandle(m_WindowName $ ".ClassFrameBtn" $ i).SetTexture("L2UI_ct1.PlayerStatusWnd_ClassFrameBtn",
																			 "L2UI_ct1.PlayerStatusWnd_ClassFrameBtn_down",
																			 "L2UI_ct1.PlayerStatusWnd_ClassFrameBtn_over");

			GetButtonHandle(m_WindowName $ ".ClassFrameBtn" $ i).SetTooltipCustomType(subjobButtonToolTips(i));
			GetTextureHandle(m_WindowName $ ".ClassSlotBlank" $ i).HideWindow();
		}
		//ѕЖёЈ ЕЧАМѕо БѕБ·АМ ѕЖґТ °жїмїЎёё єёї© БШґЩ.
		else if(race != 6) 
		{
			
			// Debug("------АЪ№°ји -------" @ i);
			// №цЖ°єсИ°јє, АЪ№°јиєёАМµµ·ПјјЖГ
			setClassTexture(i, "", "", false);
			// GetButtonHandle(m_WindowName $ ".ClassFrameBtn" $ i + 1).HideWindow();
			
			GetButtonHandle(m_WindowName $ ".ClassFrameBtn" $ i).DisableWindow();
			GetButtonHandle(m_WindowName $ ".ClassFrameBtn" $ i).SetTexture("L2UI_ct1.Misc_DF_Blank",
																			  "L2UI_ct1.Misc_DF_Blank",
																			  "L2UI_ct1.Misc_DF_Blank");

			GetButtonHandle(m_WindowName $ ".ClassFrameBtn" $ i).SetTooltipCustomType(subjobButtonToolTips(-1));			

			GetTextureHandle(m_WindowName $ ".ClassSlotBlank" $ i).ShowWindow();
		}
	}

	// ---- Е«Е¬·ЎЅєАМ№МБцѕчµҐАМЖ®-----
	// 2ВчАьБчАМ»уАМ¶уёй..

	// 3Вч АьБч АМ»уЗС ДіёЇЕН°Ў АЦ°н , ј­єк Ав 1°і АМ»у АЦґЩёй, БцБ¤ЗС Е¬·ЎЅє ѕЖАМДЬА» Аыїл
	//if(GetClassTransferDegree(myUserInfo.nSubClass) > 1 && count > 1)

	// debug("myUserInfo.nSubClass >: " @ myUserInfo.nSubClass);
	// debug("GetClassTransferDegree(myUserInfo.nSubClass) >: " @ GetClassTransferDegree(myUserInfo.nSubClass));

	// ёЮАО:0, µаѕу:1 ј­єк:2
	// 4Вч АьБч µИ ДіёЇЕН¶уёй..
//	Debug("subjobInfoArray[currentSubjobClassNum].ClassID" @ subjobInfoArray[currentSubjobClassNum].ClassID);
	if(GetClassTransferDegree(subjobInfoArray[currentSubjobClassNum].ClassID) >= 1)
	{
		// ±іГјµИ»уЕВ¶уёйАМЖСЖ®Гв·В
		if(EV_ChangedSubjob == Event_ID) bFlag = true;
		else bFlag = false;

		// debug("ј­єкѕЦµй:" @ subjobInfoArray[currentSubjobClassNum].Type);
		// ј­єкёйГ»»ц
		if(subjobInfoArray[currentSubjobClassNum].Type == 2)
		{
			setClassTexture(0, "l2ui_ct1.PlayerStatusWnd_ClassBgSub_Big", 
							   "l2ui_ct1.PlayerStatusWnd_ClassMark_" $ subjobInfoArray[currentSubjobClassNum].ClassID $ "_Big", bFlag);
			
		}
		// µаѕу,ёЮАОАє»Ў°­0: ёЮАО, 1 µаѕу
		else if(subjobInfoArray[currentSubjobClassNum].Type == 1)
		{			
			setClassTexture(0, "l2ui_ct1.PlayerStatusWnd_ClassBgDual_Big", 
							   "l2ui_ct1.PlayerStatusWnd_ClassMark_" $ subjobInfoArray[currentSubjobClassNum].ClassID $ "_Big", bFlag);
			
		}
		else if(subjobInfoArray[currentSubjobClassNum].Type == 0)
		{
			setClassTexture(0, "l2ui_ct1.PlayerStatusWnd_ClassBgMain_Big", 
							   "l2ui_ct1.PlayerStatusWnd_ClassMark_" $ subjobInfoArray[currentSubjobClassNum].ClassID $ "_Big", bFlag);

		}

	}
	else
	{
		// ј­єкёйГ»»ц
		if(subjobInfoArray[currentSubjobClassNum].Type == 2)
		{
			setClassTexture(0, "l2ui_ct1.PlayerStatusWnd_ClassBgSub_Big", 
							   "l2ui_ct1.PlayerStatusWnd_ClassMark_" $ getRaceString(race) $ "_Big", false);
			
		}
		// µаѕу,ёЮАОАє»Ў°­0: ёЮАО, 1 µаѕу
		else if(subjobInfoArray[currentSubjobClassNum].Type == 1)
		{			
				
			// ј­єкАвА» ѕИЗС.. 1Вч АьБчµµ ѕИЗС АЇАъАЗ ѕЖАМДЬ
			//initClassChangeButton(false);
			// °ўБѕБ·є°ЅЙєјАМ№МБц
			setClassTexture(0, "l2ui_ct1.PlayerStatusWnd_ClassBgDual_Big", 
							   "l2ui_ct1.PlayerStatusWnd_ClassMark_" $ getRaceString(race) $ "_Big", false);		
		}
		else if(subjobInfoArray[currentSubjobClassNum].Type == 0)
		{
			setClassTexture(0, "l2ui_ct1.PlayerStatusWnd_ClassBgMain_Big", 
							   "l2ui_ct1.PlayerStatusWnd_ClassMark_" $ getRaceString(race) $ "_Big", false);		

		}
		
		// UserInfo(
		// јцБ¤ЗШѕЯЗФrace
		// Debug("БѕБ·є°---::" @ myUserInfo.race);
		
		//GetRaceTicketString(int Blessed);
	}

	beforeSubjobInfo = subjobInfoArray[currentSubjobClassNum];

	// Type : 0 ёЮАО, 1 µаѕу. 2 ј­єк
	// debug("myUserInfo.Class : " @ GetClassRoleName(classID));
	
		//native final function string GetClassRoleName(classID) ;
	// CurrentSubjobClassID=3 Count=3 SubjobID_1=1 SubjobClassID_1=117 SubjobLevel_1=55 SubjobType_1=0 SubjobID_2=1 SubjobClassID_2=73 SubjobLevel_2=55 SubjobType_2=1 SubjobID_3=1 SubjobClassID_3=131 SubjobLevel_3=55 SubjobType_3=2
	// CurrentSubjobClassID=3 Count=3 SubjobID_1=1 SubjobClassID_1=117 SubjobLevel_1=55 SubjobType_1=1 SubjobID_2=1 SubjobClassID_2=73 SubjobLevel_2=55 SubjobType_2=1 SubjobID_3=1 SubjobClassID_3=131 SubjobLevel_3=55 SubjobType_3=1 
	// CurrentSubjobClassID=3 Count=1 SubjobID_1=1 SubjobClassID_1=134 SubjobLevel_1=55 SubjobType_1=1
}

/** ґЩАМѕу·О±Ч№ЪЅєOK Е¬ёЇЅГ*/
function HandleDialogOK()
{
	local int dialogValue;
	local ItemInfo infItem;

	
	if(DialogIsMine())
	{
		if(DialogGetID() == DIALOG_DetailStatusWnd)
		{
			dialogValue = DialogGetReservedInt();
			switch(dialogValue)
			{
				// subjobInfoArray[dialogValue].Type  // 0ёЮАО, 1µаѕу, 2ј­єк
				case 0 : 
				case 1 : 
				case 2 : 
				case 3 :
						ExecuteEvent(EV_NPCDialogWndHide);
						// Debug("subjobInfoArray[dialogValue].Type  "  @ subjobInfoArray[dialogValue].Type);
						// ёЮАО, µаѕуАМ¶уёй..
						if(subjobInfoArray[dialogValue].Type == 0)
						{
							// ЅєЕі №шИЈАУ 
							infItem.ID.ClassID = 1566;

							//infItem.ID.ServerID = 1566;
							// ёЮАОЕ¬·ЎЅє·ОєЇ°ж
							// Debug("ёЮАО ЅєЕі»зїл" @ infItem.ID.ClassID);
							UseSkill(infItem.ID, int(EShortCutItemType.SCIT_SKILL));
							// ExecuteCommand("//use_skill 1566 1");
						}
						else
						{
							// µаѕу АМ¶уёй.. Гіё®
							if(subjobInfoArray[dialogValue].Type == 1) 
							{
								// ЗцАз ѕшАЅ
								// empty
							}

							// 1567, 1568, 1569 јшј­µЗ·О.. ј­єкЅЅ·Ф1,2,3 єЇ°ж
							//infItem.ID.ClassID = 1567 +(dialogValue - 1);
							infItem.ID.ClassID = 1567;
							//infItem.ID.ServerID = 1568 +(dialogValue - 1);

							// Debug("ЅєЕі»зїл" @ infItem.ID.ClassID);
							UseSkill(infItem.ID, int(EShortCutItemType.SCIT_SKILL));
							// ExecuteCommand("//use_skill " $ String(infItem.ID.ClassID) $ " 1");
						}
			}

			// єЇ°жЅєЕі»зїл
			Me.EnableWindow();
		}
	}
}

/**
 * ґЩАМѕу·О±Ч№ЪЅє(ј­єкЕ¬·ЎЅє·ОєЇЅЕЗТБц№°ѕоєёґВґЩАМѕу·О±Ч)
 * 0..1..2 
 **/
function askDialogBox(int currentClickSubjobNum)
{
	local WindowHandle m_dialogWnd;	
	m_dialogWnd = GetWindowHandle("DialogBox");
	if(!m_dialogWnd.IsShowWindow())
	{
		// ЗцАзЕ¬·ЎЅєїНЕ¬ёЇЗСј­єкЕ¬·ЎЅє°Ў°°БцѕКґЩёй.. єЇЅЕА»№°ѕоє»ґЩ.
		if(subjobInfoArray[0].ClassID != subjobInfoArray[currentClickSubjobNum].ClassID)
		{
			DialogSetID(DIALOG_DetailStatusWnd);

			DialogSetReservedInt(currentClickSubjobNum);

			// ёЮАОЕ¬·ЎЅє, µТєкёµ°Е, ј­єкјТїпЕЧАМДї, ·ОєЇ°жЗПЅГ°ЪЅАґП±о?   АМ·±ЅД
			Me.DisableWindow();
			DialogSetCancelD(DIALOG_DetailStatusWnd);
			DialogShow(DialogModalType_Modalless, DialogType_Warning, 
						MakeFullSystemMsg(GetSystemMessage(3280), 
										   "<" $ GetClassType(subjobInfoArray[0].ClassID) $ "> " $ getSubjobTypeStr(subjobInfoArray[0].Type) $ "", 
										   "<" $ GetClassType(subjobInfoArray[currentClickSubjobNum].ClassID) $ "> "$ getSubjobTypeStr(subjobInfoArray[currentClickSubjobNum].Type) $ ""),
										   string(Self));
		}
	}
}


/***
 *  ЗцАзј­єкАвЅєЖ®ёµА»ё®ЕП№ЮґВґЩ.
 **/
function string getSubjobTypeStr(int nType)
{	
	local string tempStr;
	
	// 0 ёЮАО, 1 µаѕу(ЗцАзґВёЮАОАё·ОГіё®-µаѕуАМ¶уґВїлѕоґВѕЖБч»зїлѕИЗФ) , 2 ј­єк
	switch(nType)
	{
		case 0 : tempStr = GetSystemString(2340); break; // ёЮАОЕ¬·ЎЅє
		case 1 : tempStr = GetSystemString(2737); break; // µаѕуЕ¬·ЎЅє
		case 2 : tempStr = GetSystemString(2339); break; // ј­єкЕ¬·ЎЅє
	}

	return tempStr;
}

/**
 * OnClickButton
 **/
function OnClickButton(string strID)
{
	// debug("strID : " $ strID);
	switch(strID)
	{
		case "AbilityOpen":
			// Вчїш АМµї ИД 
			if(class'UIAPI_WINDOW'.static.IsShowWindow("AbilityUIWnd"))
			{
				class'UIAPI_WINDOW'.static.HideWindow("AbilityUIWnd");
			}
			else
			{
				toggleWindow("AbilityUIWnd", true, true);
			}

		break;

		case "ClassFrameBtn1" : if(GetButtonHandle(m_WindowName $ ".ClassFrameBtn1").IsEnableWindow() && subjobInfoArray.Length > 1) 
								{ ExecuteEvent(EV_NPCDialogWndHide); effectAniTexture(1); askDialogBox(1); } break;
	}

	 
}

/**
 *  №цЖ°ѕЦґПАМЖСЖ®(1 ~ 3 №ш№цЖ°Иї°ъ) 
 **/
function effectAniTexture(int targetType)
{
	GetAnimTextureHandle(m_WindowName $ ".ClassChangeLightSmall" $ targetType).SetTexture("l2ui_ct1.PlayerStatusWnd_ClassChangeLightSmall_00");
	GetAnimTextureHandle(m_WindowName $ ".ClassChangeLightSmall" $ targetType).ShowWindow();
	GetAnimTextureHandle(m_WindowName $ ".ClassChangeLightSmall" $ targetType).SetLoopCount(1);
	GetAnimTextureHandle(m_WindowName $ ".ClassChangeLightSmall" $ targetType).Stop();
	GetAnimTextureHandle(m_WindowName $ ".ClassChangeLightSmall" $ targetType).Play();
}

/**
 * setClassTexture 
 * 
 * Е¬·ЎЅєєЇ°жЅГ, ЕШЅєГД±іГј, БѕБ·є°ё¶Е©ЕШЅєГД, єюВ¦°Её®ґВИї°ъєёї©БЩ°НАОБц..
 **/
function setClassTexture(int targetType, string bgTexture, string markTextureStr, bool effectFlag)
{
	if(targetType == 0)
	{

		// Е«ёЮАОЕ¬·ЎЅє(ЗцАзЕ¬·ЎЅє)

		// №и°ж
		ClassBgMain_Big.SetTexture(bgTexture);
		// debug("bgTexture" @ bgTexture);

		// ё¶Е©єЇ°ж
		//debug("markTextureStr : " @ markTextureStr);
		ClassMarkBig.SetTexture(markTextureStr);
		// ClassMarkBig.HideWindow();

		// ±фєэАМґВИї°ъєёї©БЦ±в
		if(effectFlag == true)
		{			
			GetAnimTextureHandle(m_WindowName $ ".ClassChangeLightBig").SetTexture("l2ui_ct1.PlayerStatusWnd_ClassChangeLightBig_00");
			GetAnimTextureHandle(m_WindowName $ ".ClassChangeLightBig").ShowWindow();
			GetAnimTextureHandle(m_WindowName $ ".ClassChangeLightBig").SetLoopCount(1);
			GetAnimTextureHandle(m_WindowName $ ".ClassChangeLightBig").Stop();
			GetAnimTextureHandle(m_WindowName $ ".ClassChangeLightBig").Play();
		}
	}
	else
	{
		// №и°ж
		GetTextureHandle(m_WindowName $ ".ClassBgMain_Small" $ targetType).SetTexture(bgTexture);
		
		// GetTextureHandle(m_WindowName $ ".ClassBgMain_Small" $ targetType).SetAlpha(255);
		// Debug("№и°жbgTexture " @ bgTexture);

		// ё¶Е©єЇ°ж
		GetTextureHandle(m_WindowName $ ".ClassMarkSmall" $ targetType).SetTexture(markTextureStr);
		GetTextureHandle(m_WindowName $ ".ClassMarkSmall" $ targetType).ShowWindow();
		

		// ±фєэАМґВИї°ъєёї©БЦ±в
		//GetTextureHandle(m_WindowName $ ".ClassChangeLightSmall" $ targetType).SetTexture("");		

		if(effectFlag == true)
		{			
			effectAniTexture(targetType);
		}
	}
}


function HandleToggle()
{
	if(getInstanceUIData().getIsClassicServer()) return;
	if(m_hOwnerWnd.IsShowWindow())
	{
		m_hOwnerWnd.HideWindow();
	}
	else
	{
		m_hOwnerWnd.ShowWindow();
		m_hOwnerWnd.SetFocus();
	}
}

//~ function ToggleOpenCharInfoWnd()
//~ {
	//~ if(DetailStatusWnd.IsShowWindow() == true)
	//~ {
		//~ HideWindow("DetailStatusWnd");
		//~ PlaySound("InterfaceSound.charstat_close_01");
	//~ }
	//~ else
	//~ {
		//~ ShowWindowWithFocus("DetailStatusWnd");
		//~ PlaySound("InterfaceSound.charstat_open_01");			
	//~ }
//~ }

//°ФАМБцёёѕчµҐАМЖ®
function HandleUpdateStatusGauge(string param, int Type)
{
	local int ServerID;
	
	if(m_hOwnerWnd.IsShowWindow())	// lpislhy
	{
		ParseInt(param, "ServerID", ServerID);
		if(m_UserID == ServerID)
			HandleUpdateUserGauge(Type);
	}
}

//ЗГ·№АМѕоАЗ№®ѕзБ¤єёГіё®
function HandleUpdateHennaInfo(string param)
{
	ParseInt(param, "HennaID", m_HennaInfo.HennaID);
	ParseInt(param, "ClassID", m_HennaInfo.ClassID);
	ParseInt(param, "Num", m_HennaInfo.Num);
	ParseInt(param, "Fee", m_HennaInfo.Fee);
	ParseInt(param, "CanUse", m_HennaInfo.CanUse);
	ParseInt(param, "INTnow", m_HennaInfo.INTnow);
	ParseInt(param, "INTchange", m_HennaInfo.INTchange);
	ParseInt(param, "STRnow", m_HennaInfo.STRnow);
	ParseInt(param, "STRchange", m_HennaInfo.STRchange);
	ParseInt(param, "CONnow", m_HennaInfo.CONnow);
	ParseInt(param, "CONchange", m_HennaInfo.CONchange);
	ParseInt(param, "MENnow", m_HennaInfo.MENnow);
	ParseInt(param, "MENchange", m_HennaInfo.MENchange);
	ParseInt(param, "DEXnow", m_HennaInfo.DEXnow);
	ParseInt(param, "DEXchange", m_HennaInfo.DEXchange);
	ParseInt(param, "WITnow", m_HennaInfo.WITnow);
	ParseInt(param, "WITchange", m_HennaInfo.WITchange);

	//ЅЕ±ФЅєЕИ Д«ё®Ѕєё¶ ·°Е°
	ParseInt(param, "LUCnow", m_HennaInfo.LUCnow);
	ParseInt(param, "LUCchange", m_HennaInfo.LUCchange);

	ParseInt(param, "CHAnow", m_HennaInfo.CHAnow);
	ParseInt(param, "CHAchange", m_HennaInfo.CHAchange);
}

function bool GetMyUserInfo(out UserInfo a_MyUserInfo)
{
	return GetPlayerInfo(a_MyUserInfo);
}

function String GetMovingSpeed(UserInfo a_UserInfo)
{
	local float MovingSpeed;
	local EMoveType	MoveType;
	local EEnvType	EnvType;

	// Moving Speed
	MoveType			= class'UIDATA_PLAYER'.static.GetPlayerMoveType();
	EnvType				= class'UIDATA_PLAYER'.static.GetPlayerEnvironment();

	// debug("MovingSpeed : STEP 1" $a_UserInfo.fNonAttackSpeedModifier);
	if(MoveType == MVT_FAST)
	{
		MovingSpeed = float(a_UserInfo.nGroundMaxSpeed) * a_UserInfo.fNonAttackSpeedModifier;
		// debug("MovingSpeed : STEP 2" $a_UserInfo.nGroundMaxSpeed);
		switch(EnvType)
		{
		case ET_UNDERWATER:
			MovingSpeed = float(a_UserInfo.nWaterMaxSpeed) * a_UserInfo.fNonAttackSpeedModifier;
			// debug("MovingSpeed : STEP 3"$a_UserInfo.nWaterMaxSpeed);
			break;
		case ET_AIR:
			MovingSpeed = float(a_UserInfo.nAirMaxSpeed) * a_UserInfo.fNonAttackSpeedModifier;
			// debug("MovingSpeed : STEP 4" $a_UserInfo.nAirMaxSpeed $"  " $a_UserInfo.fNonAttackSpeedModifier);
			break;
		}
	}
	else if(MoveType == MVT_SLOW)
	{
		MovingSpeed = float(a_UserInfo.nGroundMinSpeed) * a_UserInfo.fNonAttackSpeedModifier;
		// debug("MovingSpeed : STEP 5");
		switch(EnvType)
		{
		case ET_UNDERWATER:
			MovingSpeed = float(a_UserInfo.nWaterMinSpeed) * a_UserInfo.fNonAttackSpeedModifier;
			// debug("MovingSpeed : STEP 6" $a_UserInfo.nWaterMinSpeed);
			break;
		case ET_AIR:
			MovingSpeed = float(a_UserInfo.nAirMinSpeed) * a_UserInfo.fNonAttackSpeedModifier;
			// debug("MovingSpeed : STEP 7" $a_UserInfo.nAirMinSpeed);
			break;
		}
	}
	//debug("MovingSpeed : STEP 8 : " $ MovingSpeed);
	return String(int(MovingSpeed));
}

function float GetMyExpRate()
{
	return class'UIDATA_PLAYER'.static.GetPlayerEXPRate() * 100.0f;
}

//ЗГ·№АМѕо°ФАМБцБ¤єёГіё®
function HandleUpdateUserGauge(int Type)
{
	local int CurValue;
	local int MaxValue;
	local int vitality;
	local UserInfo Info;

	
	if(GetMyUserInfo(Info))
	{
		vitality = Info.nVitality;
		m_UserID = Info.nID;
		
		switch(Type)
		{
		case 0:
				CurValue = Info.nCurHP;
				MaxValue = Info.nMaxHP;
				UpdateHPBar(CurValue, MaxValue);
				break;
		case 1:
				CurValue = Info.nCurMP;
				MaxValue = Info.nMaxMP;
				UpdateMPBar(CurValue, MaxValue);
				break;
		case 2:
				CurValue = Info.nCurCP;
				MaxValue = Info.nMaxCP;
				UpdateCPBar(CurValue, MaxValue);
				break;
				UpdateVp(vitality);
		}
	}
}

//ЗГ·№АМѕоБ¤єёГіё®
function HandleUpdateUserInfo()
{
	if(m_hOwnerWnd.IsShowWindow())
	{
		UpdateInterface();
	}
}


function setSubjobSlot(bool isEr)
{

}

function UpdateInterface()
{
	local Rect rectWnd;
	local int Width1;
	local int Height1;
	local int Width2;
	local int Height2;
	
	local string	Name;
	local string	NickName;
	local color	NameColor;
	local color	NickNameColor;
	local int		SubClassID;
	local string	ClassName;
	local string	UserRank;
	local int		HP;
	local int		MaxHP;
	local int		MP;
	local int		MaxMP;
	local int		CP;
	local int		MaxCP;
	local INT64		SP;
	local int		Level;
	//local float		fExpRate;
	
	local int		PledgeID;
	local string	PledgeName;
	local texture	PledgeCrestTexture;
	local bool		bPledgeCrestTexture;
	local color	PledgeNameColor;
	
	local string	HeroTexture;
	local bool		bHero;
	local int		nNobless;
	
	local int		nSTR;
	local int		nDEX;
	local int		nCON;
	local int		nINT;
	local int		nWIT;
	local int		nMEN;
	local string	strTmp;
	//ЅЕ±ФЅєЕИ Д«ё®Ѕєё¶ ·°Е°
	local int		nLUC;
	local int		nCHA;
	
	local int		PhysicalAttack;
	local int		PhysicalDefense;
	local int		HitRate;
	local int		CriticalRate;
	local int PhysicalAttackSpeed;
	local int		MagicalAttack;
	local int		MagicDefense;
	local int		PhysicalAvoid;
	local String	MovingSpeed;
	local int		MagicCastingSpeed;

	local int		CriminalRate;
	local int		iNameColorRate;
	local string	strCriminalRate;
	local int		DualCount;
	local int		PKCount;
	local int		PvPPoint;
	
	local int		VoteCount;
	local int		BonusCount;
	local int		NegativeVoteCount;
	local int		Notoriety;

	local int       RaidPoint;

	// јУјєјцДЎ
	local int AttrAttackType;
	local int AttrAttackValue;
	local int AttrDefenseValFire;
	local int AttrDefenseValWater;
	local int AttrDefenseValWind;
	local int AttrDefenseValEarth;
	local int AttrDefenseValHoly;
	local int AttrDefenseValUnholy;
	local string AttrAttackTypeTxt;

	local int nMagicAvoid, nMagicHitRate, nMagicCriticalRate;
	
	//єЇЅЕ°ь·ГµҐАМЕН
	//local int nTransformID;
	local bool m_bPawnChanged;

	local UserInfo	info;
	
	//И°·В
	local int vitality;
	
	//ГК±вИ­
	texPledgeCrest.SetTexture("");
	
	rectWnd = m_hOwnerWnd.GetRect();

	if(GetMyUserInfo(Info))
	{	
		// ClassChangeLightBig.SetTexture("");
		// ClassChangeLightSmall1.SetTexture("");
		// ClassChangeLightSmall2.SetTexture("");
		//ClassChangeLightSmall3.SetTexture(""); 
		// Debug("info race"  @ info.race);
		
		// Debug("nVitalityt" @ info.nVitality) ;
		// Debug("nDyeChargeAmount" @ info.nDyeChargeAmount) ;
		m_UserID = info.nID;
		Name = info.Name;
		NickName = info.strNickName;
		SubClassID = info.nSubClass;
		ClassName = GetClassType(SubClassID);
		SP = info.nSP;
		Level = info.nLevel;
		UserRank = GetUserRankString(info.nUserRank);
		HP = info.nCurHP;
		MaxHP = info.nMaxHP;
		MP = info.nCurMP;
		MaxMP = info.nMaxMP;
		CP = info.nCurCP;
		MaxCP = info.nMaxCP;
		PledgeID = info.nClanID;
		bHero = info.bHero;
		nNobless = info.nNobless;
		NickNameColor = info.NicknameColor;
		nSTR = info.nStr;
		nDEX = info.nDex;
		nCON = info.nCon;
		nINT = info.nInt;
		nWIT = info.nWit;
		nMEN = info.nMen;
		//ЅЕ±ФЅєЕИ Д«ё®Ѕєё¶, ·°Е°
		nLUC = info.nLuc;
		nCHA = info.nCha;
		PhysicalAttack = info.nPhysicalAttack;
		PhysicalDefense = info.nPhysicalDefense;
		HitRate = info.nHitRate;
		CriticalRate = info.nCriticalRate;
		if(IsUseSkillCastingSpeedStat())
		{
			PhysicalAttackSpeed = info.nPhysicalSkillCastingSpeed;
		}
		else
		{
			PhysicalAttackSpeed = info.nPhysicalAttackSpeed;
		}
		MagicalAttack = info.nMagicalAttack;
		MagicDefense = info.nMagicDefense;
		PhysicalAvoid = info.nPhysicalAvoid;
		MagicCastingSpeed = info.nMagicCastingSpeed;
		MovingSpeed = GetMovingSpeed(info);
		CriminalRate = info.nCriminalRate;
		DualCount = info.nDualCount;
		PKCount = info.nPKCount;
		PvPPoint = info.PvPPoint;
		VoteCount = info.nVoteCount;
		BonusCount = info.nBonusCount;
		NegativeVoteCount = info.nNegativeVoteCount;
		Notoriety = info.nNotoriety;
		RaidPoint = info.RaidPoint;
		vitality = info.nVitality;
		//јУјєБ¤єёјјЖГ
		AttrAttackType = info.AttrAttackType;
		//debug("јУјєЕёАФ№шИЈ" @ info.AttrAttackType);
		AttrAttackValue= info.AttrAttackValue;
		AttrDefenseValFire = info.AttrDefenseValFire;
		AttrDefenseValWater = info.AttrDefenseValWater;
		AttrDefenseValWind = info.AttrDefenseValWind;
		AttrDefenseValEarth = info.AttrDefenseValEarth;
		AttrDefenseValHoly = info.AttrDefenseValHoly;
		AttrDefenseValUnholy = info.AttrDefenseValUnholy;
		//єЇЅЕБ¤єёјјЖГ
		//nTransformID = info.nTransformID;
		m_bPawnChanged = info.m_bPawnChanged;
		// ЅЕ±Ф ГЯ°Ў  2010.10.11 CT3 ЅєЕИ Б¤єё °іј±
		nMagicAvoid = info.nMagicAvoid; 
		nMagicHitRate = info.nMagicHitRate; 
		nMagicCriticalRate = info.nMagicCriticalRate; 
		// debug("nMagicAvoid:"@ nMagicAvoid);
		// debug("nMagicHitRate:"@ nMagicHitRate);
		// debug("nMagicCriticalRate:"@ nMagicCriticalRate);

		//~ debug("јУјєБ¤єё: " @ AttrAttackType);
		//~ debug("јУјєБ¤єё: " @  AttrAttackValue);
		//~ debug("јУјєБ¤єё: " @  AttrDefenseValFire);
		//~ debug("јУјєБ¤єё: " @  AttrDefenseValWater);
		//~ debug("јУјєБ¤єё: " @  AttrDefenseValWind);
		//~ debug("јУјєБ¤єё: " @ AttrDefenseValEarth);
		//~ debug("јУјєБ¤єё: " @ AttrDefenseValHoly);
		//~ debug("јУјєБ¤єё: " @ AttrDefenseValUnholy);
		
		switch(AttrAttackType)
		{
			case -2:
				AttrAttackTypeTxt = GetSystemString(27);
				break;
			case 0:
				AttrAttackTypeTxt = GetSystemString(1630);
				break;
			case 1:
				AttrAttackTypeTxt = GetSystemString(1631);
				break;
			case 2:
				AttrAttackTypeTxt = GetSystemString(1632);
				break;
			case 3:
				AttrAttackTypeTxt = GetSystemString(1633);
				break;
			case 4:
				AttrAttackTypeTxt = GetSystemString(1634);
				break;
			case 5:
				AttrAttackTypeTxt = GetSystemString(1635);
				break;
		}
		
		//debug("И°·Вµµ:" @ Vitality);
		UpdateVp(vitality);
		
		//ѕЖёЈЕЧАМѕо БѕБ·АП °жїм 
		setSubjobSlot(info.Race == 6) ;

	}
	
	// Change by JoeyPark
	if(CriminalRate > 0)
	{
		iNameColorRate = Min((100 +(CriminalRate / 100)), 255);
		NameColor.R = 0;
		NameColor.G = iNameColorRate;
		NameColor.B = 0;
		NameColor.A = 255;
		
		if(CriminalRate>999999)
			strCriminalRate = string(999999) $ "(+)";	
		else			
			strCriminalRate = string(CriminalRate);		
	}
	else if(CriminalRate < 0)
	{
		iNameColorRate = Min((100 +(-CriminalRate / 100)), 255);		
		NameColor.R = iNameColorRate;
		NameColor.G = 0;
		NameColor.B = 0;
		NameColor.A = 255;

		if(CriminalRate<-999999)
			strCriminalRate = string(-999999) $ "(+)";	
		else			
			strCriminalRate = string(CriminalRate);	
		
	}
	else // if CriminalRate == 0
	{
		NameColor.R = 230;
		NameColor.G = 230;
		NameColor.B = 230;
		NameColor.A = 255;
		strCriminalRate = "" $ CriminalRate;
	}
	// End Change	
	
	if(Len(NickName)>0)
	{
		GetTextSizeDefault(Name, Width1, Height1);
		GetTextSizeDefault(NickName, Width2, Height2);
		if(Width1 + Width2 > 220)
		{
			if(Width1 > 109)
			{
				Name = Left(Name, 8);
				GetTextSizeDefault(Name, Width1, Height1);
			}
			if(Width2 > 109)
			{
				NickName = Left(NickName, 8);
				GetTextSizeDefault(NickName, Width2, Height2);
			}
		}
		txtName1.SetText(NickName);
		txtName1.SetTextColor(NickNameColor);
		txtName2.SetText(Name);
		txtName2.SetTextColor(NameColor);
		txtName2.MoveTo(rectWnd.nX + 15 + Width2 + 47, rectWnd.nY +41);
			//~ debug("АЅ..:rectWnd: " @ rectWnd.nY);
	}
	else
	{
		txtName1.SetText(Name);
		txtName1.SetTextColor(NameColor);
		txtName2.SetText("");
	}
	
	if(getInstanceL2Util().getIsPrologueGrowType(SubClassID)) 
	{
		if(GetLanguage() == LANG_Korean)
		{
			txtLvName.SetText("ЎД");
		}
		else 
		{
			txtLvName.SetText("--");
		}
	}
	else txtLvName.SetText("" $ Level);

	txtClassName.SetText(ClassName);
	// Debug("=====:: ClassName " @ ClassName);
	// БцА§ °іј± АЫѕч ¶уАМєкїЎј­ґВ БцА§°Ў єёАМБц ѕКґВґЩ.
	//txtRank.SetText(UserRank);
	txtSP.SetText(string(SP));
	
	//ЗчёН
	if(PledgeID>0)
	{
		//ЕШЅєГД
		bPledgeCrestTexture = class'UIDATA_CLAN'.static.GetCrestTexture(PledgeID, PledgeCrestTexture);
		PledgeName = class'UIDATA_CLAN'.static.GetName(PledgeID);
		PledgeNameColor.R = 176;
		PledgeNameColor.G = 155;
		PledgeNameColor.B = 121;
		PledgeNameColor.A = 255;
	}
	else
	{
		PledgeName = GetSystemString(431);
		PledgeNameColor.R = 230;
		PledgeNameColor.G = 230;
		PledgeNameColor.B = 230;
		PledgeNameColor.A = 255;
	}
	txtPledge.SetText(PledgeName);
	txtPledge.SetTextColor(PledgeNameColor);

	// ЗчёНАМ№МБц°ЎАЦґЩёй..
	if(bPledgeCrestTexture)
	{
		texPledgeCrest.SetTextureWithObject(PledgeCrestTexture);
		txtPledge.MoveTo(rectWnd.nX + 110 , rectWnd.nY + 57);
		//јцБ¤
	}
	else
	{
		// ЗчёНАМ№МБц°ЎѕшґЩёй..
		txtPledge.MoveTo(rectWnd.nX + 86, rectWnd.nY + 57);
	}
	
	//їµїх,ілєн·№Ѕє
		
	if(bHero)
	{
		HeroTexture = "L2UI_CH3.PlayerStatusWnd.myinfo_heroicon";
	}
	//ілєн·№Ѕє ver EP2.0 6.25 №цБЇїЎ ГЯ°Ў
	else if(nNobless == 1)
	{
		HeroTexture = "L2UI_CH3.PlayerStatusWnd.myinfo_nobleicon";
	}
	//ѕЖіКЅє ver EP2.0 6.25 №цБЇїЎ ГЯ°Ў
	else if(nNobless == 2)
	{
		//Debug("ілєн·№Ѕє 2 ·Оµе ЗФ");
		HeroTexture = "L2UI_CH3.PlayerStatusWnd.myinfo_nobleicon2";
	}
	//Debug(HeroTexture @ nNobless);
	texHero.SetTexture(HeroTexture);
	
	//»ујјБ¤єё
	if(m_HennaInfo.STRchange > 0)
	{
		strTmp = nSTR $ "(+" $ m_HennaInfo.STRchange $ ")";
	}
	else if(m_HennaInfo.STRchange < 0)
	{
		strTmp = nSTR $ "(" $ m_HennaInfo.STRchange $ ")";
	}
	else
	{
		strTmp = string(nSTR);
	}
	txtSTR.SetText(strTmp);
	
	if(m_HennaInfo.DEXchange > 0)
	{
		strTmp = nDEX $ "(+" $ m_HennaInfo.DEXchange $ ")";
	}
	else if(m_HennaInfo.DEXchange < 0)
	{
		strTmp = nDEX $ "(" $ m_HennaInfo.DEXchange $ ")";
	}
	else
	{
		strTmp = string(nDEX);
	}
	txtDEX.SetText(strTmp);
	
	if(m_HennaInfo.CONchange > 0)
	{
		strTmp = nCON $ "(+" $ m_HennaInfo.CONchange $ ")";
	}
	else if(m_HennaInfo.CONchange < 0)
	{
		strTmp = nCON $ "(" $ m_HennaInfo.CONchange $ ")";
	}
	else
	{
		strTmp = string(nCON);
	}
	txtCON.SetText(strTmp);
	
	if(m_HennaInfo.INTchange > 0)
	{
		strTmp = nINT $ "(+" $ m_HennaInfo.INTchange $ ")";
	}
	else if(m_HennaInfo.INTchange < 0)
	{
		strTmp = nINT $ "(" $ m_HennaInfo.INTchange $ ")";
	}
	else
	{
		strTmp = string(nINT);
	}
	txtINT.SetText(strTmp);
	
	if(m_HennaInfo.WITchange > 0)
	{
		strTmp = nWIT $ "(+" $ m_HennaInfo.WITchange $ ")";
	}
	else if(m_HennaInfo.WITchange < 0)
	{
		strTmp = nWIT $ "(" $ m_HennaInfo.WITchange $ ")";
	}
	else
	{
		strTmp = string(nWIT);
	}
	txtWIT.SetText(strTmp);
	
	if(m_HennaInfo.MENchange > 0)
	{
		strTmp = nMEN $ "(+" $ m_HennaInfo.MENchange $ ")";
	}
	else if(m_HennaInfo.MENchange < 0)
	{
		strTmp = nMEN $ "(" $ m_HennaInfo.MENchange $ ")";
	}
	else
	{
		strTmp = string(nMEN);
	}
	txtMEN.SetText(strTmp);

	//ЅЕ±ФЅєЕИ ·°Е°
	if(m_HennaInfo.LUCchange > 0)
	{
		strTmp = nLUC $ "(+" $ m_HennaInfo.LUCchange $ ")";
	}
	else if(m_HennaInfo.LUCchange < 0)
	{
		strTmp = nLUC $ "(" $ m_HennaInfo.LUCchange $ ")";
	}
	else
	{
		strTmp = string(nLUC);
	}
	txtLUC.SetText(strTmp);

	//ЅЕ±ФЅєЕИ Д«ё®Ѕєё¶
	if(m_HennaInfo.CHAchange > 0)
	{
		strTmp = nCHA $ "(+" $ m_HennaInfo.CHAchange $ ")";
	}
	else if(m_HennaInfo.CHAchange < 0)
	{
		strTmp = nCHA $ "(" $ m_HennaInfo.CHAchange $ ")";
	}
	else
	{
		strTmp = string(nCHA);
	}
	txtCHA.SetText(strTmp);


	nMagicAvoid = info.nMagicAvoid;
	nMagicHitRate = info.nMagicHitRate; 
	nMagicCriticalRate = info.nMagicCriticalRate; 

	GetTextBoxHandle(m_WindowName $ ".txtMagicAvoid").SetText(String(nMagicAvoid));
	GetTextBoxHandle(m_WindowName $ ".txtMagicHit").SetText(String(nMagicHitRate));
	GetTextBoxHandle(m_WindowName $ ".txtMagicCritical").SetText(String(nMagicCriticalRate));

	// debug("nMagicAvoid:"@ nMagicAvoid);
	// debug("nMagicHitRate:"@ nMagicHitRate);
	// debug("nMagicCriticalRate:"@ nMagicCriticalRate);

	
	
	txtPhysicalAttack.SetText(string(PhysicalAttack));
	txtPhysicalDefense.SetText(string(PhysicalDefense));
	txtHitRate.SetText(string(HitRate));
	txtCriticalRate.SetText(string(CriticalRate));
	txtPhysicalAttackSpeed.SetText(string(PhysicalAttackSpeed));
	txtMagicalAttack.SetText(string(MagicalAttack));
	txtMagicDefense.SetText(string(MagicDefense));
	txtPhysicalAvoid.SetText(string(PhysicalAvoid));
	txtMovingSpeed.SetText(MovingSpeed);
	txtMagicCastingSpeed.SetText(string(MagicCastingSpeed));
	
	txtCriminalRate.SetText(strCriminalRate);
	txtPVP.SetText(string(PvPPoint));
	txtSociality.SetText(DualCount $ " / " $ PKCount);
	txtBonusVote.SetText(string(BonusCount) $ " / " $ string(VoteCount));
	txtRaidPoint.SetText(string(RaidPoint));
	
	UpdateHPBar(HP, MaxHP);
	UpdateMPBar(MP, MaxMP);
	UpdateCPBar(CP, MaxCP);
	UpdateEXPBar(info.fExpPercentRate);
	//UpdateEXPBar(int(fExpRate), 100);
	
	// јУјєµҐАМЕНјјЖГ
	txtAttrAttackType.SetText(""$ AttrAttackTypeTxt);
	txtAttrAttackValue.SetText(""$ AttrAttackValue);
	txtAttrDefenseValFire.SetText(""$ AttrDefenseValFire);
	txtAttrDefenseValWater.SetText(""$ AttrDefenseValWater); 
	txtAttrDefenseValWind.SetText(""$ AttrDefenseValWind);
	txtAttrDefenseValEarth.SetText(""$ AttrDefenseValEarth);
	txtAttrDefenseValHoly.SetText(""$ AttrDefenseValHoly);
	txtAttrDefenseValUnholy.SetText(""$ AttrDefenseValUnholy);
	
	// єЇЅЕБ¤єёјјЖГ
	if(m_bPawnChanged) 
	{
		//~ iGender = info.nSex;
		//~ TransformedID = class'UIDATA_TRANSFORM'.static.GetNpcID(nTransformID, iGender);
		//~ debug("єЇЅЕѕЖАМµр"@ TransformedID);
		//~ TransformedName = class'UIDATA_NPC'.static.GetNPCName(TransformedID);
		//~ txtLvName.SetText(Level $ " " $ TransformedName);
		//~ RunTransformManage();
	}
	else
	{
		RunUnTransformManage();
	}

	//6.25 ѕЖіКЅє ГЯ°Ў
	//GD4.0 05 85АМ»у 1·ѕѕч ЅГ AP »зїл °ЎґЙ
	
	UpdateAbilityBtn();
}


//HP№Щ°»ЅЕ
function UpdateHPBar(int Value, int MaxValue)
{
	texHP.SetPoint(Value, MaxValue);
}

//MP№Щ°»ЅЕ
function UpdateMPBar(int Value, int MaxValue)
{
	texMP.SetPoint(Value, MaxValue);
}

//EXP№Щ°»ЅЕ
function UpdateEXPBar(float ExpPercent)
{
	texEXP.SetPointExpPercentRate(ExpPercent);
}

//CP№Щ°»ЅЕ
function UpdateCPBar(int Value, int MaxValue)
{
	texCP.SetPoint(Value, MaxValue);
}

function ToggleOpenCharInfoWnd()
{
	switch(m_hOwnerWnd.IsShowWindow())
	{
		case true:
			m_hOwnerWnd.HideWindow();
			PlaySound("InterfaceSound.charstat_close_01");
			break;
		case false:
			m_hOwnerWnd.ShowWindow();
			m_hOwnerWnd.SetFocus();
			PlaySound("InterfaceSound.charstat_open_01");
			break;
	}
}

function HandleVitalityPointInfo(string param) // И°·ВјцДЎёёѕчµҐАМЖ®
{
	local int nVitality;

	ParseInt(param, "Vitality", nVitality);

	UpdateVp(nVitality); // И°·В°ФАМБцё¦ѕчµҐАМЖ®ЗСґЩ.
}

//branch
// F2P ј­єсЅє И°·В °іј± - gorillazin
function HandleVitalityEffectInfo(string param)
{
	local CustomTooltip t;
	local int nVitality, nVitalityBonus, nVitalityItemRestoreCount, nVitalityExtraBonus;
	local string sBonusString, sExtraBonusString;

	ParseInt(param, "vitalityPoint", nVitality);
	ParseInt(param, "vitalityBonus", nVitalityBonus);
	ParseInt(param, "restoreCount", nVitalityItemRestoreCount);
	// maxRestoreCount їЎ ґлЗС і»їлАє АМ UIїЎј­ґВ »зїлЗПБц ѕКЅАґПґЩ.

	util = L2Util(GetScript("L2Util"));
	util.setCustomTooltip(t);
	util.ToopTipInsertText(GetSystemString(2494), true, false);

	// И°·В BM ГЯ°Ў 2015.05
	ParseInt(param, "vitalityExtraBonus", nVitalityExtraBonus);

	sBonusString = nVitalityBonus $ "%";
	if(nVitalityExtraBonus > 0)
	{
		sExtraBonusString = "(+" $ nVitalityExtraBonus $ "%)";
	}

	//Debug("И°·В °іј± HandleVitalityEffectInfo "  @ nVitality @ nVitalityBonus @ nVitalityItemRestoreCount @ nVitalityItemMaxRestoreCount @ nVitalityExtraBonus);

	util = L2Util(GetScript("L2Util"));
	util.setCustomTooltip(t);

	// И°·В єёіКЅє:
	util.ToopTipInsertText(GetSystemString(2494), true, false);
	// И°·ВАМ 0 АО °жїм №МАыїл ЗҐЅГ
	if(nVitality <= 0)
	{
		util.ToopTipInsertText(GetSystemString(2496), true, false, util.ETooltipTextType.COLOR_GRAY);
		util.ToopTipInsertText(GetSystemMessage(13112), true, true);		
	}
	// И°·В 0 АМ»уАО °жїм 
	else
	{
		util.ToopTipInsertText(sBonusString, true, false);
		util.ToopTipInsertText(sExtraBonusString, true, false, util.ETooltipTextType.COLOR_YELLOW03);
		util.ToopTipInsertText(" " $ GetSystemString(2495) $ ". ", true, false);
		util.ToopTipInsertText(GetSystemMessage(13111),true,true);
	}
	texVP.SetTooltipCustomType(util.getCustomToolTip());//bluesun ДїЅєЕНё¶АМБо ЕшЖБ
}
//
//end of branch

function RunTransformManage()
{
	
}

function RunUnTransformManage()
{
	
}

/**
 * ДїЅєЕТЕшЖБ(ј­єкАвЕ¬·ЎЅєєЇИЇ№цЖ°їЎ»зїл)
 **/
function CustomTooltip subjobButtonToolTips(int TargetType)
{
	local CustomTooltip m_Tooltip;
	
	local int subjobSlotStringNum;
	// Debug("targetType tool " @ targetType);

	// ј­єкЕ¬·ЎЅєё¦µо·ПЗПґВАЪё®АФґПґЩ.. °°АєѕИі»ёЗЖ®..
	if(TargetType == -1)
	{
		m_Tooltip.DrawList.Length = 1;
		m_Tooltip.MinimumWidth = 210;//160->183px ·О јцБ¤µК
		m_Tooltip.DrawList[0].eType = DIT_TEXT;
		m_Tooltip.DrawList[0].t_color.R = 220;
		m_Tooltip.DrawList[0].t_color.G = 220;
		m_Tooltip.DrawList[0].t_color.B = 220;
		m_Tooltip.DrawList[0].t_color.A = 255;

		//ѕЖёЈЕЧАМѕоАЗ °жїм ЕшЖБ ЕШЅєЖ®°Ў ґЩё§
		subjobSlotStringNum = 2342;

		if(Race == 6)
		{
			subjobSlotStringNum = 3315;
		}

		m_Tooltip.DrawList[0].t_strText = GetSystemString(subjobSlotStringNum);
	}
	else
	{
		m_Tooltip.DrawList.Length = 5;
		if(GetLanguage() == LANG_Russia || GetLanguage() == LANG_Euro)
		{
			m_Tooltip.MinimumWidth = 260;			
		}
		else
		{
			m_Tooltip.MinimumWidth = 214;
		}

		m_Tooltip.DrawList[0].eType = DIT_TEXT;
		m_Tooltip.DrawList[0].t_color.R = 200;
		m_Tooltip.DrawList[0].t_color.G = 200;
		m_Tooltip.DrawList[0].t_color.B = 200;
		m_Tooltip.DrawList[0].t_color.A = 255;
		m_Tooltip.DrawList[0].t_strText = "Lv";

		m_Tooltip.DrawList[1].eType = DIT_TEXT;
		m_Tooltip.DrawList[1].t_color.R = 175;
		m_Tooltip.DrawList[1].t_color.G = 152;
		m_Tooltip.DrawList[1].t_color.B = 120;
		m_Tooltip.DrawList[1].t_color.A = 255;
		m_Tooltip.DrawList[1].t_strText = subjobInfoArray[TargetType].Level @ GetClassType(subjobInfoArray[TargetType].ClassID);

    	m_Tooltip.DrawList[2].eType = DIT_TEXT;
		m_Tooltip.DrawList[2].t_color.R = 200;
		m_Tooltip.DrawList[2].t_color.G = 200;
		m_Tooltip.DrawList[2].t_color.B = 200;
		m_Tooltip.DrawList[2].t_color.A = 255;

		// Debug("GetClassType(subjobInfoArray[targetType].ClassID)" @ subjobInfoArray[targetType].ClassID);
		// Debug("GetClassType(subjobInfoArray[targetType] АМё§:)" @ GetClassType(subjobInfoArray[targetType].ClassID));

		// ёЮАО:0, µаѕу:1 ј­єк:2
		// ј­єкЕ¬·ЎЅє¶уёй..
		if(subjobInfoArray[TargetType].Type == 2)
		{
			// "ј­єк" 
			m_Tooltip.DrawList[2].t_strText = "(" $ GetSystemString(2341) $ ")";			
		}
		else if(subjobInfoArray[targetType].Type == 1)
		{
			// "µаѕу" 
			m_Tooltip.DrawList[2].t_strText = "(" $ GetSystemString(2739) $ ")";			
		}
		else
		{
			m_Tooltip.DrawList[2].t_strText = "(" $ GetSystemString(2738) $ ")";
		}	
		//m_Tooltip.DrawList[2].t_bDrawOneLine = true;
		//m_Tooltip.DrawList[2].bLineBreak = true;

		m_Tooltip.DrawList[3].eType = DIT_TEXT;

		// m_Tooltip.DrawList[3].nOffSetY = 2;
		m_Tooltip.DrawList[3].bLineBreak = true;
		m_Tooltip.DrawList[3].t_color.R = 220;
		m_Tooltip.DrawList[3].t_color.G = 220;
		m_Tooltip.DrawList[3].t_color.B = 220;
		m_Tooltip.DrawList[3].t_color.A = 255;

		m_Tooltip.DrawList[3].t_strText = GetSystemString(2343);
		// ј­єк¶уёй..
		// 80·№є§АМИДёЮАОЕ¬·ЎЅє·ОјєАеЗТјцАЦЅАґПґЩ. ёЮјјБцєёї©БЬ
		m_Tooltip.DrawList[4].eType = DIT_TEXT;

		// µаѕу Е¬·ЎЅє°Ў ЗПіЄµµ ѕшґВ °жїм
		// 80·№є§ АМИД ёЮАОЕ¬·ЎЅє·О јєАеЗТ јц АЦЅАґПґЩ 
		// ¶уґВ ЕшЖБА» єёї©БШґЩ. 
		if(subjobInfoArray[TargetType].Type == 2 && isDualClass == false)
		{
			m_Tooltip.DrawList[4].bLineBreak = true;
			m_Tooltip.DrawList[4].t_color.R = 110;
			m_Tooltip.DrawList[4].t_color.G = 140;
			m_Tooltip.DrawList[4].t_color.B = 170;
			m_Tooltip.DrawList[4].t_color.A = 255;
			m_Tooltip.DrawList[4].t_strText = GetSystemString(2344);
		}
		else
		{
			m_Tooltip.DrawList[4].t_strText = "";
		}
	}

	return m_Tooltip;
}

function int getMainLevel()
{
	local int i;
	local UserInfo Info;

	if(subjobInfoArray.Length > 1)
	{
		for(i = 0;i < subjobInfoArray.Length;i++)
		{
			if(subjobInfoArray[i].Type == 0)
			{
				if(CurrentSubjobClassID == subjobInfoArray[i].ClassID)
				{
					GetPlayerInfo(Info);
					return Info.nLevel;
				}
				else
					return subjobInfoArray[i].Level;
			}
		}
	}
	else
	{
		GetPlayerInfo(Info);
		return Info.nLevel;
	}
	Debug("Error: DetailStatusWnd getMainLevel의 값이 잘못되었습니다. -1 ");
	return -1;
}

function int getMainClassID()
{
	local int i;
	local UserInfo Info;

	if(subjobInfoArray.Length > 1)
	{
		for(i = 0;i < subjobInfoArray.Length;i++)
		{
			if(subjobInfoArray[i].Type == 0)
				return subjobInfoArray[i].ClassID;
		}
	}
	else
	{
		GetPlayerInfo(Info);
		return Info.nSubClass;
	}
	Debug("Error: DetailStatusWnd getMainClassID의 값이 잘못되었습니다. -1 ");
	return -1;
}

/**
 * А©µµїмESC Е°·ОґЭ±вГіё®
 * "Esc" Key
 ***/
function OnReceivedCloseUI()
{
	PlayConsoleSound(IFST_WINDOW_CLOSE);
	GetWindowHandle(m_WindowName).HideWindow();
}

defaultproperties
{
	m_WindowName="DetailStatusWnd"
}
