#include "NetCli_Script.h"

// ¥þ°ì«Å§i
//-------------------------------------------------------------------
CNetCli_Script*		CNetCli_Script::m_pThis		= NULL;

//-------------------------------------------------------------------
CNetCli_Script::CNetCli_Script(void)
{

}
// --------------------------------------------------------------------------------------
CNetCli_Script::~CNetCli_Script(void)
{

}
// --------------------------------------------------------------------------------------
bool CNetCli_Script::Init()
{
	Cli_NetReg( PG_Script_LtoC_QuestAccept_Result		);
	Cli_NetReg( PG_Script_LtoC_QuestComplete_Result		);
	Cli_NetReg( PG_Script_LtoC_QuestDelete_Result		);
	Cli_NetReg( PG_Script_LtoC_QuestFlag				);
	Cli_NetReg( PG_Script_LtoC_ClickQuestObjResult		);
	Cli_NetReg( PG_Script_LtoC_QuestKillObjNotify		);
	Cli_NetReg( PG_Script_LtoC_PlayMotion				);
	

	return true;
}
// --------------------------------------------------------------------------------------
bool CNetCli_Script::Release()
{

	return true;
}
//--------------------------------------------------------------------------------------
void CNetCli_Script::Update				()
{
	/*
	if( m_pThis )
		m_pThis->OnUpdate();
	*/
}
//--------------------------------------------------------------------------------------
void CNetCli_Script::_PG_Script_LtoC_QuestAccept_Result ( int iCliID , int iSize , PVOID pData )
{
	M_PACKET( PG_Script_LtoC_QuestAccept_Result );	
	int a = 3;
	m_pThis->OnQuestAcceptResult( pPacket->iQuestField, pPacket->iQuestID, pPacket->emResult );
}
//--------------------------------------------------------------------------------------
void CNetCli_Script::_PG_Script_LtoC_QuestComplete_Result ( int iCliID , int iSize , PVOID pData )
{
	M_PACKET( PG_Script_LtoC_QuestComplete_Result );
	int a = 3;
	m_pThis->OnQuestCompleteResult( pPacket->iQuestField, pPacket->iQuestID, pPacket->emResult );
}
//--------------------------------------------------------------------------------------
void CNetCli_Script::_PG_Script_LtoC_QuestDelete_Result ( int iCliID , int iSize , PVOID pData )
{
	M_PACKET( PG_Script_LtoC_QuestDelete_Result );	
	m_pThis->OnQuestDeleteResult( pPacket->iQuestField, pPacket->iQuestID, pPacket->emResult );
}
//--------------------------------------------------------------------------------------
void CNetCli_Script::_PG_Script_LtoC_QuestFlag ( int iCliID , int iSize , PVOID pData )
{
	M_PACKET( PG_Script_LtoC_QuestFlag );
	m_pThis->OnQuestFlag( pPacket->iQuestFlagID, pPacket->iVal );
}
//--------------------------------------------------------------------------------------
void CNetCli_Script::_PG_Script_LtoC_ClickQuestObjResult		( int iCliID , int iSize , PVOID pData )
{
	M_PACKET( PG_Script_LtoC_ClickQuestObjResult );
	m_pThis->OnClickQuestObjResult( pPacket->iResult, pPacket->iItemID );
}
//--------------------------------------------------------------------------------------
void CNetCli_Script::_PG_Script_LtoC_QuestKillObjNotify		( int iCliID , int iSize , PVOID pData )
{
	M_PACKET( PG_Script_LtoC_QuestKillObjNotify );
	m_pThis->OnQuestKillObjNotify( pPacket->iQuestField, pPacket->iQuestID, pPacket->iDeadObjID );
}
//--------------------------------------------------------------------------------------
void CNetCli_Script::_PG_Script_LtoC_PlayMotion		( int iCliID , int iSize , PVOID pData )
{
	M_PACKET( PG_Script_LtoC_PlayMotion );
	m_pThis->OnPlayMotion( pPacket->iObjID, pPacket->szMotion );
}
//--------------------------------------------------------------------------------------
void CNetCli_Script::AcceptQuest			( int iQuestNpcID, int iQuestID )
{
	PG_Script_CtoL_QuestAccept Packet;

	Packet.iQuestNpcID	= iQuestNpcID;
	Packet.iQuestID		= iQuestID;

	SendToLocal( sizeof( Packet ) , &Packet );

}
//------------------------------------------------------------------------------
void CNetCli_Script::CompleteQuest		( int iQuestNpcID, int iQuestID, int iChoiceID )
{
	PG_Script_CtoL_QuestComplete Packet;

	Packet.iQuestNpcID	= iQuestNpcID;
	Packet.iQuestID		= iQuestID;
	Packet.iChoiceID	= iChoiceID;

	SendToLocal( sizeof( Packet ) , &Packet );
}
//--------------------------------------------------------------------------------------
void CNetCli_Script::DeleteQuest					( int iQuestField, int iQuestID )
{
	PG_Script_CtoL_QuestDelete	Packet;

	Packet.iQuestField	= iQuestField;
	Packet.iQuestID		= iQuestID;
	
	SendToLocal( sizeof( Packet ) , &Packet );
}
//--------------------------------------------------------------------------------------
void CNetCli_Script::TouchEvent			( int iObjID )
{
	PG_Script_CtoL_TouchEvent Packet;

	Packet.iEventObjID	= iObjID;

	SendToLocal( sizeof( Packet ), &Packet );
}
//--------------------------------------------------------------------------------------
void CNetCli_Script::RangeEvent			( int iObjID )
{
	PG_Script_CtoL_RangeEvent Packet;

	Packet.iEventObjID	= iObjID;

	SendToLocal( sizeof( Packet ), &Packet );
}
//--------------------------------------------------------------------------------------
void CNetCli_Script::ClickQuestObj ( int iQuestField, int iQuestID, int iClickObjID, int iClickObj )
{
	PG_Script_CtoL_ClickQuestObj	Packet;

	Packet.iQuestField	= iQuestField;
	Packet.iQuestID		= iQuestID;
	Packet.iClickObjID	= iClickObjID;
	Packet.iClickObj	= iClickObj;

	SendToLocal( sizeof( Packet ), &Packet );
}