
#pragma once
#include "RoleData/ObjectStructEx.h"
#include "ReaderClass/ReaderClass.h"
#include "ReaderClass/CreateDBCmdClass.h"
//----------------------------------------------------------------------------------------
enum SearchFormTypeENUM
{
    EM_SearchFormTypeENUM_NPC       = 0,
    EM_SearchFormTypeENUM_Item      = 1,
    EM_SearchFormTypeENUM_Weapon    = 2,
    EM_SearchFormTypeENUM_Armor     = 3,
    EM_SearchFormTypeENUM_Magic     = 4,
    EM_SearchFormTypeENUM_Image     = 5,
    EM_SearchFormTypeENUM_Attribute = 6,
	EM_SearchFormTypeENUM_QuestObj  = 7,
	EM_SearchFormTypeENUM_Quest     = 8,

    EM_SearchFormTypeENUM_LearnMagic= 9,
//    EM_SearchFormTypeENUM_AddPower  ,
    EM_SearchFormTypeENUM_BodyObj   = 10,
    EM_SearchFormTypeENUM_Player    = 11,
    EM_SearchFormTypeENUM_KeyItem   = 12,
    EM_SearchFormTypeENUM_Rune      = 13,
    EM_SearchFormTypeENUM_Title     = 14,
    EM_SearchFormTypeENUM_Flag      = 15,
    EM_SearchFormTypeENUM_Recipe    = 16,
    EM_SearchFormTypeENUM_Mine      = 17,
    EM_SearchFormTypeENUM_Shop      = 18,
	EM_SearchFormTypeENUM_Suit      = 19,
    EM_SearchFormTypeENUM_SrvScript = 20,
	EM_SearchFormTypeENUM_String    = 21,
	EM_SearchFormTypeENUM_Camp		= 22,    
	EM_SearchFormTypeENUM_Treasure	= 23,
	EM_SearchFormTypeENUM_MagicCollect= 24,
	EM_SearchFormTypeENUM_CliScript = 25,
	EM_SearchFormTypeENUM_EqRefineAbility	= 26,
	EM_SearchFormTypeENUM_Zone				= 27,
	EM_SearchFormTypeENUM_CreateRole		= 28,
	EM_SearchFormTypeENUM_Card				= 29,
	EM_SearchFormTypeENUM_PE				= 30,
	EM_SearchFormTypeENUM_Phantom			= 31,

    EM_SearchFormTypeENUM_Unknow ,
};
struct SearchFormTypeStruct
{
    union 
    {
        bool TypeArr[ EM_SearchFormTypeENUM_Unknow ];
        struct
        {
            bool NPC       		 ;
            bool Item      		 ;
            bool Weapon    		 ;
            bool Armor     		 ;
            bool Magic     		 ;
            bool Image     		 ;
            bool Attribute 		 ;
	        bool QuestObj  		 ;
            bool Quest     		 ;
            bool LearnMagic		 ;

            bool BodyObj   		;
            bool Player    		;
            bool KeyItem   		;
            bool Rune      		;
            bool Title     		;
            bool Flag      		;
            bool Recipe    		;
            bool Mine      		;
            bool Shop      		;
			bool Suit	   		;
            bool Script    		;
			bool String			;
			bool Camp			;
			bool Treasure		;
			bool MagicCollect	;
			bool CliScript		;
			bool EqRefineAbility;
			bool Zone			;
			bool CreateRole		;
			bool Card			;
			bool PE				;
			bool Phantom		;

        };
    };
	char*	DataBaseName;

    SearchFormTypeStruct()
    {
        memset( TypeArr , 0 , sizeof(TypeArr) );
    };
};
//----------------------------------------------------------------------------------------
enum    AccountStateEnum
{
    EM_AccountState_None    ,
    EM_AccountState_Read    ,
    EM_AccountState_Write   ,
};
struct  AccountInfoStruct
{
       union
       {
           AccountStateEnum ArrList[ 40 ];
           struct 
           {
               	AccountStateEnum Admin;
               	AccountStateEnum ValueTable;
               	AccountStateEnum AddPower;
               	AccountStateEnum Armor;
               	AccountStateEnum BodyObj;
               	AccountStateEnum Player;
               	AccountStateEnum Item;
               	AccountStateEnum KeyItem;
               	AccountStateEnum Magic;
               	AccountStateEnum QuestCollect;
               	AccountStateEnum QuestDetail;
               	AccountStateEnum Rune;
               	AccountStateEnum Title;
               	AccountStateEnum Weapon;
               	AccountStateEnum NPC;               
               	AccountStateEnum Mine; 
               	AccountStateEnum Image;
               	AccountStateEnum Flag;
               	AccountStateEnum QuestNPC;
               	AccountStateEnum Recipe;
               	AccountStateEnum Script;
               	AccountStateEnum LearnMagic;
               	AccountStateEnum Shop;
			   	AccountStateEnum Suit;
				AccountStateEnum String;
				AccountStateEnum Camp;
				AccountStateEnum Treasure;
				AccountStateEnum MagicCollect;
				AccountStateEnum EqRefineAbility;
				AccountStateEnum Zone;
				AccountStateEnum CreateRole;
				AccountStateEnum Card;
				AccountStateEnum PE;
				AccountStateEnum Phantom;
           };
       };

};
//----------------------------------------------------------------------------------------
struct NPCStrongArgBase
{
	union
	{
		int Value[10];
		struct  
		{
			int DMG;
			int ATKRate;
			int	DEFRate;
			int MDEFRate;
			int AttackSpeed;
			int MaxHPRate;
			int MaxMPRate;
			int ParryRate;
			int CriticalRate;
			int DodgeRate;
		};
	};
};
struct NPCStrongArgStruct
{
	int	Type;
	string Name;
	vector< NPCStrongArgBase > Arg;
};