Advertisement
Guest User

GameType.h

a guest
Oct 30th, 2015
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 10.53 KB | None | 0 0
  1. #pragma once
  2. #include "../GameLib/ItemData.h"
  3.  
  4. struct SAffects
  5. {
  6.     enum
  7.     {
  8.         AFFECT_MAX_NUM = 32,
  9.     };
  10.  
  11.     SAffects() : dwAffects(0) {}
  12.     SAffects(const DWORD & c_rAffects)
  13.     {
  14.         __SetAffects(c_rAffects);
  15.     }
  16.     int operator = (const DWORD & c_rAffects)
  17.     {
  18.         __SetAffects(c_rAffects);
  19.     }
  20.  
  21.     BOOL IsAffect(BYTE byIndex)
  22.     {
  23.         return dwAffects & (1 << byIndex);
  24.     }
  25.  
  26.     void __SetAffects(const DWORD & c_rAffects)
  27.     {
  28.         dwAffects = c_rAffects;
  29.     }
  30.  
  31.     DWORD dwAffects;
  32. };
  33.  
  34. extern std::string g_strGuildSymbolPathName;
  35.  
  36. const DWORD c_Name_Max_Length = 64;
  37. const DWORD c_FileName_Max_Length = 128;
  38. const DWORD c_Short_Name_Max_Length = 32;
  39.  
  40. const DWORD c_Inventory_Page_Size = 5*9; // x*y
  41. const DWORD c_Inventory_Page_Count = 4;
  42. const DWORD c_ItemSlot_Count = c_Inventory_Page_Size * c_Inventory_Page_Count;
  43. const DWORD c_Equipment_Count = 12;
  44.  
  45. const DWORD c_Equipment_Start = c_ItemSlot_Count;
  46.  
  47. const DWORD c_Equipment_Body    = c_Equipment_Start + 0;
  48. const DWORD c_Equipment_Head    = c_Equipment_Start + 1;
  49. const DWORD c_Equipment_Shoes   = c_Equipment_Start + 2;
  50. const DWORD c_Equipment_Wrist   = c_Equipment_Start + 3;
  51. const DWORD c_Equipment_Weapon  = c_Equipment_Start + 4;
  52. const DWORD c_Equipment_Neck    = c_Equipment_Start + 5;
  53. const DWORD c_Equipment_Ear     = c_Equipment_Start + 6;
  54. const DWORD c_Equipment_Unique1 = c_Equipment_Start + 7;
  55. const DWORD c_Equipment_Unique2 = c_Equipment_Start + 8;
  56. const DWORD c_Equipment_Arrow   = c_Equipment_Start + 9;
  57. const DWORD c_Equipment_Shield  = c_Equipment_Start + 10;
  58.  
  59. // »х·О ГЯ°ЎµИ ЅЕ±Ф №ЭБц & є§Ж®
  60. // АеВшЗь ѕЖАМЕЫїЎ ЗТґзЗТ јц АЦґВ А§ДЎ°Ў ±вБё Аеєс, Г¤±в¶ш ДщЅєЖ® єё»у, ДЪЅєЖ¬ ЅГЅєЕЫ µоАё·О АОЗШј­ °ш°ЈАМ АЯ·БАЦґЩ.
  61. // АМ°Ф ґЩ Г¤±в¶ш єё»у №цЗБё¦ АеВшѕЖАМЕЫГі·і ±ёЗцЗС ¤µ¤ў ¶§№®їЎ і­ё®іµµы... ¤¶¤І
  62. //
  63. // Б¤ё®ЗПёй, ±вБё АеєсГўµйАє ј­№цDB»у ѕЖАМЕЫ ЖчБцјЗАМ 90 ~ 102 АМ°н,
  64. // 2013ів ГКїЎ »х·О ГЯ°ЎµЗґВ ЅЅ·ФµйАє 111 ~ єОЕН ЅГАЫЗСґЩ. Вшїл АеєсїЎј­ ГЦґл·О »зїлЗТ јц АЦґВ °ЄАє 121 ±оБцАМ°н, 122єОЕНґВ їлИҐј®їЎј­ »зїлЗСґЩ.
  65. #ifdef ENABLE_NEW_EQUIPMENT_SYSTEM
  66.     const DWORD c_New_Equipment_Start = c_Equipment_Start + 22;
  67.     const DWORD c_New_Equipment_Count = 3;
  68.     const DWORD c_Equipment_Ring1 = c_New_Equipment_Start + 0;
  69.     const DWORD c_Equipment_Ring2 = c_New_Equipment_Start + 1;
  70.     const DWORD c_Equipment_Belt  = c_New_Equipment_Start + 2;;
  71. #endif
  72.  
  73. enum EDragonSoulDeckType
  74. {
  75.     DS_DECK_1,
  76.     DS_DECK_2,
  77.     DS_DECK_MAX_NUM = 2,
  78. };
  79.  
  80. enum EDragonSoulGradeTypes
  81. {
  82.     DRAGON_SOUL_GRADE_NORMAL,
  83.     DRAGON_SOUL_GRADE_BRILLIANT,
  84.     DRAGON_SOUL_GRADE_RARE,
  85.     DRAGON_SOUL_GRADE_ANCIENT,
  86.     DRAGON_SOUL_GRADE_LEGENDARY,
  87.     DRAGON_SOUL_GRADE_MAX,
  88.  
  89. };
  90.  
  91. enum EDragonSoulStepTypes
  92. {
  93.     DRAGON_SOUL_STEP_LOWEST,
  94.     DRAGON_SOUL_STEP_LOW,
  95.     DRAGON_SOUL_STEP_MID,
  96.     DRAGON_SOUL_STEP_HIGH,
  97.     DRAGON_SOUL_STEP_HIGHEST,
  98.     DRAGON_SOUL_STEP_MAX,
  99. };
  100.  
  101. #ifdef ENABLE_COSTUME_SYSTEM
  102.     const DWORD c_Costume_Slot_Start = c_Equipment_Start + 19;
  103.     const DWORD c_Costume_Slot_Body = c_Costume_Slot_Start + 0;
  104.     const DWORD c_Costume_Slot_Hair = c_Costume_Slot_Start + 1;
  105.     const DWORD c_Costume_Slot_Acce = c_Costume_Slot_Start + 2;
  106.     const DWORD c_Costume_Slot_Mount = c_Costume_Slot_Start + 3;
  107.     const DWORD c_Costume_Slot_Count = 4;
  108.     const DWORD c_Costume_Slot_End = c_Costume_Slot_Start + c_Costume_Slot_Count;
  109. #endif
  110.  
  111.  
  112. // [БЦАЗ] јэАЪ(32) ЗПµеДЪµщ БЦАЗ. ЗцАз ј­№цїЎј­ їлИҐј® ЅЅ·ФАє 32єОЕНАУ.
  113. // ј­№ц common/length.h ЖДАПАЗ EWearPositions ї­°ЕЗьАМ 32±оБц И®АеµЙ °НА» ї°µОЗП°н(32 АМ»уАє И®Ае ЗП±в Иыµй°Ф µЗѕоАЦАЅ.),
  114. // ±Ч АМИДєОЕНё¦ їлИҐј® АеВш ЅЅ·ФАё·О »зїл.
  115. const DWORD c_Wear_Max = 32;
  116. const DWORD c_DragonSoul_Equip_Start = c_ItemSlot_Count + c_Wear_Max;
  117. const DWORD c_DragonSoul_Equip_Slot_Max = 6;
  118. const DWORD c_DragonSoul_Equip_End = c_DragonSoul_Equip_Start + c_DragonSoul_Equip_Slot_Max * DS_DECK_MAX_NUM;
  119.  
  120. // NOTE: 2013ів 2їщ 5АП ЗцАз... їлИҐј® µҐЕ©ґВ 2°і°Ў БёАзЗПґВµҐ, ЗвИД И®Ае °ЎґЙјєАМ АЦѕој­ 3°і µҐЕ© ї©АЇєРА» ЗТґз ЗШ µТ. ±Ч µЪ °ш°ЈАє є§Ж® АОєҐЕдё®·О »зїл
  121. const DWORD c_DragonSoul_Equip_Reserved_Count = c_DragonSoul_Equip_Slot_Max * 3;       
  122.  
  123. #ifdef ENABLE_NEW_EQUIPMENT_SYSTEM
  124.     // є§Ж® ѕЖАМЕЫАМ Б¦°шЗПґВ АОєҐЕдё®
  125.     const DWORD c_Belt_Inventory_Slot_Start = c_DragonSoul_Equip_End + c_DragonSoul_Equip_Reserved_Count;
  126.     const DWORD c_Belt_Inventory_Width = 4;
  127.     const DWORD c_Belt_Inventory_Height= 4;
  128.     const DWORD c_Belt_Inventory_Slot_Count = c_Belt_Inventory_Width * c_Belt_Inventory_Height;
  129.     const DWORD c_Belt_Inventory_Slot_End = c_Belt_Inventory_Slot_Start + c_Belt_Inventory_Slot_Count;
  130.  
  131.     const DWORD c_Inventory_Count   = c_Belt_Inventory_Slot_End;
  132. #else
  133.     const DWORD c_Inventory_Count   = c_DragonSoul_Equip_End;
  134. #endif
  135.  
  136. // їлИҐј® Аьїл АОєҐЕдё®
  137. const DWORD c_DragonSoul_Inventory_Start = 0;
  138. const DWORD c_DragonSoul_Inventory_Box_Size = 32;
  139. const DWORD c_DragonSoul_Inventory_Count = CItemData::DS_SLOT_NUM_TYPES * DRAGON_SOUL_GRADE_MAX * c_DragonSoul_Inventory_Box_Size;
  140. const DWORD c_DragonSoul_Inventory_End = c_DragonSoul_Inventory_Start + c_DragonSoul_Inventory_Count;
  141.  
  142. enum ESlotType
  143. {
  144.     SLOT_TYPE_NONE,
  145.     SLOT_TYPE_INVENTORY,
  146.     SLOT_TYPE_SKILL,
  147.     SLOT_TYPE_EMOTION,
  148.     SLOT_TYPE_SHOP,
  149.     SLOT_TYPE_EXCHANGE_OWNER,
  150.     SLOT_TYPE_EXCHANGE_TARGET,
  151.     SLOT_TYPE_QUICK_SLOT,
  152.     SLOT_TYPE_SAFEBOX,
  153.     SLOT_TYPE_PRIVATE_SHOP,
  154.     SLOT_TYPE_MALL,
  155.     SLOT_TYPE_DRAGON_SOUL_INVENTORY,
  156.     SLOT_TYPE_MAX,
  157. };
  158.  
  159. enum EWindows
  160. {
  161.     RESERVED_WINDOW,
  162.     INVENTORY,              // ±вє» АОєҐЕдё®. (45Д­ ВҐё®°Ў 2ЖдАМБц БёАз = 90Д­)
  163.     EQUIPMENT,
  164.     SAFEBOX,
  165.     MALL,
  166.     DRAGON_SOUL_INVENTORY,
  167.     GROUND,                 // NOTE: 2013ів 2їщ5АП ЗцАз±оБц unused.. їЦ АЦґВ°ЕБц???
  168.     BELT_INVENTORY,         // NOTE: W2.1 №цАьїЎ »х·О ГЯ°ЎµЗґВ є§Ж® ЅЅ·Ф ѕЖАМЕЫАМ Б¦°шЗПґВ є§Ж® АОєҐЕдё®
  169.    
  170.     WINDOW_TYPE_MAX,
  171. };
  172.  
  173. enum EDSInventoryMaxNum
  174. {
  175.     DS_INVENTORY_MAX_NUM = c_DragonSoul_Inventory_Count,
  176.     DS_REFINE_WINDOW_MAX_NUM = 15,
  177. };
  178.  
  179. #pragma pack (push, 1)
  180. #define WORD_MAX 0xffff
  181.  
  182. typedef struct SItemPos
  183. {
  184.     BYTE window_type;
  185.     WORD cell;
  186.     SItemPos ()
  187.     {
  188.         window_type =     INVENTORY;
  189.         cell = WORD_MAX;
  190.     }
  191.     SItemPos (BYTE _window_type, WORD _cell)
  192.     {
  193.         window_type = _window_type;
  194.         cell = _cell;
  195.     }
  196.  
  197.     // ±вБёїЎ cellАЗ ЗьА» єёёй BYTE°Ў ґлєОєРАМБцёё, oi
  198.     // ѕо¶І єОєРАє int, ѕо¶І єОєРАє WORD·О µЗѕоАЦѕо,
  199.     // °ЎАе Е« АЪ·бЗьАО int·О №ЮґВґЩ.
  200.   //  int operator=(const int _cell)
  201.   //  {
  202.         //window_type = INVENTORY;
  203.   //      cell = _cell;
  204.   //      return cell;
  205.   //  }
  206.     bool IsValidCell()
  207.     {
  208.         switch (window_type)
  209.         {
  210.         case INVENTORY:
  211.             return cell < c_Inventory_Count;
  212.             break;
  213.         case EQUIPMENT:
  214.             return cell < c_DragonSoul_Equip_End;
  215.             break;
  216.         case DRAGON_SOUL_INVENTORY:
  217.             return cell < (DS_INVENTORY_MAX_NUM);
  218.             break;
  219.         default:
  220.             return false;
  221.         }
  222.     }
  223.     bool IsEquipCell()
  224.     {
  225.         switch (window_type)
  226.         {
  227.         case INVENTORY:
  228.         case EQUIPMENT:
  229.             return (c_Equipment_Start + c_Wear_Max > cell) && (c_Equipment_Start <= cell);
  230.             break;
  231.  
  232.         case BELT_INVENTORY:
  233.         case DRAGON_SOUL_INVENTORY:
  234.             return false;
  235.             break;
  236.  
  237.         default:
  238.             return false;
  239.         }
  240.     }
  241.  
  242. #ifdef ENABLE_NEW_EQUIPMENT_SYSTEM
  243.     bool IsBeltInventoryCell()
  244.     {
  245.         bool bResult = c_Belt_Inventory_Slot_Start <= cell && c_Belt_Inventory_Slot_End > cell;
  246.         return bResult;
  247.     }
  248. #endif
  249.  
  250.     bool operator==(const struct SItemPos& rhs) const
  251.     {
  252.         return (window_type == rhs.window_type) && (cell == rhs.cell);
  253.     }
  254.  
  255.     bool operator<(const struct SItemPos& rhs) const
  256.     {
  257.         return (window_type < rhs.window_type) || ((window_type == rhs.window_type) && (cell < rhs.cell));
  258.     }
  259. } TItemPos;
  260. #pragma pack(pop)
  261.  
  262. const DWORD c_QuickBar_Line_Count = 3;
  263. const DWORD c_QuickBar_Slot_Count = 12;
  264.  
  265. const float c_Idle_WaitTime = 5.0f;
  266.  
  267. const int c_Monster_Race_Start_Number = 6;
  268. const int c_Monster_Model_Start_Number = 20001;
  269.  
  270. const float c_fAttack_Delay_Time = 0.2f;
  271. const float c_fHit_Delay_Time = 0.1f;
  272. const float c_fCrash_Wave_Time = 0.2f;
  273. const float c_fCrash_Wave_Distance = 3.0f;
  274.  
  275. const float c_fHeight_Step_Distance = 50.0f;
  276.  
  277. enum
  278. {
  279.     DISTANCE_TYPE_FOUR_WAY,
  280.     DISTANCE_TYPE_EIGHT_WAY,
  281.     DISTANCE_TYPE_ONE_WAY,
  282.     DISTANCE_TYPE_MAX_NUM,
  283. };
  284.  
  285. const float c_fMagic_Script_Version = 1.0f;
  286. const float c_fSkill_Script_Version = 1.0f;
  287. const float c_fMagicSoundInformation_Version = 1.0f;
  288. const float c_fBattleCommand_Script_Version = 1.0f;
  289. const float c_fEmotionCommand_Script_Version = 1.0f;
  290. const float c_fActive_Script_Version = 1.0f;
  291. const float c_fPassive_Script_Version = 1.0f;
  292.  
  293. // Used by PushMove
  294. const float c_fWalkDistance = 175.0f;
  295. const float c_fRunDistance = 310.0f;
  296.  
  297. #define FILE_MAX_LEN 128
  298.  
  299. enum
  300. {
  301.     ITEM_SOCKET_SLOT_MAX_NUM = 3,
  302.     ITEM_ATTRIBUTE_SLOT_MAX_NUM = 15,
  303. };
  304.  
  305. #pragma pack(push)
  306. #pragma pack(1)
  307.  
  308. typedef struct SQuickSlot
  309. {
  310.     BYTE Type;
  311.     BYTE Position;
  312. } TQuickSlot;
  313.  
  314. typedef struct TPlayerItemAttribute
  315. {
  316.     BYTE        bType;
  317.     short       sValue;
  318. } TPlayerItemAttribute;
  319.  
  320. typedef struct packet_item
  321. {
  322.     DWORD       vnum;
  323.     BYTE        count;
  324.     DWORD       flags;
  325.     DWORD       anti_flags;
  326.     long        alSockets[ITEM_SOCKET_SLOT_MAX_NUM];
  327.     TPlayerItemAttribute aAttr[ITEM_ATTRIBUTE_SLOT_MAX_NUM];
  328. } TItemData;
  329.  
  330. typedef struct packet_shop_item
  331. {
  332.     DWORD       vnum;
  333.     DWORD       price;
  334.     BYTE        count;
  335.     BYTE        display_pos;
  336.     long        alSockets[ITEM_SOCKET_SLOT_MAX_NUM];
  337.     TPlayerItemAttribute aAttr[ITEM_ATTRIBUTE_SLOT_MAX_NUM];
  338. } TShopItemData;
  339.  
  340. #pragma pack(pop)
  341.  
  342. inline float GetSqrtDistance(int ix1, int iy1, int ix2, int iy2) // By sqrt
  343. {
  344.     float dx, dy;
  345.  
  346.     dx = float(ix1 - ix2);
  347.     dy = float(iy1 - iy2);
  348.  
  349.     return sqrtf(dx*dx + dy*dy);
  350. }
  351.  
  352. // DEFAULT_FONT
  353. void DefaultFont_Startup();
  354. void DefaultFont_Cleanup();
  355. void DefaultFont_SetName(const char * c_szFontName);
  356. CResource* DefaultFont_GetResource();
  357. CResource* DefaultItalicFont_GetResource();
  358. // END_OF_DEFAULT_FONT
  359.  
  360. void SetGuildSymbolPath(const char * c_szPathName);
  361. const char * GetGuildSymbolFileName(DWORD dwGuildID);
  362. BYTE SlotTypeToInvenType(BYTE bSlotType);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement