#pragma     once
#pragma warning (disable:4949)
#include "../../RoleData/RoleBaseDef.h"
#include "..\NetWakerPGEnum.h"
#pragma unmanaged

//------------------------------------------------------------------------------------------
//Client -> Server
//準備施法
struct PG_Magic_CtoL_BeginSpell
{
    GamePGCommandEnum	Command;

    int                 OwnerID;
    int				    MagicID;		//所要施的法術
    int				    TargetID;		//目標

    int			    	MagicPos;		//法術資料位置

    PG_Magic_CtoL_BeginSpell()
    {
        Command = EM_PG_Magic_CtoL_BeginSpell;
    };
};
//------------------------------------------------------------------------------------------
//Server -> Client
//準備施法(通知週圍人)
struct PG_Magic_LtoC_BeginSpell
{
    GamePGCommandEnum	Command;

    int			    	OwnerID;		//施法者
    int			    	TargetID;		//施法目標
    int			    	Magic;			//所要施的法術
	float				TargetX;
	float				TargetY;
	float				TargetZ;

	int					SerialID;		//同一次施法的封包會有相同的號碼

    PG_Magic_LtoC_BeginSpell()
    {
        Command = EM_PG_Magic_LtoC_BeginSpell;
    };	
};
//------------------------------------------------------------------------------------------
//Client -> Server
//準備施法 指定位置
struct PG_Magic_CtoL_BeginSpell_Pos
{
	GamePGCommandEnum	Command;

	int                 OwnerID;
	int				    MagicID;		//所要施的法術
	int			    	MagicPos;		//法術資料位置
	float				X , Y , Z;		//位置

	PG_Magic_CtoL_BeginSpell_Pos()
	{
		Command = EM_PG_Magic_CtoL_BeginSpell_Pos;
	};
};
//------------------------------------------------------------------------------------------
//Server -> Client
//施法結束(通知週圍人)
struct PG_Magic_LtoC_EndSpell
{
    GamePGCommandEnum	Command;

	int					SerialID;		//同一次施法的封包會有相同的號碼

    PG_Magic_LtoC_EndSpell()
    {
        Command = EM_PG_Magic_LtoC_EndSpell;
    };	
};

//------------------------------------------------------------------------------------------
//Server -> Client
//準備施法結果
struct PG_Magic_LtoC_BeginSpellResult
{
    GamePGCommandEnum	Command;

    int				    MagicID;		//所要施的法術
	int					SerialID;		//同一次施法的封包會有相同的號碼
	int					SpellTime;		//施法時間
    bool        		Result;			//成功施敗
	

    PG_Magic_LtoC_BeginSpellResult()
    {
        Command = EM_PG_Magic_LtoC_BeginSpellResult;
    };	
};
//------------------------------------------------------------------------------------------
//Server -> Client
//魔法攻擊封包
enum    MagicAtkResultENUM
{
    EM_MagicAtkResult_Miss      ,		
    EM_MagicAtkResult_Normal    ,
	EM_MagicAtkResult_Critial   ,
	EM_MagicAtkResult_NoEffect  ,		//無效
	EM_MagicAtkResult_Absorb    ,		//吸收
};
struct  MagicAtkEffectInfoStruct
{
    int                     GItemID;
    MagicAtkResultENUM      Result;

	float					Value;	//變化值
};

struct	PG_Magic_LtoC_MagicAttack
{
    GamePGCommandEnum	Command;

    int			    	MagicBaseID;
	MagicAttackTypeENUM	AtkType;
	int					SerialID;	//同一次施法的封包會有相同的號碼
    int                 Count;      //數量

    MagicAtkEffectInfoStruct Atk[100];   

    PG_Magic_LtoC_MagicAttack( )
    {
        Command = EM_PG_Magic_LtoC_MagicAttack;
    }
    
    int Size()
    {
        return ( sizeof(*this) - sizeof( Atk ) + Count * sizeof( MagicAtkEffectInfoStruct ) );
    }
};

//------------------------------------------------------------------------------------------
//Server -> Client
//助法術的結果
struct  MagicAssistEffectInfoStruct
{
    int                     GItemID;
    int                     EffectTime;
    MagicAtkResultENUM      Result;
};
struct	PG_Magic_LtoC_MagicAssistResult
{
    GamePGCommandEnum	        Command;

    int			    	        MagicBaseID;
	int							SerialID;		//同一次施法的封包會有相同的號碼
    int                         Count;
    MagicAssistEffectInfoStruct Atk[100];     //受影響的ID List

    PG_Magic_LtoC_MagicAssistResult()
    {
        Command = EM_PG_Magic_LtoC_MagicAssistResult;
    }

    int Size()
    {
        return ( sizeof(*this) - sizeof( Atk ) + Count * sizeof( MagicAssistEffectInfoStruct ) );
    }
};

//------------------------------------------------------------------------------------------
//Server -> Client
//修正某個輔助法術有效的時間
struct	PG_Magic_LtoC_FixAssistMagicTime
{
    GamePGCommandEnum	Command;
    int		    		MagicID;
    int		    		EffectTime;

