/**
 *   GetQuestWnd їН GmFindTreeWnd ё¦ Б¶ЗХЗШј­ ДщЅєЖ® °Л»ц Еш ЗПіЄ ёёµйѕъАЅ by Dongland
 *   
 *   АМ°Нµµ °іАОїл їлµµ¶уј­.. ±ЧіЙ ґл·« ВҐБэ±в·О ёёµз°Е¶у.. »зїлЗТ »з¶чёё.. -_-)/
 *
 **/
class UIQuestToolWnd extends UICommonAPI;

const TIMER_ID_CHANGETEXT    = 10234567;
const TIMER_ID_UPDATELOCINFO = 10234568;

var ListCtrlHandle questListCtrl;
var HtmlHandle     QuestHtmlViewer;
var ButtonHandle   searchItemBtn;
//var ComboBoxHandle QuestTypeComboBox;
//var ComboBoxHandle QuestGradeComboBox;
var EditBoxHandle  searchEditBox;
var EditBoxHandle  itemCountEditBox;
//var EditBoxHandle  descViewEditBox;
var ButtonHandle   InitBtn;
var ButtonHandle   getItemBtn;
//var TextBoxHandle  ItemDescTextBox;
var TextBoxHandle  etcTextBox;
var TextBoxHandle  cTextBox;

var TextBoxHandle  playerLocText;

// var MinimapCtrlHandle QuestMinimap;

var HtmlHandle        DetailInfoHtmlCtrl;

var string htmlMsg;
var string QuestDescription;
var string selectNPCName; // ј±ЕГЗС npcАМё§

var int freeNum;        // №«·бѕЖАМЕЫ
var int chargeNum;      // АЇ·бѕЖАМЕЫ
var int selectQuestId;  // ј±ЕГЗС ДщЅєЖ® ѕЖАМµр 
var int bicIconLen;

var ItemInfo ItemInfo;
var Color redColor;

var bool apiChk;
var private RichListCtrlHandle QuestListCtrl_RichList;
var private UIControlDialogAssets teleportDialog;

event OnRegisterEvent()
{
	//RegisterEvent(  );
}

event OnLoad()
{
	SetClosingOnESC(); 
	//getInstanceUIData().addEscCloseWindow(getCurrentWindowName(string(Self)));	
	Initialize();
}

function Initialize()
{
	QuestListCtrl   = GetListCtrlHandle( "UIQuestToolWnd.QuestListCtrl" );
	QuestListCtrl_RichList = GetRichListCtrlHandle("UIQuestToolWnd.QuestListCtrl_RichList");
	QuestHtmlViewer = GetHtmlHandle( "UIQuestToolWnd.QuestHtmlViewer" );
	searchItemBtn   = GetButtonHandle( "UIQuestToolWnd.searchItemBtn" );

	//QuestTypeComboBox  = GetComboBoxHandle( "UIQuestToolWnd.QuestTypeComboBox" );
	//QuestGradeComboBox = GetComboBoxHandle( "UIQuestToolWnd.QuestGradeComboBox" );
	searchEditBox      = GetEditBoxHandle( "UIQuestToolWnd.searchEditBox" );
	itemCountEditBox   = GetEditBoxHandle( "UIQuestToolWnd.itemCountEditBox" );
	// descViewEditBox    = GetEditBoxHandle( "UIQuestToolWnd.descViewEditBox" );

	InitBtn    = GetButtonHandle( "UIQuestToolWnd.InitBtn" );
	getItemBtn = GetButtonHandle( "UIQuestToolWnd.getItemBtn" );

	// ItemDescTextBox = GetTextBoxHandle( "UIQuestToolWnd.ItemDescTextBox" );
	// QuestMinimap    = GetMinimapCtrlHandle( "UIQuestToolWnd.QuestMinimap" );

	DetailInfoHtmlCtrl = GetHtmlHandle("UIQuestToolWnd.DetailInfoHtmlCtrl");
	etcTextBox = GetTextBoxHandle("UIQuestToolWnd.etcTextBox");
	cTextBox = GetTextBoxHandle("UIQuestToolWnd.cTextBox");
	playerLocText = GetTextBoxHandle("UIQuestToolWnd.playerLocText");
	teleportDialog = class'UIControlDialogAssets'.static.InitScript(GetWindowHandle("UIQuestToolWnd.UIControlDialogAsset"));
	teleportDialog.NeedItemRichListCtrl.SetColumnWidth(0, 220);
	if(! getInstanceUIData().getIsClassicServer())
	{
		return;
	}
	GetButtonHandle("UIQuestToolWnd.getQuestButton").SetNameText("메뉴");
	GetButtonHandle("UIQuestToolWnd.MoveStartNPCButton").SetNameText("내 퀘스트");
	GetButtonHandle("UIQuestToolWnd.MoveTargetLocButton").HideWindow();	
}

event OnTimer(int TimerID)
{
	local Vector pVec;
	local ELanguageType Language;

	if(TimerID == TIMER_ID_CHANGETEXT)
	{
		CTextBox.SetText("");
		return;
	}
	else if (TimerID == TIMER_ID_UPDATELOCINFO) 
	{
		pVec = GetPlayerPosition();

		playerLocText.SetText("CurrentPlayer Position" $ "\\nx" $ int(pVec.x) $ " y" $ int(pVec.Y) $ " z" $ int(pVec.z));
	}
}

event OnShow()
{
	m_hOwnerWnd.KillTimer(TIMER_ID_UPDATELOCINFO);
	m_hOwnerWnd.SetTimer(TIMER_ID_UPDATELOCINFO, 100);
}

event OnHide()
{
	m_hOwnerWnd.KillTimer(TIMER_ID_UPDATELOCINFO);
}

event OnClickButton( string Name )
{
	switch( Name )
	{
		case "searchItemBtn":
			 OnsearchItemBtnClick();
			 break;
		case "InitBtn":
			 OnInitBtnClick();
			 break;
		case "getQuestButton":
			if(getInstanceUIData().getIsClassicServer())
			{
				ShowContextMenu();
			}
			else
			{
				GetQuestButtonClick();
			}
			break;
		case "MoveStartNPCButton":
			if(getInstanceUIData().getIsClassicServer())
			{
				SetMyQuests();
			}
			else
			{
				MoveStartNPCButtonClick();
			}
			 break;
		case "MoveTargetLocButton":
			 MoveTargetLocButtonClick();
			 break;
		default:
			HandleBtnByName(Name);
			break;
	}
}

/***
 * ё®ЅєЖ® ДБЖ®·СА» Е¬ёЇ ЗЯА»¶§ 
 **/
event OnClickListCtrlRecord(string ListCtrlID)
{
	switch(ListCtrlID)
	{
		case "QuestListCtrl":
			addPinInTheMap(ListCtrlID, -1);
			break;
		case "QuestListCtrl_RichList":
			AddPinInTheGfxMap();
			break;
	}
}

event OnRClickListCtrlRecord(string ListCtrlID)
{
	switch(ListCtrlID)
	{
		case "QuestListCtrl_RichList":
			ShowContextMenu();
			break;
		case "QuestListCtrl":
			OnClickButton("MoveTargetLocButton");
			break;
	}	
}

function _ShowNQuestContextMenu(int qid)
{
	local UIControlContextMenu ContextMenu;
	local NQuestUIData o_data;
	local int mX, mY;

	if(! API_GetNQuestData(qid, o_data))
	{
		return;
	}
	ContextMenu = class'UIControlContextMenu'.static.GetInstance();
	ContextMenu.Clear();
	ContextMenu.DelegateOnClickContextMenu = HandleOnClickContextMenu;
	ContextMenu.MenuNew("퀘스트를 수락", 0);
	ContextMenu.MenuNew("퀘스트를 취소", 1);
	ContextMenu.MenuNew("완료를 진행으로", 2);
	ContextMenu.MenuNew("진행 횟수 변경", 3);
	ContextMenu.MenuNew("종료 상태로", 4);
	ContextMenu.MenuLineAdd();
	if(((o_data.Location.X != 0) && o_data.Location.Y != 0) && o_data.Location.Z != 0)
	{
		ContextMenu.MenuNew("퀘스트 위치로", 5);		
	}
	else
	{
		ContextMenu.MenuNew("퀘스트 위치로", -1, getInstanceL2Util().Gray);
	}
	if(o_data.StartNPC.Id > 0)
	{
		ContextMenu.MenuNew("시작 NPC 위치로", 6);		
	}
	else
	{
		ContextMenu.MenuNew("시작 NPC 위치로", -1, getInstanceL2Util().Gray);
	}
	if(o_data.EndNPC.Id > 0)
	{
		ContextMenu.MenuNew("종료 NPC 위치로", 7);		
	}
	else
	{
		ContextMenu.MenuNew("종료 NPC 위치로", -1, getInstanceL2Util().Gray);
	}
	ContextMenu._SetReservedInt(qid);
	API_GetClientCursorPos(mX, mY);
	ContextMenu.Show(mX, mY, string(self));	
}

private function ShowContextMenu()
{
	local RichListCtrlRowData rowData;

	QuestListCtrl_RichList.GetSelectedRec(rowData);
	_ShowNQuestContextMenu(int(rowData.nReserved1));	
}

private function HandleOnClickContextMenu(int Index)
{
	local UIControlContextMenu ContextMenu;
	local NQuestUIData o_data;
	local int QuestID;

	ContextMenu = class'UIControlContextMenu'.static.GetInstance();
	QuestID = ContextMenu._GetReservedInt();
	if(! API_GetNQuestData(QuestID, o_data))
	{
		return;
	}
	Debug("HandleOnClickContextMenu" @ string(Index));
	switch(Index)
	{
		case 0:
			API_ExecuteCommand("//setquestdata" @ string(QuestID), true);
			break;
		case 1:
			API_ExecuteCommand("//delquestdata" @ string(QuestID), true);
			break;
		case 2:
			API_ExecuteCommand("//resetquestdata" @ string(QuestID), true);
			break;
		case 3:
			DialogShow(DialogModalType_Modalless, DialogType_NumberPad, o_data.Name $ "\\n -" $ o_data.Goal.Name $ "*" $ string(o_data.Goal.Num), string(self));
			class'DialogBox'.static.Inst().AnchorToOwner(0, 200);
			DialogSetInputlimit(o_data.Goal.Num);
			DialogSetString(string(o_data.Goal.Num));
			DialogSetReservedInt(QuestID);
			class'DialogBox'.static.Inst().DelegateOnOK = HandleCountQuestDataDialogOK;
			class'DialogBox'.static.Inst()._AllSelect();
			break;
		case 4:
			API_ExecuteCommand("//countquestdata_full" @ string(QuestID), true);
			break;
		case 5:
			ProcessChatMessage("//teleport" @ string(o_data.Location.X) @ string(o_data.Location.Y) @ string(o_data.Location.Z));
			break;
		case 6:
			ProcessChatMessage("//teleport" @ string(o_data.StartNPC.Location.X) @ string(o_data.StartNPC.Location.Y) @ string(o_data.StartNPC.Location.Z));
			break;
		case 7:
			ProcessChatMessage("//teleport" @ string(o_data.EndNPC.Location.X) @ string(o_data.EndNPC.Location.Y) @ string(o_data.EndNPC.Location.Z));
			break;
	}	
}

private function HandleCountQuestDataDialogOK()
{
	local int QuestID;

	QuestID = DialogGetReservedInt();
	ExecuteCommand(("//countquestdata" @ string(QuestID)) @ (DialogGetString()));	
}

private function API_ExecuteCommand(string Command, optional bool bNeedTarget)
{
	local UserInfo uInfo;

	if(bNeedTarget)
	{
		if(! GetTargetInfo(uInfo))
		{
			class'L2Util'.static.Inst().showGfxScreenMessage(GetSystemMessage(50));
			return;
		}
	}
	ExecuteCommand(Command);	
}

function OnDBClickListCtrlRecord( string ListCtrlID)
{
	local int questID, nSelect, questLevel;
	local LVDataRecord dataRecord;		

	nSelect = questListCtrl.GetSelectedIndex();

	if (ListCtrlID == "QuestListCtrl") 
	{
		if (nSelect >= 0) 
		{  
			questListCtrl.GetSelectedRec(dataRecord);

			questID    = int(dataRecord.LVDataList[0].szData);			
			if (questID > 0)	
			{
				// searchEditBox.SetString(string(questID));
				//OnClickButton( "searchItemBtn" );
				FindAllQuest(string(questID));
			}
		}
	}
}

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

/** OnKeyUp */
function OnKeyUp( WindowHandle a_WindowHandle, EInputKey nKey )
{
	// Е°єёµе ґ©ё§Аё·О ГјЕ© 	
	if (searchEditBox.IsFocused())
	{	
		// txtPath
		if (nKey == IK_Enter) 
		{
			// Е°єёµе АФ·ВАє ѕЖ№«°Нµµ АФ·В ЗПБц ѕКѕТА»¶§ АьГј °Л»цА» ЗгїлЗПБц ѕКґВґЩ.
			// ЅЗјц·О АЪІЩ ґ©ёЈґВ °жїм°Ў АЦѕој­..
			if (trim(searchEditBox.GetString()) != "") OnsearchItemBtnClick();
		}
	}
}

private function HandleBtnByName(string btnName)
{
	local array<string> descriptArray;

	Split(btnName, "_", descriptArray);
	if(descriptArray[0] == "telBtn")
	{
		ShowTeleportDialog(int(descriptArray[1]));
	}	
}

private function OnsearchItemBtnClick()
{
	if(getInstanceUIData().getIsClassicServer())
	{
		FindAllQuestAdena();		
	}
	else
	{
		FindAllQuest(searchEditBox.GetString());
	}	
}

function OnInitBtnClick()
{
	searchEditBox.SetString("");
	questListCtrl.DeleteAllItem();
}

function GetQuestButtonClick()
{
	local int questID, nSelect;
	local LVDataRecord dataRecord;		
	// local Vector loc;
	if(getInstanceUIData().getIsClassicServer())
	{
	}
	nSelect = questListCtrl.GetSelectedIndex();

	if (nSelect >= 0) 
	{  
		questListCtrl.GetSelectedRec(dataRecord);
		questID = int(dataRecord.LVDataList[0].szData);

		Debug("questID" @ questID);
		if (questID > 0)
			ProcessChatMessage("//setquest " $ questID $ " 1");
	}
}

private function SetMyQuests()
{
	local int i;
	local RichListCtrlHandle QuestAlarmList_RichList;
	local RichListCtrlRowData rowData;
	local NQuestUIData questUIData;

	QuestAlarmList_RichList = GetRichListCtrlHandle("QuestProgressWnd.QuestAlarmList_RichList");
	searchEditBox.SetString("");
	QuestListCtrl_RichList.DeleteAllItem();
	Debug("SetMyQuests" @ string(QuestAlarmList_RichList.GetRecordCount()));
	
	for(i = 0; i < QuestAlarmList_RichList.GetRecordCount(); i++)
	{
		QuestAlarmList_RichList.GetRec(i, rowData);
		if(! API_GetNQuestData(int(rowData.nReserved1), questUIData))
		{
			// [Explicit Continue]
			continue;
		}
		Debug("SetMyQuests" @ string(rowData.nReserved1));
		AddItemNewQuest(questUIData);
	}	
}

private function MoveStartNPCButtonClick()
{
	local int questID, nSelect;
	local LVDataRecord dataRecord;		
	local Vector loc;

	nSelect = questListCtrl.GetSelectedIndex();

	if (nSelect >= 0) 
	{  
		questListCtrl.GetSelectedRec(dataRecord);

		questID = int(dataRecord.LVDataList[0].szData);
		loc     = class'UIDATA_QUEST'.static.GetStartNPCLoc(questID, 1 );

		if (loc.x + loc.y + loc.z != 0)	
		{
			Debug("teleport -> " @ loc.x @ loc.Y @ loc.Z );
			ProcessChatMessage("//teleport" @ loc.x @ loc.Y @ loc.Z);
		}
		if (questID <= 0)
		{
			AddSystemMessageString("questID is wrong:" @ questID);
		}
	}
}

private function MoveTargetLocButtonClick()
{
	local int questID, nSelect, questLevel;
	local LVDataRecord dataRecord;		
	local Vector loc;

	nSelect = questListCtrl.GetSelectedIndex();

	if (nSelect >= 0) 
	{  
		questListCtrl.GetSelectedRec(dataRecord);

		questID    = int(dataRecord.LVDataList[0].szData);
		questLevel = int(dataRecord.nReserved2);
		
		loc = class'UIDATA_QUEST'.static.GetTargetLoc(QuestID, questLevel);

		if (loc.x + loc.y + loc.z != 0)	
		{
			if (questID > 0) 
			{
				Debug("teleport -> " @ loc.x @ loc.Y @ loc.Z );
				ProcessChatMessage("//teleport" @ loc.x @ loc.Y @ loc.Z);
			}
			else
			{
				AddSystemMessageString("questID is wrong:" @ questID);				
			}
		}
	}
}

private function bool ChkString(string SearchString, string targetString)
{
	local string modifiedString;

	modifiedString = Substitute(targetString, " ", "", false);
	return StringMatching(modifiedString, SearchString, " ");	
}

private function bool ChkQuestString(string SearchString, NQuestUIData questUIData)
{
	local int i;

	if(SearchString == "")
	{
		return true;
	}
	if(SearchString == "0" || int(SearchString) > 0)
	{
		if(int(SearchString) == questUIData.Id)
		{
			return true;
		}
		if(int(SearchString) == questUIData.TeleportID)
		{
			return true;
		}
		if(int(SearchString) == questUIData.StartNPC.Id)
		{
			return true;
		}
		if(int(SearchString) == questUIData.EndNPC.Id)
		{
			return true;
		}
		if(int(SearchString) == questUIData.StartNPC.TeleportID)
		{
			return true;
		}
		if(int(SearchString) == questUIData.EndNPC.TeleportID)
		{
			return true;
		}
	}
	if(ChkString(SearchString, questUIData.Name))
	{
		return true;
	}
	if(questUIData.StartNPC.Id > 0)
	{
		if(ChkString(SearchString, class'UIDATA_NPC'.static.GetNPCName(questUIData.StartNPC.Id)))
		{
			return true;
		}
		if(ChkString(SearchString, GetTeleportName(questUIData.StartNPC.TeleportID)))
		{
			return true;
		}
	}
	if(questUIData.EndNPC.Id > 0)
	{
		if(ChkString(SearchString, class'UIDATA_NPC'.static.GetNPCName(questUIData.EndNPC.Id)))
		{
			return true;
		}
		if(ChkString(SearchString, GetTeleportName(questUIData.EndNPC.TeleportID)))
		{
			return true;
		}
	}
	if(ChkString(SearchString, GetTeleportName(questUIData.TeleportID)))
	{
		return true;
	}
	if(ChkString(SearchString, questUIData.Goal.Name))
	{
		return true;
	}
	if(questUIData.Reward.Level > 0)
	{
		if(ChkString(SearchString, class'UIDATA_ITEM'.static.GetItemName(GetItemID(95641))))
		{
			return true;
		}
	}
	if(questUIData.Reward.Exp > 0)
	{
		if(ChkString(SearchString, class'UIDATA_ITEM'.static.GetItemName(GetItemID(15623))))
		{
			return true;
		}
	}
	if(questUIData.Reward.Sp > 0)
	{
		if(ChkString(SearchString, class'UIDATA_ITEM'.static.GetItemName(GetItemID(15624))))
		{
			return true;
		}
	}
	Debug("QuestID Item Name");

	for(i = 0; i < questUIData.Reward.Items.Length; i++)
	{
		if(ChkString(SearchString, class'UIDATA_ITEM'.static.GetItemName(GetItemID(questUIData.Reward.Items[i].ItemClassID))))
		{
			return true;
		}
	}
	return false;	
}

private function FindAllQuest( String a_Param )
{
	local int ID, i, NpcID;
	local string modifiedString, fullNameString, NpcName;
	local string JournalName, beforeJournalName;
	local string modifiedParam, zoneName;

	questListCtrl.ShowWindow();
	QuestListCtrl_RichList.HideWindow();
	
	// m_ComboList.Remove(0, m_ComboList.Length);

	questListCtrl.DeleteAllItem();			

	if (int(a_Param) > 0)
	{
		a_Param = class'UIDATA_QUEST'.static.GetQuestName( int(a_Param) );
	}

	modifiedParam=Substitute(a_Param, " ", "", FALSE);
	
	for( ID = class'UIDATA_QUEST'.static.GetFirstID(); -1 != ID ; ID = class'UIDATA_QUEST'.static.GetNextID() )
	{		
		fullNameString  = class'UIDATA_QUEST'.static.GetQuestName( ID );

		//modifiedString = Substitute(fullNameString, " ", "", FALSE);

		NpcID           = class'UIDATA_QUEST'.static.GetStartNPCID(ID, 1 );
		NpcName         = class'UIDATA_NPC'.static.GetNPCName( NpcID );


		for(i = 0; i < 100; i++)
		{
			// БцїЄён 
			zoneName = class'UIDATA_QUEST'.static.GetQuestName(class'UIDATA_QUEST'.static.GetQuestZone(id, i));
			// zoneName = GetZoneName(zoneLoc.x, zoneLoc.y, zoneLoc.z);

			JournalName = class'UIDATA_QUEST'.static.GetQuestJournalName( ID, i );
			JournalName = class'UIDATA_QUEST'.static.GetQuestJournalNameLine( JournalName );

			modifiedString = fullNameString $ JournalName $ NpcName $ zoneName;

			modifiedString = Substitute(modifiedString, " ", "", FALSE);

			// level 0 Ає ґлБ¦ёс,  јТБ¦ёс , АъіОАМё§АМ ѕшѕој­..ї№їЬ Гіё® 
			if ((len(JournalName) <= 0 || i == 0))
			{
				continue;
			}
			else
			{
				if (len(JournalName) != 0 && beforeJournalName == JournalName)
				{
					continue;
				}
			}
			if ( InStr( modifiedString  , modifiedParam ) != -1)
			{
				addItem(ID, i, fullNameString, JournalName);
				beforeJournalName = JournalName;
			}
			else if (int(a_Param) > 0)
			{
				addItem(ID, i, fullNameString, JournalName);

				JournalName = class'UIDATA_QUEST'.static.GetQuestJournalName( ID, i );
				JournalName = class'UIDATA_QUEST'.static.GetQuestJournalNameLine( JournalName );

				beforeJournalName = JournalName;
			}
		}
	}
}

/** ѕЖАМЕЫА» ГЯ°Ў ЗСґЩ. */
function addItem(int nItemID, int questLevel, string fullNameString, string JournalName)
{
	local LVDataRecord Record;
	local string questTypeStr, levelLimit, npcName;
	local int questType, minLevel, maxLevel;
	local int NpcID, clearedQuestID;
	local Vector loc;
	local bool bStartLoc, bTargetLoc;
	Record.nReserved1 = nItemID;
	Record.LVDataList.length = 8;

	questType    = class'UIDATA_QUEST'.static.GetQuestType( nItemID, questLevel );
	
	questTypeStr = getQuestTypeString(questType);

	minLevel        = class'UIDATA_QUEST'.static.GetMinLevel        ( nItemID, 1 );
	maxLevel        = class'UIDATA_QUEST'.static.GetMaxLevel        ( nItemID, 1 );

	// ГЯГµ·№є§
	if ( minLevel > 0 && maxLevel > 0 )
	{
		levelLimit = minLevel $ "~" $ maxLevel;	
	}
	else if  ( minlevel > 0 )
	{
		levelLimit = minLevel $ " " $ GetSystemString(859); // АМ»у
	}
	else
	{
		levelLimit = GetSystemString(866); // Б¦ЗСѕшАЅ
	}
	record.nReserved2 = questLevel;
	record.LVDataList[0].szData        = string( nItemID );
	record.LVDataList[1].TextColor     = class'L2UIColor'.static.Inst().Sandrift;
	record.LVDataList[1].buseTextColor = True;
	record.LVDataList[1].szData        = questTypeStr;
	record.LVDataList[2].szData = levelLimit;
	record.LVDataList[3].buseTextColor = True;
	
	if (questLevel == 1) 
	{
		record.LVDataList[3].szData     = "[" $ fullNameString $ "]"; // $ ", " $ i $ GetSystemString(537) $ ":" @ JournalName;
		record.LVDataList[3].TextColor  = getInstanceL2Util().Yellow;
	}
	else
	{
		record.LVDataList[3].szData        = "   [" $ fullNameString $ "]"; // $ ", " $ i $ GetSystemString(537) $ ":" @ JournalName;
		record.LVDataList[3].TextColor     = class'L2UIColor'.static.Inst().Sandrift;
	}

	Record.LVDataList[3].hasIcon = true;
	Record.LVDataList[3].attrColor.R=200;
	Record.LVDataList[3].attrColor.G=200;
	Record.LVDataList[3].attrColor.B=200;

	Record.LVDataList[3].attrStat[0]   = Substitute("   " $ questLevel $ ": " $ JournalName, "\\n", "<br1>", FALSE);

	NpcID           = class'UIDATA_QUEST'.static.GetStartNPCID(nItemID, 1 );
	NpcName         = class'UIDATA_NPC'.static.GetNPCName( NpcID );
	
	Record.LVDataList[4].szData = npcName;	

	clearedQuestID = class'UIDATA_QUEST'.static.GetClearedQuest(nItemID, questLevel);

	// БцїЄён 
	loc = class'UIDATA_QUEST'.static.GetTargetLoc(nItemID, questLevel);

	record.LVDataList[5].szData = class'UIDATA_QUEST'.static.GetQuestName(class'UIDATA_QUEST'.static.GetQuestZone(nItemID, questLevel));
	
	//record.LVDataList[5].szData = GetZoneName(loc.x, loc.y, loc.z);

	if (isVectorZero(loc) == false)
	{
		bTargetLoc = true;
	}
	loc = class'UIDATA_QUEST'.static.GetStartNPCLoc(nItemID, questLevel);
	if (isVectorZero(loc) == false)
	{
		bStartLoc = true;
	}

	if (bTargetLoc == true && bStartLoc == true)
	{
		record.LVDataList[6].szData = "OK";
	}
	else if (bTargetLoc == true && bStartLoc == false)
	{   
		record.LVDataList[6].szData = "No StartNPCLoc";
	}
	else if (bTargetLoc == false && bStartLoc == true)
	{   
		record.LVDataList[6].szData = "No TargetLoc";	
	}
	else
	{
		record.LVDataList[6].szData = "No Loc(StartNpcLoc,TargetLoc)";	
	}

	if (clearedQuestID > 0)
	{
		record.LVDataList[7].buseTextColor = True;
		record.LVDataList[7].TextColor  = class'L2UIColor'.static.Inst().Sandrift;
		Record.LVDataList[7].szData = "QuestID:" $ String(clearedQuestID) $ ": "$ class'UIDATA_QUEST'.static.GetQuestName( clearedQuestID );
		Record.LVDataList[7].hasIcon = true;
		Record.LVDataList[7].attrColor.R=200;
		Record.LVDataList[7].attrColor.G=200;
		Record.LVDataList[7].attrColor.B=200;
		Record.LVDataList[7].attrStat[0] = GetSystemString(1201) $ ":" $ class'UIDATA_QUEST'.static.GetRequirement(nItemID, questLevel);
	}
	
	//Record.LVDataList[1].HiddenStringForSorting = util.makeZeroString(6, info.crystalType);
	//Record.LVDataList[1].textAlignment=TA_Left;

	//Record.LVDataList[2].szData = String(info.Id.ClassID);
	//Record.LVDataList[2].textAlignment=TA_Left;

	questListCtrl.InsertRecord( Record );
	
}

/**
 * ДщЅєЖ® »ујјБ¤єё  
 */
private function showQuestDrawer( int QuestID, int level)
{
	local int i;

	//ДщЅєЖ® ·№є§
	// local int Level;
	//ДщЅєЖ® ЕёАФ
	local int QuestType;

	//ГЯГµ ·№є§ ГЦАъ, ГЦ°н
	local int MinLevel, MaxLevel;

	//ДщЅєЖ® ѕЖАМЕЫ param
	local string QuestParam;
	//ДщЅєЖ® ѕЖАМЕЫ °іјц
	local int Max;

	//ДщЅєЖ® ЗКїд ѕЖАМЕЫ ID
	local array<int>		arrItemIDList;
	//ДщЅєЖ® ЗКїд ѕЖАМЕЫ °іјц
	local array<int>		arrItemNumList;

	//єё»у ѕЖАМЕЫ ID
	local Array<int> rewardIDList;	
	//єё»у ѕЖАМЕЫ °іјц
	local Array<INT64> rewardNumList;
	
	//ДщЅєЖ® јТ Б¦ёс
	local string JournalName;
	local string titleName;

	local string npcName;

	local string targetString;
	local string levelText;
	local string questTypeText;

	///////////////////////////
	local Vector loc, targetLoc;
	local string locHtml;
	local int npcID;
	local string questArea;
	local string ItemNumStr;
	local string etcOutputStr;
	
	htmlMsg="";
	htmlMsg="<html><body>" $ htmlTableAdd();

	//Level = 1;

	MinLevel = class'UIDATA_QUEST'.static.GetMinLevel( QuestID, Level );
	MaxLevel = class'UIDATA_QUEST'.static.GetMaxLevel( QuestID, Level );

	npcID   = class'UIDATA_QUEST'.static.GetStartNPCID( QuestID, 1 );
	npcName = class'UIDATA_NPC'.static.GetNPCName( npcID );

	etcOutputStr = etcOutputStr $ "NpcID :" @ npcID $ ", npcName :" @ npcName $ "\\n\\n";

	QuestDescription = class'UIDATA_QUEST'.static.GetQuestDescription( QuestID, Level );
	QuestDescription = Substitute(QuestDescription, "\\n", "<br1>", FALSE);	

	//ДщЅєЖ® јТБ¦ёс
	JournalName = class'UIDATA_QUEST'.static.GetQuestJournalName( QuestID, Level );
	JournalName = class'UIDATA_QUEST'.static.GetQuestJournalNameLine( JournalName );
	titleName = htmlAddText( "[" @ JournalName  @ "]", "hs10", "d4af6f" );

	//·№є§ ЗҐЅГ( 1~23, 11АМ»у, Б¦ЗС ѕшАЅ )
	//txtRecommandedLevelText.SetTextColor( util.Token1 );	
	if ( MaxLevel > 0 && MinLevel > 0)
		levelText =  MinLevel $ "~" $ MaxLevel;
	else if ( MinLevel > 0 )
		levelText =  MinLevel $ " " $ GetSystemString(859);
	else
		levelText = GetSystemString(866);

	//levelText = htmlAddText( levelText, "GameDefault", "ffe58f" );

	//ДщЅєЖ® ЕёАФ
	questType = class'UIDATA_QUEST'.static.GetQuestType( questID, 1 );
	//QuestType = Class'UIDATA_QUEST'.static.GetQuestIscategory( QuestID, Level );

	// ДщЅєЖ®єР·щ ёЮАО, ј­єк...
	if( 0 <= questType && questType <= 13 ) questTypeText = getQuestTypeString(questType);

	questTypeText = htmlfontAdd( questTypeText $ "  [" );

	// А§ДЎЗҐЅГ
	loc = class'UIDATA_QUEST'.static.GetStartNPCLoc( QuestID, 1 );

	etcOutputStr = etcOutputStr $ "startNpc Loc :" @ " x" $ int(loc.x) $ " y" $ int(loc.Y) $ " z" $ int(loc.z) $ "\\n\\n";

	// ЅГАЫ npc Б¤єё°Ў ѕшґЩёй targetLoc А» ВьБ¶
	if (loc.x ==0 && loc.y == 0 && loc.z == 0)	
	{
		loc = class'UIDATA_QUEST'.static.GetTargetLoc(QuestID, Level);
		etcOutputStr = etcOutputStr $ "TargetLoc :" @ " x" $ int(loc.x) $ " y" $ int(loc.Y) $ " z" $ int(loc.z) $ "\\n\\n";
	}
	else
	{
		targetLoc = class'UIDATA_QUEST'.static.GetTargetLoc(QuestID, Level);
		etcOutputStr = etcOutputStr $ "TargetLoc :" @ " x" $ int(targetLoc.x) $ " y" $ int(targetLoc.Y) $ " z" $ int(targetLoc.z) $ "\\n\\n";
	}

	etcOutputStr = etcOutputStr $ "TargetName :" @ class'UIDATA_QUEST'.static.GetTargetName(QuestID, Level)  $ "\\n\\n";

	etcOutputStr = etcOutputStr $ "bOnlyMinimap :" @ class'UIDATA_QUEST'.static.IsMinimapOnly(QuestID, Level)  $ "\\n\\n";
	
	// npc ЅГАЫ А§ДЎё¦ ±вБШАё·О БёАМё§А» ѕтѕоѕЯ Б»ґх ёнИ®ЗС БцїЄёнА» ѕтґВґЩ.
	//questArea    = GetZoneName(loc.x, loc.y, loc.z); // БЯ±№ №цАь ЗФјцАОµн..
	etcOutputStr = etcOutputStr $ "ZoneLoc :" @ " x" $ int(loc.x) $ " y" $ int(loc.Y) $ " z" $ int(loc.z) $ "\\n";

	//Debug("loc.x" @ loc.x);
	//Debug("loc.y" @ loc.y);
	//Debug("loc.z" @ loc.z);

	npcName = Substitute( npcName, " ", "!!", FALSE);

	// ZoomTownMap=0 Аё·О јцБ¤, АьГј°Ў ґЩ їщµеёКАё·О єёАМ±в А§ЗШ...
	//locHtml = "<a action="$ "\"" $ "event eventString=minimap X=" $ loc.x $" Y=" $ loc.y $ " Z=" $ loc.z 
	//		$ " ZoomTownMap=1 UseGrid=0 toolTipStr=" $ npcName $ "\"" $ ">" $ questArea @ GetSystemString(7199) $ "</a>"; //849ba2 8bc733

	locHtml = "(" $ npcName $ ")" $ questArea @ GetSystemString(7199) $ "<br>"; //849ba2 8bc733

	// ДщЅєЖ®АМё§, ГЯГµГјє§ : ·№є§
	htmlMsg = htmlMsg $ titleName $ "<br1>" $ htmlfontAdd(GetSystemString(922) @":"@ levelText) 
		      $ "<br1>" $ questTypeText $ locHtml $ htmlfontAdd("]") $ "<br1></td></tr></table><br>";  

	QuestParam = class'UIDATA_QUEST'.static.GetQuestItem( QuestID, Level );

	ParseInt( QuestParam, "Max", Max );	
	arrItemIDList.Length = Max;	
	arrItemNumList.Length = Max;

	////////// 12.04.20 ёсЗҐїЎ ЗҐЅГЗТ і»їлАМ АЦґВ°Ў? ////////////////////////////////////////////////////////////////////////

	for ( i = 0; i < Max; i++ )
	{
		//ДщЅєЖ® ЗКїд ѕЖАМЕЫ ID
		ParseInt( QuestParam, "ItemID_" $ i, arrItemIDList[i] );
		//ДщЅєЖ® ЗКїд ѕЖАМЕЫ °іјц
		ParseInt( QuestParam, "ItemNum_" $ i, arrItemNumList[i] );

		//јц·®АМ 0АП °жїм 
		if( arrItemNumList[i] == 0 )
		{
			ItemNumStr = GetSystemString( 7292 );
		}
		else
		{
			ItemNumStr = string(arrItemNumList[i]);
		}

		if( arrItemIDList[i] - 1000000 > 0 )
		{

			targetString = htmlfontAdd( targetString $ class'UIDATA_NPC'.static.GetNPCName( arrItemIDList[i] - 1000000) 
				@ ItemNumStr $ "NeedKill") $ "<br1>";  // ГіДЎ
		}
		else
		{
			targetString = htmlfontAdd( targetString $ class'UIDATA_ITEM'.static.GetItemName( GetItemID( arrItemIDList[i] ) )
				@ ItemNumStr $ "NeedItem" ) $ "<br1>"; // И№µж
		}
	}

	if( Max > 0  ) // ёсЗҐ ГЯ°Ў
	{
		targetString = htmlTableAdd() $ "<font name=hs10 color=\"d4af6f\">" $ GetSystemString(7259) $ "</font>" $ "<br1>" 
					   $ targetString $ "<br1></td></tr></table><br>"; 
		htmlMsg = htmlMsg @ targetString; 
	}

	//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

	rewardIDList.Remove(0, rewardIDList.Length);
	rewardNumList.Remove(0, rewardNumList.Length);

	class'UIDATA_QUEST'.static.GetQuestReward( QuestID, Level, rewardIDList, rewardNumList);

	// єё»у 
	if ( rewardIDList.length > 0 )
	{
		setRewardItem( rewardIDList, rewardNumList );
	}

	etcTextBox.SetText(etcOutputStr);

}

/**
 * »ујјБ¤єё єё»у ѕЖАМЕЫГЯ°Ў.
 */