    PG_Magic_LtoC_FixAssistMagicTime()
    {
        Command = EM_PG_Magic_LtoC_FixAssistMagicTime;
    }
};
//------------------------------------------------------------------------------------------
// Server -> Client 
//取消某人施法
struct	PG_Magic_LtoC_CancelSpellMagic
{
    GamePGCommandEnum	Command;

    int			    	OwnerID;
	int					SerialID;		//同一次施法的封包會有相同的號碼

    PG_Magic_LtoC_CancelSpellMagic()
    {
        Command = EM_PG_Magic_LtoC_CancelSpellMagic;
    }
};
//------------------------------------------------------------------------------------------
//要求法術配點
struct	PG_Magic_CtoL_SetMagicPoint
{
    GamePGCommandEnum	Command;
    int                 MagicID;
    int                 MagicPos;

    PG_Magic_CtoL_SetMagicPoint()
    {
        Command = EM_PG_Magic_CtoL_SetMagicPoint;
    }
};
//-----------------------------------------------------------------------------------------------------
enum SetMagicPointErrorCodeENUM
{
    EM_MagicPointError_None                 ,
    EM_MagicPointError_MagicPosTooLarge     ,
    EM_MagicPointError_IDandPosError        ,
    EM_MagicPointError_OtherError           ,
};

//要求法術配點結果
struct	PG_Magic_LtoC_SetMagicPointResult
{
    GamePGCommandEnum	Command;
    int                 MagicID;
    int                 MagicPos;
    bool                Result;
    int                 ErrorCode;     //未設定 0 

    PG_Magic_LtoC_SetMagicPointResult()
    {
        Command = EM_PG_Magic_LtoC_SetMagicPointResult;
    }
};

//-----------------------------------------------------------------------------------------------------
//增加一個Buff通知週為的人
struct	PG_Magic_LtoC_AddBuffInfo
{
	GamePGCommandEnum	Command;
	int					GItemID;
	int                 MagicID;
	int					EffectTime;

	PG_Magic_LtoC_AddBuffInfo()
	{
		Command = EM_PG_Magic_LtoC_AddBuffInfo;
	}
};
//-----------------------------------------------------------------------------------------------------
//移除一個Buff通知週為的人
struct	PG_Magic_LtoC_DelBuffInfo
{
	GamePGCommandEnum	Command;
	int					GItemID;
	int                 MagicID;

	PG_Magic_LtoC_DelBuffInfo()
	{
		Command = EM_PG_Magic_LtoC_DelBuffInfo;
	}
};
//-----------------------------------------------------------------------------------------------------
//清除所有的Coldown
struct	PG_Magic_LtoC_ResetColdown
{
	GamePGCommandEnum	Command;

	PG_Magic_LtoC_ResetColdown()
	{
		Command = EM_PG_Magic_LtoC_ResetColdown;
	}
};
//------------------------------------------------------------------------------------------
// Client -> Server
//取消某個輔助法術
struct	PG_Magic_LtoC_CancelAssistMagic
{
	GamePGCommandEnum	Command;
	int					MagicID;		//輔助法術資料庫ID

	PG_Magic_LtoC_CancelAssistMagic()
	{
		Command = EM_PG_Magic_LtoC_CancelAssistMagic;
	}
};

//-----------------------------------------------------------------------------------------------------
// Server -> Client
//通知法術射出
struct PG_Magic_LtoC_BeginShoot
{
	GamePGCommandEnum	Command;

	int					SerialID;		//同一次施法的封包會有相同的號碼

	PG_Magic_LtoC_BeginShoot()
	{
		Command = EM_PG_Magic_LtoC_BeginShoot;
	};	
};
//-----------------------------------------------------------------------------------------------------
// Server -> Client 
// 開始 系統觸發的額外法術(非玩家主動施法)
struct PG_Magic_LtoC_SysBeginShoot
{
	GamePGCommandEnum	Command;

	int			    	OwnerID;		//施法者
	int			    	TargetID;		//施法目標
	int			    	MagicColID;		//所要施的法術

	int					SerialID;		//同一次施法的封包會有相同的號碼

	PG_Magic_LtoC_SysBeginShoot()
	{
		Command = EM_PG_Magic_LtoC_SysBeginShoot;
	};	
};
//-----------------------------------------------------------------------------------------------------
// Server -> Client 
// 結束 系統觸發的額外法術(非玩家主動施法)
struct PG_Magic_LtoC_SysEndShoot
{
	GamePGCommandEnum	Command;

	int					SerialID;		//同一次施法的封包會有相同的號碼

	PG_Magic_LtoC_SysEndShoot()
	{
		Command = EM_PG_Magic_LtoC_SysEndShoot;
	};	
};
//-----------------------------------------------------------------------------------------------------
// Server -> Client 
//魔法盾 訊息資訊
struct PG_Magic_LtoC_MagicShieldInfo
{
	GamePGCommandEnum	Command;

	int		AttackMagicID;			//攻擊		基本法術
	int		ShieldMagicID;			//防預頓	基本法術
	int		AttackGUID;				//攻擊者
	int		UnAttackGUID;			//被攻擊者
	int		AbsobDamage;			//吸收傷害值

	PG_Magic_LtoC_MagicShieldInfo()
	{
		Command = EM_PG_Magic_LtoC_MagicShieldInfo;
	};	
};
//-----------------------------------------------------------------------------------------------------

#pragma managed