private function setRewardItem( array<int> rewardIDList, array<INT64> rewardNumList )
{
	local int i;
	local string iconName;
	local string itemName;

	//////////////
	local string rewardSmallIconHtml, rewardMsgHtml, rewardEndMsgHtml, itemText;
	local int tableIndex, smallIconIndex;

	local string addItemHtml, htmlString;

	tableIndex = 0;
	smallIconIndex = 0;
	bicIconLen = 0;

	rewardSmallIconHtml = "<table width=280 border=0 cellpadding=0 cellspacing=2 background=L2UI_CT1.HtmlWnd.HTMLWnd_GroupBox_DF_Center>";
	rewardMsgHtml = "<table width=280 border=0 cellpadding=0 cellspacing=2 background=L2UI_CT1.HtmlWnd.HTMLWnd_GroupBox_DF_Center>";

	for ( i = 0 ; i < rewardIDList.Length ; i++ )
	{
		if ( rewardIDList[i] != 57 && rewardIDList[i] != 15623 && rewardIDList[i] != 15624 && rewardIDList[i] != 47130)
		{
			bicIconLen++;
		}
	}
	
	if ( rewardIDList.length > 0 )
	{
		for( i = 0 ; i < rewardIDList.Length ; i++ )
		{

			if( i == 0 )
			{
				//addItemHtml = htmlTableAdd( "L2UI_CT1.HtmlWnd.HTMLWnd_GroupBox_DF_Up" ) $ 
				//			  "<font color=\"d4af6f\" name=name=GameDefault>" $ GetSystemString(1127) $ "</font>" $ 
				//			  "<br1><img src=L2UI_CT1.Divider.Divider_DF_Ver width=286 height=2><br1></td></tr></table>"; // єё»у

				addItemHtml = // htmlTableAdd( "L2UI_CT1.HtmlWnd.HTMLWnd_GroupBox_DF_Up" ) $ 
							  htmlTableAdd( "L2UI_CT1.GroupBox.GroupBox_DF" ) $ 					
							  "<font color=\"ffcc00\" name=GameDefault>" $ GetSystemString(2006) $ "</font>" $ "</td></tr></table>"; // єё»у ѕЖАМЕЫ
			}
							  
							  //"<br1><img src=L2UI_CT1.Divider.Divider_DF_Ver width=274 height=2><br></td></tr></table>"; // єё»у


				switch (rewardIDList[i])
				{
					case 57: // ѕЖµҐіЄ iconName = class'UIDATA_ITEM'.static.GetItemTextureName(GetItemID(57));	
					case 15623: // °жЗиДЎ
					case 15624: // sp, ЅєЕіЖчАОЖ®
					case 47130: // їмИЈµµ
						itemName = class'UIDATA_ITEM'.static.GetItemName(GetItemID(rewardIDList[i]));
						if( rewardIDList[i] == 57 )
						{
							iconName = "L2UI_CT1.HtmlWnd.HTMLWnd_adena";
							itemName = GetSystemString(469);
						}
						else if( rewardIDList[i] == 15623 )
						{
							if (getLanguageNumber() == 1)
							{
								// №М±№ 
								// ГЯИДїЎ xp ѕЖАМДЬАё·О ґлГј ЗПёй µЙµн..
							}

							iconName = "L2UI_CT1.HtmlWnd.HTMLWnd_EXP";
						}
						else if(  rewardIDList[i] == 15624 )
						{
							iconName = "L2UI_CT1.HtmlWnd.HTMLWnd_SP";
						}

						// 2015-11-23 FP ГЯ°Ў (АЫАє ѕЖАМДЬ)
						else if(  rewardIDList[i] == 47130 )
						{
							iconName = "L2UI_CT1.HtmlWnd.HTMLWnd_FP";
						}

						//№МБ¤
						if (rewardNumList[i] == 0)
						{
							itemText = GetSystemString(584);
						}
						else
						{
							// SP АО °жїм 
							if (rewardIDList[i] == 15624)
							{
								//itemText = string(getInstanceUIData().getSPChangedValue(rewardNumList[i]));
								itemText = (String(rewardNumList[i]));
								// Debug("sp rewardNumList[i]" @ rewardNumList[i]);
							}
							// ±ЧїЬ
							else
							{
								itemText = (String(rewardNumList[i]));
							}
						}

						//$ " itemtooltip=\"" $ rewardIDList[i] $ "\"" 
						//rewardSmallIconHtml = rewardSmallIconHtml $ "<tr><td width=38 height=22 align=center valign=center><button width=32 height=16"											  
						//					  $	" back=\"" $ iconName $ "\"" $ " high=\"" $ iconName $ "\"" $ " fore=\"" $ iconName $ "\"></td><td height=22 width=246><font color=ba8860>" 
						//					  $ itemText $"</font>" @ htmlfontAdd(itemName) $ "</td></tr>";

						rewardSmallIconHtml = rewardSmallIconHtml $ "<tr><td width=45 height=23 align=center valign=center><Img width=32 height=18"											  
											  $	" src=\"" $ iconName $ "\"" $ "></td><td height=23 width=246><font color=ba8860>" 
											  $ itemText $"</font>" @ htmlfontAdd(itemName) $ "</td></tr>";

						smallIconIndex = smallIconIndex + 1;
						break;

					default:
						iconName = class'UIDATA_ITEM'.static.GetItemTextureName(GetItemID(rewardIDList[i]));
						itemName = class'UIDATA_ITEM'.static.GetItemName(GetItemID(rewardIDList[i]));

						// Debug("iconName" @ iconName);
						// Debug("rewardIDList[i]"  @ rewardIDList[i]);

						//ѕЖАМЕЫ °іјц
						//№МБ¤
						if (rewardNumList[i] == 0)
						{
							itemText = htmlfontAdd( GetSystemString(584), "ba8860" );
						}
						else
						{
							// ѕЖ·ЎїЎ ЗШґзЗПґВ °жїм ёо "°і" ЗҐЅГ°Ў ѕИµЗѕоѕЯ ЗСґЩ.
							if (rewardIDList[i] == 15623 ||   // °жЗиДЎ  
								rewardIDList[i] == 15624 ||   // ЅєЕі ЖчАОЖ®
								rewardIDList[i] == 15625 ||   // №°АЅЗҐ        
								rewardIDList[i] == 15626 ||   // И°·В ЖчАОЖ®
								rewardIDList[i] == 15627 ||   // ЗчёН ЖчАОЖ®
								rewardIDList[i] == 15628 ||   // ·Јґэ єё»у
								rewardIDList[i] == 15629 ||   // Б¤»кЗь єё»у
								rewardIDList[i] == 15630 ||   // ГЯ°Ў єё»у
								rewardIDList[i] == 15631 ||   // ј­єк Е¬·ЎЅє ±ЗЗС И№µж
								rewardIDList[i] == 15632 ||   // PK Д«їоЖ® ЗП¶ф 
								rewardIDList[i] == 15633)
							{
								itemText = htmlfontAdd((string(rewardNumList[i])), "ba8860");
							}
							else
							{    
								itemText =MakeFullSystemMsg(htmlfontAdd(GetSystemMessage(1983)), htmlfontAdd((string(rewardNumList[i])),"ba8860"),"");
							}
						}

						// Е«»зАМБо ѕЖАМДЬАМ ЗПіЄАП¶§ ё»БЩАУЗҐ ѕИµЗ°Ф 
						if( bicIconLen == 1 )
						{
							rewardMsgHtml = rewardMsgHtml $ "<tr><td align=center valign=center width=43 height=39><button width=32 height=32" 
											$ " itemtooltip=\"" $ rewardIDList[i] $ "\"" $ " back=\"" $ iconName $ "\"" $ " high=\"" $ iconName 
											$ "\"" $  " fore=\"" $ iconName $ "\"></button></td><td width=240 hdight=39>" $ htmlfontAdd(itemName) 
											$ "<br1>"$ itemText $ "</td></tr>";
						}
						else
						{
							if( rewardIDList.Length > 0 && len(itemName) > 8 )
							{
								itemName = mid(itemName, 0 , 8) $ "..";
							}

							if( tableIndex % 2 > 0 ) // Г№№шВ° 
							{
								rewardMsgHtml = mid(rewardMsgHtml, 0 , len(rewardMsgHtml)-5);
								rewardMsgHtml = rewardMsgHtml $ "<td align=center valign=center width=43 height=39><button width=32 height=32" 
												$ " itemtooltip=\"" $ rewardIDList[i] $ "\"" $ " back=\"" $ iconName $ "\"" $ " high=\"" $ iconName 
												$ "\"" $  " fore=\"" $ iconName $ "\"></button></td><td width=115 hdight=39>" $ htmlfontAdd(itemName) 
												$ "<br1>"$ itemText $ "<br1>" $"</td></tr>";
							}
							else 
							{
								rewardMsgHtml = rewardMsgHtml $ htmlTableTrAdd() $  "<tr><td align=center valign=center width=43 height=39><button width=32 height=32" 
												$ " itemtooltip=\"" $ rewardIDList[i] $ "\"" $ " back=\"" $ iconName $ "\"" $ " high=\"" $ iconName 
												$ "\"" $  " fore=\"" $ iconName $ "\"></button></td><td width=115 hdight=39>" $ htmlfontAdd(itemName) 
												$ "<br1>"$ itemText $ "</td></tr>";
							}
						}

						/// Debug("iconName" @ iconName);

						tableIndex = tableIndex + 1;
				}
			
		}

		///////// ё®ЅєЖ® ѕшА» °жїм »иБ¦////////////////////////////////////
		if( tableIndex > 0 )
		{
			rewardMsgHtml = rewardMsgHtml $ "</table>";
		}
		else
		{
			rewardMsgHtml = "";
		}

		if( smallIconIndex > 0 )
		{
			rewardSmallIconHtml = rewardSmallIconHtml $ "</table>";
		}
		else
		{
			rewardSmallIconHtml = "";
		}
		/////////////////////////////////////////////////////////////////////
		
		htmlString = mid(htmlString, 6, len(htmlString)); //<html> ЕЧ±Ч »иБ¦
		htmlString = mid(htmlString, 0, len(htmlString) - 7); //</html> ЕЧ±Ч »иБ¦
		
		//rewardEndMsgHtml = "<table width=290 border=0 cellpadding=0 cellspacing=3 background=L2UI_Ct1_Cn.Deco.TitleBaseBarMini_HtmlTableDown><tr><td width=290></td></tr></table>";
		rewardEndMsgHtml = "<table width=278 border=0 cellpadding=0 cellspacing=1 background=L2UI_CT1.HtmlWnd.HTMLWnd_GroupBox_DF_Down><tr><td width=278></td></tr></table>";

		addItemHtml = htmlString $ addItemHtml $ rewardSmallIconHtml $ rewardMsgHtml $ rewardEndMsgHtml;

		//addItemHtml =  "<html><body>" $ addItemHtml $ "<br><table border=0 cellpadding=0 cellspacing=3 width=288 ><tr><td height=15 align=center valign=center><img src=L2UI_CT1_CN.Deco.Horizontal_Deco width=286 height=8></td></tr><tr><td></td></tr></table></body></html>";
		addItemHtml =  "<html><body>" $ addItemHtml $ "<br><table border=0 cellpadding=0 cellspacing=3 width=288 ><tr><td height=11 align=center valign=center></td></tr><tr><td></td></tr></table><br><br>" $ rewardEndMsgHtml $ QuestDescription $ "</body></html>";
		//addItemHtml =  "<html><body>" $ addItemHtml $ "<br><table border=0 cellpadding=0 cellspacing=3 width=288 ><tr><td height=15 align=center valign=center></td></tr><tr><td></td></tr></table></body></html>";

	//rewardEndMsgHtml = "<table width=290 border=0 cellpadding=0 cellspacing=3 background=L2UI_Ct1_Cn.Deco.TitleBaseBarMini_HtmlTableDown><tr><td width=290></td></tr></table>";

	//QuestDescription = "<br><table border=0 cellpadding=0 cellspacing=3 width=288 ><tr><td height=15 align=center valign=center><img src=L2UI_CT1_CN.Deco.Horizontal_Deco width=286 height=8></td></tr><tr><td>" $ QuestDescription $ "</td></tr></table>";

	//htmlMsg = htmlMsg $ rewardSmallIconHtml $ rewardMsgHtml $ rewardEndMsgHtml $ QuestDescription $ "</body></html>"; // јіёнєОєР ГЯ°Ў
	
		DetailInfoHtmlCtrl.LoadHtmlFromString( addItemHtml );
	}
}

///** ёКїЎ ЗЙА» ІЕґВґЩ.  */
function addPinInTheMap( string ListCtrlID, int SelectedIndex )
{
	local LVDataRecord	record;	
	local int questID, level;

	if ( ListCtrlID == "QuestListCtrl" )
	{ 
		if ( SelectedIndex != -1 ) QuestListCtrl.SetSelectedIndex( SelectedIndex, false );

		QuestListCtrl.GetSelectedRec( record );
		questID = INT( record.nReserved1 ); 
		level = INT( record.nReserved2 ); 
		showQuestDrawer( questID, level );

		//// ёКАМ ї­·Б АЦАёёй ЗШґз А§ДЎ·О ёКА» АМµї
		//if ( GetWindowHandle("MiniMapWnd").IsShowWindow() )
		//{			
		//	loc     = class'UIDATA_QUEST'.static.GetStartNPCLoc( questID, 1 );
		//	// ЅГАЫ npc Б¤єё°Ў ѕшґЩёй targetLoc А» ВьБ¶
		//	if (loc.x + loc.y + loc.z != 0)	loc = class'UIDATA_QUEST'.static.GetTargetLoc(QuestID, 1);

		//	npcID   = class'UIDATA_QUEST'.static.GetStartNPCID( questID, 1 );
		//	npcName = class'UIDATA_NPC'.static.GetNPCName( npcID );
		//	npcName = Substitute( npcName, " ", "!!", FALSE);

		//	//ExecuteEvent(EV_ShowMinimapByHtml, "x=" $ loc.x @ 
		//	//								   "y=" $ loc.y @ 
		//	//								   "z=" $ loc.z @ 
		//	//								   "ZoomTownMap=1" @ 
		//	//								   "UseGrid=0" @ 
		//	//								   "toolTipStr=" $ npcName);

		//	// GetWindowHandle("miniMapWnd").SetFocus();
		//}

		// ДщЅєЖ® ё®ЅєЖ®їЎ ЖчДїЅєё¦ БШґЩ
		if( SelectedIndex == -1 ) QuestListCtrl.SetFocus();

		//if( INT( record.nReserved2 ) == 1 )
		//{
		//	TeleportButton.DisableWindow();
		//}
		//else
		//{
		//	TeleportButton.EnableWindow();
		//}
	}
}

private function AddPinInTheGfxMap()
{
	local RichListCtrlRowData rowData;
	local NQuestUIData o_data;

	QuestListCtrl_RichList.GetSelectedRec(rowData);
	if(! API_GetNQuestData(int(rowData.nReserved1), o_data))
	{
		return;
	}
	ShowNewQuestDefaultInfo(o_data);
	SetNewQuestDetailInfo(o_data);	
}

private function FindAllQuestAdena()
{
	local int qid;
	local string SearchString;
	local NQuestUIData questUIData;

	questListCtrl.HideWindow();
	QuestListCtrl_RichList.ShowWindow();
	QuestListCtrl_RichList.DeleteAllItem();
	SearchString = searchEditBox.GetString();
	
	for(qid = class'UIDATA_QUEST'.static.GetNFirstID(); -1 != qid; qid = class'UIDATA_QUEST'.static.GetNNextID())
	{
		if(! API_GetNQuestData(qid, questUIData))
		{			
		}
		else
		{
			if(! ChkQuestString(SearchString, questUIData))
			{				
			}
			else
			{
				AddItemNewQuest(questUIData);
			}
		}
	}	
}

private function AddItemNewQuest(NQuestUIData questUIData)
{
	local RichListCtrlRowData rowData;
	local string startNpcname, endNpcname;

	rowData.nReserved1 = questUIData.Id;
	rowData.cellDataList.Length = 8;
	rowData.cellDataList[0].HiddenStringForSorting = string(questUIData.Id);
	rowData.cellDataList[0].szData = string(questUIData.Id);
	addRichListCtrlString(rowData.cellDataList[0].drawitems, string(questUIData.Id), GetColor(200, 200, 200, 255), true);
	rowData.cellDataList[1].HiddenStringForSorting = string(questUIData.Type);
	addRichListCtrlString(rowData.cellDataList[1].drawitems, GetNewQuestTypeAdena(questUIData.Type), class'L2UIColor'.static.Inst().Sandrift, true);
	rowData.cellDataList[2].HiddenStringForSorting = string(questUIData.LevelMin);
	addRichListCtrlString(rowData.cellDataList[2].drawitems, GetNewLevelString(questUIData), class'L2UIColor'.static.Inst().Sandrift, true);
	rowData.cellDataList[3].HiddenStringForSorting = questUIData.Name;
	addRichListCtrlString(rowData.cellDataList[3].drawitems, questUIData.Name, GetColor(200, 200, 200, 255), true);
	rowData.cellDataList[3].szData = questUIData.Name;
	if(questUIData.TeleportID > 0)
	{
		addRichListCtrlButton(rowData.cellDataList[3].drawitems, "telBtn_" $ string(questUIData.TeleportID), 0, 0, "L2UI_CT1.Minimap.TelIcon_16", "L2UI_CT1.Minimap.TelIcon_16", "L2UI_CT1.Minimap.TelIcon_16", 16, 16, 16, 16);
	}
	startNpcname = class'UIDATA_NPC'.static.GetNPCName(questUIData.StartNPC.Id);
	rowData.cellDataList[4].HiddenStringForSorting = startNpcname;
	addRichListCtrlString(rowData.cellDataList[4].drawitems, startNpcname, GetColor(200, 200, 200, 255), true);
	if(questUIData.StartNPC.TeleportID > 0)
	{
		addRichListCtrlButton(rowData.cellDataList[4].drawitems, "telBtn_" $ string(questUIData.StartNPC.TeleportID), 0, 0, "L2UI_CT1.Minimap.TelIcon_16", "L2UI_CT1.Minimap.TelIcon_16", "L2UI_CT1.Minimap.TelIcon_16", 16, 16, 16, 16);
	}
	endNpcname = class'UIDATA_NPC'.static.GetNPCName(questUIData.EndNPC.Id);
	rowData.cellDataList[5].HiddenStringForSorting = endNpcname;
	addRichListCtrlString(rowData.cellDataList[5].drawitems, endNpcname, GetColor(200, 200, 200, 255), true);
	if(questUIData.EndNPC.TeleportID > 0)
	{
		addRichListCtrlButton(rowData.cellDataList[5].drawitems, "telBtn_" $ string(questUIData.EndNPC.TeleportID), 0, 0, "L2UI_CT1.Minimap.TelIcon_16", "L2UI_CT1.Minimap.TelIcon_16", "L2UI_CT1.Minimap.TelIcon_16", 16, 16, 16, 16);
	}
	QuestListCtrl_RichList.InsertRecord(rowData);	
}

private function ShowNewQuestDefaultInfo(NQuestUIData questUIData)
{
	local string HtmlString;

	HtmlString = HtmlQuestnameTableAdd(questUIData.Name);
	AddHtmlString(HtmlString, GetNewQuestType(questUIData));
	AddHtmlString(HtmlString, GetNewQuestDesc(questUIData));
	AddHtmlString(HtmlString, GetGoalText(questUIData.Goal.Name, 0, questUIData.Goal.Num));
	AddHtmlString(HtmlString, GetRewardItems(questUIData.Reward));
	HtmlString = "<html><body>" $ HtmlString $ "</body></html>";
	DetailInfoHtmlCtrl.LoadHtmlFromString(htmlSetHtmlStart(HtmlString));	
}

private function string HtmlQuestnameTableAdd(string Title)
{
	local string hex;

	hex = class'L2UIColor'.static.Inst()._Color2ZeroX(class'L2UIColor'.static.Inst().Sandrift);
	return "<table width=290 cellpadding=0 border=0 cellspacing=0><tr><td width=26> <img src = \"L2UI_CT1.Minimap.Minimap_OpenGuideWnd\" width=26 height=26></td><td width=254 align=left valign=bottom><font color=\"" $ hex $ "\" name=GameDefault>" $ Title $ "</font></td></tr></table>";	
}

private function string GetNewQuestDesc(NQuestUIData questUIData)
{
	local NQuestDialogUIData questDialogUIData;

	if(! API_GetNQuestDialogData(questUIData.Id, questDialogUIData))
	{
		return "";
	}
	return "<table width=290 border=0 cellpadding=2 cellspacing=2 background=L2UI_CT1.GroupBox.GroupBox_DF><tr><td>" $ questDialogUIData.QuestInfo $ "</td></tr></table>";	
}

private function string GetNewQuestType(NQuestUIData questUIData)
{
	local string questMainType;

	questMainType = GetMainTypeString(questUIData);
	return "<table width=290 border=0 cellpadding=2 cellspacing=2 background=L2UI_CT1.GroupBox.GroupBox_DF><tr><td align=left>" $ questMainType $ " " $ htmlfontAdd(GetNewQuestTypeAdena(questUIData.Type), class'L2UIColor'.static.Inst()._Color2ZeroX(class'L2UIColor'.static.Inst().Sandrift)) $ "</td></tr><tr><td>" $ GetSystemString(922) $ " " $ htmlfontAdd(GetNewLevelString(questUIData), class'L2UIColor'.static.Inst()._Color2ZeroX(class'L2UIColor'.static.Inst().Sandrift)) $ "</td></tr></table>";	
}

private function string GetNewQuestTypeAdena(ENQuestType Type)
{
	switch(Type)
	{
		case ENQuestType.NQT_ONETIME/*1*/:
			return GetSystemString(862);
		case ENQuestType.NQT_DAILY/*2*/:
			return GetSystemString(2788);
		case ENQuestType.NQT_WEEKLY/*3*/:
			return GetSystemString(14389);
		case ENQuestType.NQT_REPEAT/*4*/:
			return GetSystemString(861);
	}

	return "";
}

private function string GetTeleportName(int tID)
{
	local TeleportListAPI.TeleportListData tInfo;

	for(tInfo = class'TeleportListAPI'.static.GetFirstTeleportListData(); "" != tInfo.Name; tInfo = class'TeleportListAPI'.static.GetNextTeleportListData())
	{
		if(tInfo.Id == tID)
		{
			return tInfo.Name;
		}
	}
	return "";	
}

private function string GetMainTypeString(NQuestUIData questUIData)
{
	if(questUIData.Id < 20001)
	{
		return GetSystemString(2738);		
	}
	else if(questUIData.Id < 30001)
	{
		return GetSystemString(2341);
	}

	return GetSystemString(1796);	
}

private function string GetNewLevelString(NQuestUIData qUIData)
{
	if(qUIData.LevelMax > 0 && qUIData.LevelMin > 0)
	{
		return string(qUIData.LevelMin) $ "~" $ string(qUIData.LevelMax);		
	}
	else if(qUIData.LevelMin > 0)
	{
		return string(qUIData.LevelMin) $ " " $ GetSystemString(859);
	}

	return GetSystemString(866);	
}

private function string GetGoalText(string Goalname, int Cnt, int goalNum)
{
	local string goalNuMString;

	if(goalNum > 1)
	{
		goalNuMString = " " $ string(goalNum);
	}

	return HtmlTitleTableAdd(GetSystemString(14407)) $ "<table width=290 border=0 cellpadding=2 cellspacing=2 background=L2UI_CT1.GroupBox.GroupBox_DF><tr><td>" $ Goalname $ goalNuMString $ "</td></tr></table>";	
}

private function string GetRewardItems(NQuestRewardData rewardDatas)
{
	local int i;
	local string IconName, ItemName, rewardMsgHtml, itemNumText, NameColor, numColor;

	local array<NQuestRewardItemData> Items;
	local NQuestRewardItemData rewardItemData;

	if(rewardDatas.Level > 0)
	{
		rewardItemData.ItemClassID = 95641;
		rewardItemData.Amount = rewardDatas.Level;
		Items[Items.Length] = rewardItemData;
	}
	if(rewardDatas.Exp > 0)
	{
		rewardItemData.ItemClassID = 15623;
		rewardItemData.Amount = rewardDatas.Exp;
		Items[Items.Length] = rewardItemData;
	}
	if(rewardDatas.Sp > 0)
	{
		rewardItemData.ItemClassID = 15624;
		rewardItemData.Amount = rewardDatas.Sp;
		Items[Items.Length] = rewardItemData;
	}

	for(i = 0; i < rewardDatas.Items.Length; i++)
	{
		Items[Items.Length] = rewardDatas.Items[i];
	}
	NameColor = class'L2UIColor'.static.Inst()._Color2ZeroX(class'L2UIColor'.static.Inst().BrightWhite);
	numColor = class'L2UIColor'.static.Inst()._Color2ZeroX(class'L2UIColor'.static.Inst().Sandrift);

	for(i = 0; i < Items.Length; i++)
	{
		if(Items[i].Amount == 0)
		{
			itemNumText = htmlfontAdd(GetSystemString(584), numColor);			
		}
		else
		{
			switch(Items[i].ItemClassID)
			{
				case 57:
					itemNumText = htmlfontAdd(MakeFullSystemMsg(GetSystemMessage(2932), MakeCostString(string(Items[i].Amount)), ""), numColor);
					break;
				case 15623:
				case 15624:
				case 15625:
				case 15626:
				case 15627:
				case 15628:
				case 15629:
				case 15630:
				case 15631:
				case 15632:
				case 15633:
				case 47130:
					itemNumText = htmlfontAdd(MakeCostString(string(Items[i].Amount)), numColor);
					break;
				case 95641:
					itemNumText = htmlfontAdd(MakeFullSystemMsg(GetSystemMessage(13405), MakeCostString(string(Items[i].Amount)), ""), numColor);
					break;
				default:
					itemNumText = htmlfontAdd(MakeFullSystemMsg(GetSystemMessage(1983), MakeCostString(string(Items[i].Amount)), ""), numColor);
					break;
			}
		}
		IconName = class'UIDATA_ITEM'.static.GetItemTextureName(GetItemID(Items[i].ItemClassID));
		ItemName = class'UIDATA_ITEM'.static.GetItemName(GetItemID(Items[i].ItemClassID));
		if(Items.Length == 1)
		{
			rewardMsgHtml = "<tr><td align=center valign=center width=40 height=39><button width=32 height=32" $ " itemtooltip=\"" $ string(Items[i].ItemClassID) $ "\"" $ " back=\"" $ IconName $ "\"" $ " high=\"" $ IconName $ "\"" $ " fore=\"" $ IconName $ "\"></button></td><td width=245 hdight=39>" $ htmlfontAdd(ItemName, NameColor) $ "<br1>" $ itemNumText $ "</td></tr>";
			// [Explicit Continue]
			continue;
		}
		if((Items.Length > 0) && Len(ItemName) > 8)
		{
			ItemName = Mid(ItemName, 0, 8) $ "..";
		}
		if((float(i) % 2) == 0)
		{
			rewardMsgHtml = rewardMsgHtml $ "<tr><td align=center valign=center width=40 height=39><button width=32 height=32" $ " itemtooltip=\"" $ string(Items[i].ItemClassID) $ "\"" $ " back=\"" $ IconName $ "\"" $ " high=\"" $ IconName $ "\"" $ " fore=\"" $ IconName $ "\"></button></td><td width=105 hdight=39>" $ htmlfontAdd(ItemName, NameColor) $ "<br1>" $ itemNumText $ "</td></tr>";
			// [Explicit Continue]
			continue;
		}
		rewardMsgHtml = Mid(rewardMsgHtml, 0, Len(rewardMsgHtml) - 5);
		rewardMsgHtml = rewardMsgHtml $ "<td align=center valign=center width=40 height=39><button width=32 height=32" $ " itemtooltip=\"" $ string(Items[i].ItemClassID) $ "\"" $ " back=\"" $ IconName $ "\"" $ " high=\"" $ IconName $ "\"" $ " fore=\"" $ IconName $ "\"></button></td><td width=105 hdight=39>" $ htmlfontAdd(ItemName, NameColor) $ "<br1>" $ itemNumText $ "<br1>" $ "</td></tr>";
	}
	if(rewardMsgHtml == "")
	{
		return "";
	}
	return HtmlTitleTableAdd(GetSystemString(14408)) $ "<table width=290 border=0 cellpadding=2 cellspacing=0 background=L2UI_CT1.GroupBox.GroupBox_DF>" $ rewardMsgHtml $ "</table>";	
}

private function string HtmlTitleTableAdd(string Title, optional Color C)
{
	local string hex;

	if(C.R == 0 && C.G == 0 && C.B == 0 && C.A == 0)
	{
		C = class'L2UIColor'.static.Inst().Sandrift;
	}
	hex = class'L2UIColor'.static.Inst()._Color2ZeroX(C);
	return "<table width=290 cellpadding=0 border=0 cellspacing=0><tr><td width=290><font color=\"" $ hex $ "\" name=GameDefault>" $ Title $ "</font></td></tr></table>";	
}

private function SetNewQuestDetailInfo(NQuestUIData questUIData)
{
	local string detailString;
	local NQuestDialogUIData questDialogUIData;

	if(questUIData.StartNPC.Id > 0)
	{
		AddString(detailString, ("시작 : " $ class'UIDATA_NPC'.static.GetNPCName(questUIData.StartNPC.Id)) @ string(questUIData.StartNPC.Id));
		AddString(detailString, "ㆍV : " $ string(int(questUIData.StartNPC.Location.X)) $ " / " $ string(int(questUIData.StartNPC.Location.Y)) $ " / " $ string(int(questUIData.StartNPC.Location.Z)));
		if(questUIData.StartNPC.TeleportID > 0)
		{
			AddString(detailString, ("ㆍT : " $ GetTeleportName(questUIData.StartNPC.TeleportID)) @ string(questUIData.StartNPC.TeleportID));
		}		
	}
	else
	{
		AddString(detailString, "시작 : 없음");
	}
	AddString(detailString);
	if(questUIData.EndNPC.Id > 0)
	{
		AddString(detailString, ("종료 : " $ class'UIDATA_NPC'.static.GetNPCName(questUIData.EndNPC.Id)) @ string(questUIData.EndNPC.Id));
		AddString(detailString, "ㆍV : " $ string(int(questUIData.EndNPC.Location.X)) $ " / " $ string(int(questUIData.EndNPC.Location.Y)) $ " / " $ string(int(questUIData.EndNPC.Location.Z)));
		if(questUIData.EndNPC.TeleportID > 0)
		{
			AddString(detailString, ("ㆍT : " $ GetTeleportName(questUIData.EndNPC.TeleportID)) @ string(questUIData.EndNPC.TeleportID));
		}		
	}
	else
	{
		AddString(detailString, "종료 : 없음");
	}
	AddString(detailString);
	if(questUIData.TeleportID > 0)
	{
		AddString(detailString, "Loc : " $ GetTeleportName(questUIData.TeleportID));
		AddString(detailString, "ㆍV : " $ string(int(questUIData.Location.X)) $ " / " $ string(int(questUIData.Location.Y)) $ " / " $ string(int(questUIData.Location.Z)));
		AddString(detailString, ("ㆍT :" @ (GetTeleportName(questUIData.TeleportID))) @ string(questUIData.TeleportID));		
	}
	else
	{
		AddString(detailString, "Loc : 없음");
	}
	etcTextBox.SetText(detailString);
	API_GetNQuestDialogData(questUIData.Id, questDialogUIData);	
}

private function OnTeleportDialogConfirm()
{
	local UserInfo UserInfo;

	teleportDialog.Hide();
	if((GetPlayerInfo(UserInfo)) == false)
	{
		return;
	}
	if(UserInfo.nCurHP == 0)
	{
		getInstanceL2Util().showGfxScreenMessage(GetSystemMessage(5243));
		teleportDialog.Hide();
		return;
	}
	class'TeleportListAPI'.static.RequestTeleport(teleportDialog.nDialogID);
}

private function OnTeleportDialogCancel()
{
	teleportDialog.Hide();
}

private function ShowTeleportDialog(int TeleportID)
{
	local string Desc, teleportName;
	local TeleportListAPI.TeleportListData targetTeleport;
	local INT64 teleportCost;

	if(! GetCurrentTeleportInfo(targetTeleport, TeleportID))
	{
		return;
	}
	if(targetTeleport.Level > 0)
	{
		teleportName = "(" $ targetTeleport.Name $ " Lv " $ string(targetTeleport.Level) $ ")";		
	}
	else
	{
		teleportName = "(" $ targetTeleport.Name $ ")";
	}
	Desc = GetSystemMessage(5239) $ "\\n\\n" $ teleportName;
	teleportDialog.SetDialogDesc(Desc);
	teleportDialog.SetUseNeedItem(true);
	teleportDialog.StartNeedItemList(1);
	teleportCost = class'TeleportWnd'.static.Inst().GetTeleportCost(targetTeleport.Price[0].Amount, targetTeleport.UsableLevel, targetTeleport.UsableTransferDegree);
	if(targetTeleport.Price.Length > 0)
	{
		teleportDialog.AddNeedItemClassID(targetTeleport.Price[0].Id, teleportCost);
	}
	teleportDialog.SetItemNum(1);
	teleportDialog.Show();
	teleportDialog.nDialogID = TeleportID;
	teleportDialog.DelegateOnClickBuy = OnTeleportDialogConfirm;
	teleportDialog.DelegateOnCancel = OnTeleportDialogCancel;	
}

private function bool GetCurrentTeleportInfo(out TeleportListAPI.TeleportListData o_tInfo, int TeleportID)
{
	local TeleportListAPI.TeleportListData tInfo;

	for(tInfo = class'TeleportListAPI'.static.GetFirstTeleportListData(); "" != tInfo.Name; tInfo = class'TeleportListAPI'.static.GetNextTeleportListData())
	{
		if(tInfo.Id == TeleportID)
		{
			o_tInfo = tInfo;
			return true;
		}
	}

	return false;	
}

function string htmlTableAdd( optional string backgroundUrl )
{
	local string htmlStr;

	if( backgroundUrl == "" ) 
		htmlStr = "<table width=290 cellpadding=2 border=0 cellspacing=0" $ "><tr><td width=0></td><td width=290>";
	else 
		htmlStr = "<table width=290 cellpadding=2 border=0 cellspacing=0 background="$ backgroundUrl $"><tr><td width=0></td><td width=290>";
		// backgroundUrl = "L2UI_Ct1_Cn.Deco.TitleBaseBarMini";

	return htmlStr;
}

private function string htmlTableTrAdd()
{
	return "<tr><td width=40 ></td><td width=115 ></td><td width=40 ></td><td width=115 ></td></tr>";
}

private function string htmlfontAdd( string strText, optional string fontColor )
{
	local string targetHtml;
	if( fontColor == "" ) fontColor = "d3c5ae";
	
	targetHtml = "<font color=\"" $ fontColor $ "\"" $ ">" $ strText $ "</font>";

	return targetHtml;
}

// №М±№ xp ЗҐЗцА» А§ЗШј­..
private function int getLanguageNumber()
{
	local ELanguageType Language;	
	local int languageNum;

	Language = GetLanguage();
		
	switch( Language )
	{	
		case LANG_Korean:
			languageNum = 0;
			break;	
		case LANG_English:
			languageNum = 1;
			break;
		case LANG_Japanese:
			languageNum = 2;
			break;
		case LANG_Taiwan:
			languageNum = 3;
			break;
		case LANG_Chinese:	
			languageNum = 4;
			break;
		case LANG_Thai:		
			languageNum = 5;
			break;
		case LANG_Philippine:
			languageNum = 6;
			break;
		case LANG_Indonesia:
			languageNum = 7;
			break;
		case LANG_Russia:	
			languageNum = 8;
			break;
		case LANG_Euro:	
			languageNum = 9;
			break;
		case LANG_Germany:	
			languageNum = 10;
			break;
		case LANG_France:	
			languageNum = 11;
			break;
		case LANG_Poland:	
			languageNum = 12;
			break;
		case LANG_Turkey:	
			languageNum = 13;
			break;
		//end of branch
		default:
			languageNum = 0;
			break;
	}	

	return languageNum;		

}

private function AddHtmlString(out string HtmlString, string AddString)
{
	if(AddString == "")
	{
		return;
	}
	HtmlString = HtmlString $ "<br>" $ AddString;	
}

private function AddString(out string textstring, optional string AddString)
{
	if(textstring != "")
	{
		textstring = textstring $ "\\n";
	}
	if(AddString == "")
	{
		return;
	}
	textstring = textstring $ AddString;	
}

private function bool API_GetNQuestData(int a_QuestID, out NQuestUIData o_data)
{
	return GetNQuestData(a_QuestID, o_data);	
}

private function bool API_GetNQuestDialogData(int a_QuestID, out NQuestDialogUIData o_data)
{
	return GetNQuestDialogData(a_QuestID, o_data);	
}

private function API_GetClientCursorPos(out int X, out int Y)
{
	GetClientCursorPos(X, Y);	
}

private function RQ_C_EX_QUEST_TELEPORT()
{
	local array<byte> stream;
	local UIPacket._C_EX_QUEST_TELEPORT packet;

	packet.nID = teleportDialog.nDialogID;
	if(! class'UIPacket'.static.Encode_C_EX_QUEST_TELEPORT(stream, packet))
	{
		return;
	}
	class'UIPacket'.static.RequestUIPacket(class'UIPacket'.const.C_EX_QUEST_TELEPORT, stream);	
}
