1. #pragma once
  2. #include "../GameLib/ItemData.h"
  3. struct SAffects
  4. {
  5. enum
  6. {
  7. AFFECT_MAX_NUM = 32,
  8. };
  9. SAffects() : dwAffects(0) {}
  10. SAffects(const DWORD & c_rAffects)
  11. {
  12. __SetAffects(c_rAffects);
  13. }
  14. int operator = (const DWORD & c_rAffects)
  15. {
  16. __SetAffects(c_rAffects);
  17. }
  18. BOOL IsAffect(BYTE byIndex)
  19. {
  20. return dwAffects & (1 << byIndex);
  21. }
  22. void __SetAffects(const DWORD & c_rAffects)
  23. {
  24. dwAffects = c_rAffects;
  25. }
  26. DWORD dwAffects;
  27. };
  28. extern std::string g_strGuildSymbolPathName;
  29. const DWORD c_Name_Max_Length = 64;
  30. const DWORD c_FileName_Max_Length = 128;
  31. const DWORD c_Short_Name_Max_Length = 32;
  32. const DWORD c_Inventory_Page_Size = 5*9; // x*y
  33. const DWORD c_Inventory_Page_Count = 5;
  34. const DWORD c_ItemSlot_Count = c_Inventory_Page_Size * c_Inventory_Page_Count;
  35. const DWORD c_Equipment_Count = 12;
  36. const DWORD c_Equipment_Start = c_ItemSlot_Count;
  37. const DWORD c_Equipment_Body = c_Equipment_Start + 0;
  38. const DWORD c_Equipment_Head = c_Equipment_Start + 1;
  39. const DWORD c_Equipment_Shoes = c_Equipment_Start + 2;
  40. const DWORD c_Equipment_Wrist = c_Equipment_Start + 3;
  41. const DWORD c_Equipment_Weapon = c_Equipment_Start + 4;
  42. const DWORD c_Equipment_Neck = c_Equipment_Start + 5;
  43. const DWORD c_Equipment_Ear = c_Equipment_Start + 6;
  44. const DWORD c_Equipment_Unique1 = c_Equipment_Start + 7;
  45. const DWORD c_Equipment_Unique2 = c_Equipment_Start + 8;
  46. const DWORD c_Equipment_Arrow = c_Equipment_Start + 9;
  47. const DWORD c_Equipment_Shield = c_Equipment_Start + 10;
  48. // »õ·Î Ãß°¡µÈ ½Å±Ô ¹İÁö & º§Æ®
  49. // ÀåÂøÇü ¾ÆÀÌÅÛ¿¡ ÇÒ´çÇÒ ¼ö ÀÖ´Â À§Ä¡°¡ ±âÁ¸ Àåºñ, ä±â¶ø Äù½ºÆ® º¸»ó, ÄÚ½ºÆ¬ ½Ã½ºÅÛ µîÀ¸·Î ÀÎÇØ¼­ °ø°£ÀÌ Àß·ÁÀÖ´Ù.
  50. // ÀÌ°Ô ´Ù ä±â¶ø º¸»ó ¹öÇÁ¸¦ ÀåÂø¾ÆÀÌÅÛó·³ ±¸ÇöÇÑ ¤µ¤¢ ¶§¹®¿¡ ³­¸®³µµû... ¤¶¤²
  51. //
  52. // Á¤¸®Çϸé, ±âÁ¸ ÀåºñâµéÀº ¼­¹öDB»ó ¾ÆÀÌÅÛ Æ÷Áö¼ÇÀÌ 90 ~ 102 À̰í,
  53. // 2013³â ÃÊ¿¡ »õ·Î Ãß°¡µÇ´Â ½½·ÔµéÀº 111 ~ ºÎÅÍ ½ÃÀÛÇÑ´Ù. Âø¿ë Àåºñ¿¡¼­ ÃÖ´ë·Î »ç¿ëÇÒ ¼ö ÀÖ´Â °ªÀº 121 ±îÁöÀ̰í, 122ºÎÅÍ´Â ¿ëÈ¥¼®¿¡¼­ »ç¿ëÇÑ´Ù.
  54. #ifdef ENABLE_NEW_EQUIPMENT_SYSTEM
  55. #ifdef ENABLE_COSTUME_WEAPON_SYSTEM
  56. const DWORD c_New_Equipment_Start = c_Equipment_Start + 22 + 1;
  57. #else
  58. const DWORD c_New_Equipment_Start = c_Equipment_Start + 22;
  59. #endif
  60. const DWORD c_New_Equipment_Count = 3;
  61. const DWORD c_Equipment_Ring1 = c_New_Equipment_Start + 0;
  62. const DWORD c_Equipment_Ring2 = c_New_Equipment_Start + 1;
  63. const DWORD c_Equipment_Belt = c_New_Equipment_Start + 2;
  64. #ifdef WING_SYSTEM
  65. const DWORD c_Equipment_Wing = c_New_Equipment_Start + 3;;
  66. #endif
  67. #endif
  68. enum EDragonSoulDeckType
  69. {
  70. DS_DECK_1,
  71. DS_DECK_2,
  72. DS_DECK_MAX_NUM = 2,
  73. };
  74. enum EDragonSoulGradeTypes
  75. {
  76. DRAGON_SOUL_GRADE_NORMAL,
  77. DRAGON_SOUL_GRADE_BRILLIANT,
  78. DRAGON_SOUL_GRADE_RARE,
  79. DRAGON_SOUL_GRADE_ANCIENT,
  80. DRAGON_SOUL_GRADE_LEGENDARY,
  81. DRAGON_SOUL_GRADE_MAX,
  82. };
  83. enum EDragonSoulStepTypes
  84. {
  85. DRAGON_SOUL_STEP_LOWEST,
  86. DRAGON_SOUL_STEP_LOW,
  87. DRAGON_SOUL_STEP_MID,
  88. DRAGON_SOUL_STEP_HIGH,
  89. DRAGON_SOUL_STEP_HIGHEST,
  90. DRAGON_SOUL_STEP_MAX,
  91. };
  92. #ifdef ENABLE_COSTUME_SYSTEM
  93. const DWORD c_Costume_Slot_Start = c_Equipment_Start + 19; // [ÁÖÀÇ] ¼ıÀÚ(19) ÇϵåÄÚµù ÁÖÀÇ. ÇöÀç ¼­¹ö¿¡¼­ ÄÚ½ºÃõ ½½·ÔÀº 19ºÎÅÍÀÓ. ¼­¹ö common/length.h ÆÄÀÏÀÇ EWearPositions ¿­°ÅÇü Âü°í.
  94. const DWORD c_Costume_Slot_Body = c_Costume_Slot_Start + 0;
  95. const DWORD c_Costume_Slot_Hair = c_Costume_Slot_Start + 1;
  96. #ifdef ENABLE_COSTUME_WEAPON_SYSTEM
  97. const DWORD c_Costume_Slot_Weapon = c_Costume_Slot_Start + 2;
  98. #endif
  99. const DWORD c_Costume_Slot_Count = 3;
  100. const DWORD c_Costume_Slot_End = c_Costume_Slot_Start + c_Costume_Slot_Count;
  101. #endif
  102. // [ÁÖÀÇ] ¼ıÀÚ(32) ÇϵåÄÚµù ÁÖÀÇ. ÇöÀç ¼­¹ö¿¡¼­ ¿ëÈ¥¼® ½½·ÔÀº 32ºÎÅÍÀÓ.
  103. // ¼­¹ö common/length.h ÆÄÀÏÀÇ EWearPositions ¿­°ÅÇüÀÌ 32±îÁö È®ÀåµÉ °ÍÀ» ¿°µÎÇϰí(32 ÀÌ»óÀº È®Àå Çϱâ Èûµé°Ô µÇ¾îÀÖÀ½.),
  104. // ±× ÀÌÈĺÎÅ͸¦ ¿ëÈ¥¼® ÀåÂø ½½·ÔÀ¸·Î »ç¿ë.
  105. const DWORD c_Wear_Max = 32;
  106. const DWORD c_DragonSoul_Equip_Start = c_ItemSlot_Count + c_Wear_Max;
  107. const DWORD c_DragonSoul_Equip_Slot_Max = 6;
  108. const DWORD c_DragonSoul_Equip_End = c_DragonSoul_Equip_Start + c_DragonSoul_Equip_Slot_Max * DS_DECK_MAX_NUM;
  109. // NOTE: 2013³â 2¿ù 5ÀÏ ÇöÀç... ¿ëÈ¥¼® µ¥Å©´Â 2°³°¡ Á¸ÀçÇϴµ¥, ÇâÈÄ È®Àå °¡´É¼ºÀÌ À־ 3°³ µ¥Å© ¿©À¯ºĞÀ» ÇÒ´ç ÇØ µÒ. ±× µÚ °ø°£Àº º§Æ® Àκ¥Å丮·Î »ç¿ë
  110. const DWORD c_DragonSoul_Equip_Reserved_Count = c_DragonSoul_Equip_Slot_Max * 3;
  111. #ifdef ENABLE_NEW_EQUIPMENT_SYSTEM
  112. // º§Æ® ¾ÆÀÌÅÛÀÌ Á¦°øÇÏ´Â Àκ¥Å丮
  113. const DWORD c_Belt_Inventory_Slot_Start = c_DragonSoul_Equip_End + c_DragonSoul_Equip_Reserved_Count;
  114. const DWORD c_Belt_Inventory_Width = 4;
  115. const DWORD c_Belt_Inventory_Height= 4;
  116. const DWORD c_Belt_Inventory_Slot_Count = c_Belt_Inventory_Width * c_Belt_Inventory_Height;
  117. const DWORD c_Belt_Inventory_Slot_End = c_Belt_Inventory_Slot_Start + c_Belt_Inventory_Slot_Count;
  118. #endif
  119. #ifdef WJ_SPLIT_INVENTORY_SYSTEM
  120. const DWORD c_Skill_Book_Inventory_Slot_Start = c_Belt_Inventory_Slot_End;
  121. const DWORD c_Skill_Book_Inventory_Slot_Count = 135;
  122. const DWORD c_Skill_Book_Inventory_Slot_End = c_Skill_Book_Inventory_Slot_Start + c_Skill_Book_Inventory_Slot_Count;
  123. const DWORD c_Upgrade_Items_Inventory_Slot_Start = c_Skill_Book_Inventory_Slot_End;
  124. const DWORD c_Upgrade_Items_Inventory_Slot_Count = 135;
  125. const DWORD c_Upgrade_Items_Inventory_Slot_End = c_Upgrade_Items_Inventory_Slot_Start + c_Upgrade_Items_Inventory_Slot_Count;
  126. const DWORD c_Stone_Inventory_Slot_Start = c_Upgrade_Items_Inventory_Slot_End;
  127. const DWORD c_Stone_Inventory_Slot_Count = 135;
  128. const DWORD c_Stone_Inventory_Slot_End = c_Stone_Inventory_Slot_Start + c_Stone_Inventory_Slot_Count;
  129. const DWORD c_Box_Inventory_Slot_Start = c_Stone_Inventory_Slot_End;
  130. const DWORD c_Box_Inventory_Slot_Count = 135;
  131. const DWORD c_Box_Inventory_Slot_End = c_Box_Inventory_Slot_Start + c_Box_Inventory_Slot_Count;
  132. const DWORD c_Efsun_Inventory_Slot_Start = c_Box_Inventory_Slot_End;
  133. const DWORD c_Efsun_Inventory_Slot_Count = 135;
  134. const DWORD c_Efsun_Inventory_Slot_End = c_Efsun_Inventory_Slot_Start + c_Efsun_Inventory_Slot_Count;
  135. const DWORD c_Cicek_Inventory_Slot_Start = c_Efsun_Inventory_Slot_End;
  136. const DWORD c_Cicek_Inventory_Slot_Count = 135;
  137. const DWORD c_Cicek_Inventory_Slot_End = c_Cicek_Inventory_Slot_Start + c_Cicek_Inventory_Slot_Count;
  138. const DWORD c_Inventory_Count = c_Cicek_Inventory_Slot_End;
  139. #endif
  140. // ¿ëÈ¥¼® Àü¿ë Àκ¥Å丮
  141. const DWORD c_DragonSoul_Inventory_Start = 0;
  142. const DWORD c_DragonSoul_Inventory_Box_Size = 32;
  143. const DWORD c_DragonSoul_Inventory_Count = CItemData::DS_SLOT_NUM_TYPES * DRAGON_SOUL_GRADE_MAX * c_DragonSoul_Inventory_Box_Size;
  144. const DWORD c_DragonSoul_Inventory_End = c_DragonSoul_Inventory_Start + c_DragonSoul_Inventory_Count;
  145. enum ESlotType
  146. {
  147. SLOT_TYPE_NONE,
  148. SLOT_TYPE_INVENTORY,
  149. SLOT_TYPE_SKILL,
  150. SLOT_TYPE_EMOTION,
  151. SLOT_TYPE_SHOP,
  152. SLOT_TYPE_EXCHANGE_OWNER,
  153. SLOT_TYPE_EXCHANGE_TARGET,
  154. SLOT_TYPE_QUICK_SLOT,
  155. SLOT_TYPE_SAFEBOX,
  156. SLOT_TYPE_PRIVATE_SHOP,
  157. SLOT_TYPE_MALL,
  158. SLOT_TYPE_DRAGON_SOUL_INVENTORY,
  159. #ifdef WJ_SPLIT_INVENTORY_SYSTEM
  160. SLOT_TYPE_SKILL_BOOK_INVENTORY,
  161. SLOT_TYPE_UPGRADE_ITEMS_INVENTORY,
  162. SLOT_TYPE_STONE_INVENTORY,
  163. SLOT_TYPE_BOX_INVENTORY,
  164. SLOT_TYPE_EFSUN_INVENTORY,
  165. SLOT_TYPE_CICEK_INVENTORY,
  166. #endif
  167. SLOT_TYPE_MAX,
  168. };
  169. enum EWindows
  170. {
  171. RESERVED_WINDOW,
  172. INVENTORY, // ±âº» Àκ¥Å丮. (45Ä­ Â¥¸®°¡ 2ÆäÀÌÁö Á¸Àç = 90Ä­)
  173. EQUIPMENT,
  174. SAFEBOX,
  175. MALL,
  176. DRAGON_SOUL_INVENTORY,
  177. GROUND, // NOTE: 2013³â 2¿ù5ÀÏ ÇöÀç±îÁö unused.. ¿Ö Àִ°ÅÁö???
  178. BELT_INVENTORY, // NOTE: W2.1 ¹öÀü¿¡ »õ·Î Ãß°¡µÇ´Â º§Æ® ½½·Ô ¾ÆÀÌÅÛÀÌ Á¦°øÇÏ´Â º§Æ® Àκ¥Å丮
  179. #ifdef WJ_SPLIT_INVENTORY_SYSTEM
  180. SKILL_BOOK_INVENTORY,
  181. UPGRADE_ITEMS_INVENTORY,
  182. STONE_INVENTORY,
  183. BOX_INVENTORY,
  184. EFSUN_INVENTORY,
  185. CICEK_INVENTORY,
  186. #endif
  187. WINDOW_TYPE_MAX,
  188. };
  189. enum EDSInventoryMaxNum
  190. {
  191. DS_INVENTORY_MAX_NUM = c_DragonSoul_Inventory_Count,
  192. DS_REFINE_WINDOW_MAX_NUM = 15,
  193. };
  194. #pragma pack (push, 1)
  195. #define WORD_MAX 0xffff
  196. typedef struct SItemPos
  197. {
  198. BYTE window_type;
  199. WORD cell;
  200. SItemPos ()
  201. {
  202. window_type = INVENTORY;
  203. cell = WORD_MAX;
  204. }
  205. SItemPos (BYTE _window_type, WORD _cell)
  206. {
  207. window_type = _window_type;
  208. cell = _cell;
  209. }
  210. // ±âÁ¸¿¡ cellÀÇ ÇüÀ» º¸¸é BYTE°¡ ´ëºÎºĞÀÌÁö¸¸, oi
  211. // ¾î¶² ºÎºĞÀº int, ¾î¶² ºÎºĞÀº WORD·Î µÇ¾îÀÖ¾î,
  212. // °¡Àå Å« ÀÚ·áÇüÀÎ int·Î ¹Ş´Â´Ù.
  213. // int operator=(const int _cell)
  214. // {
  215. //window_type = INVENTORY;
  216. // cell = _cell;
  217. // return cell;
  218. // }
  219. bool IsValidCell()
  220. {
  221. switch (window_type)
  222. {
  223. case INVENTORY:
  224. return cell < c_Inventory_Count;
  225. break;
  226. case EQUIPMENT:
  227. return cell < c_DragonSoul_Equip_End;
  228. break;
  229. case DRAGON_SOUL_INVENTORY:
  230. return cell < (DS_INVENTORY_MAX_NUM);
  231. break;
  232. default:
  233. return false;
  234. }
  235. }
  236. bool IsEquipCell()
  237. {
  238. switch (window_type)
  239. {
  240. case INVENTORY:
  241. case EQUIPMENT:
  242. return (c_Equipment_Start + c_Wear_Max > cell) && (c_Equipment_Start <= cell);
  243. break;
  244. case BELT_INVENTORY:
  245. case DRAGON_SOUL_INVENTORY:
  246. return false;
  247. break;
  248. default:
  249. return false;
  250. }
  251. }
  252. #ifdef ENABLE_NEW_EQUIPMENT_SYSTEM
  253. bool IsBeltInventoryCell()
  254. {
  255. bool bResult = c_Belt_Inventory_Slot_Start <= cell && c_Belt_Inventory_Slot_End > cell;
  256. return bResult;
  257. }
  258. #endif
  259. #ifdef WJ_SPLIT_INVENTORY_SYSTEM
  260. bool IsSkillBookInventoryCell()
  261. {
  262. bool bResult = c_Skill_Book_Inventory_Slot_Start <= cell && c_Skill_Book_Inventory_Slot_End > cell;
  263. return bResult;
  264. }
  265. bool IsUpgradeItemsInventoryCell()
  266. {
  267. bool bResult = c_Upgrade_Items_Inventory_Slot_Start <= cell && c_Upgrade_Items_Inventory_Slot_End > cell;
  268. return bResult;
  269. }
  270. bool IsStoneInventoryCell()
  271. {
  272. bool bResult = c_Stone_Inventory_Slot_Start <= cell && c_Stone_Inventory_Slot_End > cell;
  273. return bResult;
  274. }
  275. bool IsBoxInventoryCell()
  276. {
  277. bool bResult = c_Box_Inventory_Slot_Start <= cell && c_Box_Inventory_Slot_End > cell;
  278. return bResult;
  279. }
  280. bool IsEfsunInventoryCell()
  281. {
  282. bool bResult = c_Efsun_Inventory_Slot_Start <= cell && c_Efsun_Inventory_Slot_End > cell;
  283. return bResult;
  284. }
  285. bool IsCicekInventoryCell()
  286. {
  287. bool bResult = c_Cicek_Inventory_Slot_Start <= cell && c_Cicek_Inventory_Slot_End > cell;
  288. return bResult;
  289. }
  290. #endif
  291. bool operator==(const struct SItemPos& rhs) const
  292. {
  293. return (window_type == rhs.window_type) && (cell == rhs.cell);
  294. }
  295. bool operator<(const struct SItemPos& rhs) const
  296. {
  297. return (window_type < rhs.window_type) || ((window_type == rhs.window_type) && (cell < rhs.cell));
  298. }
  299. } TItemPos;
  300. #pragma pack(pop)
  301. const DWORD c_QuickBar_Line_Count = 3;
  302. const DWORD c_QuickBar_Slot_Count = 12;
  303. const float c_Idle_WaitTime = 5.0f;
  304. const int c_Monster_Race_Start_Number = 6;
  305. const int c_Monster_Model_Start_Number = 20001;
  306. const float c_fAttack_Delay_Time = 0.2f;
  307. const float c_fHit_Delay_Time = 0.1f;
  308. const float c_fCrash_Wave_Time = 0.2f;
  309. const float c_fCrash_Wave_Distance = 3.0f;
  310. const float c_fHeight_Step_Distance = 50.0f;
  311. enum
  312. {
  313. DISTANCE_TYPE_FOUR_WAY,
  314. DISTANCE_TYPE_EIGHT_WAY,
  315. DISTANCE_TYPE_ONE_WAY,
  316. DISTANCE_TYPE_MAX_NUM,
  317. };
  318. const float c_fMagic_Script_Version = 1.0f;
  319. const float c_fSkill_Script_Version = 1.0f;
  320. const float c_fMagicSoundInformation_Version = 1.0f;
  321. const float c_fBattleCommand_Script_Version = 1.0f;
  322. const float c_fEmotionCommand_Script_Version = 1.0f;
  323. const float c_fActive_Script_Version = 1.0f;
  324. const float c_fPassive_Script_Version = 1.0f;
  325. // Used by PushMove
  326. const float c_fWalkDistance = 175.0f;
  327. const float c_fRunDistance = 310.0f;
  328. #define FILE_MAX_LEN 128
  329. enum
  330. {
  331. ITEM_SOCKET_SLOT_MAX_NUM = 3,
  332. ITEM_ATTRIBUTE_SLOT_MAX_NUM = 7,
  333. };
  334. #pragma pack(push)
  335. #pragma pack(1)
  336. typedef struct SQuickSlot
  337. {
  338. BYTE Type;
  339. BYTE Position;
  340. } TQuickSlot;
  341. typedef struct TPlayerItemAttribute
  342. {
  343. BYTE bType;
  344. short sValue;
  345. } TPlayerItemAttribute;
  346. typedef struct packet_item
  347. {
  348. DWORD vnum;
  349. BYTE count;
  350. DWORD flags;
  351. DWORD anti_flags;
  352. long alSockets[ITEM_SOCKET_SLOT_MAX_NUM];
  353. TPlayerItemAttribute aAttr[ITEM_ATTRIBUTE_SLOT_MAX_NUM];
  354. } TItemData;
  355. typedef struct packet_shop_item
  356. {
  357. DWORD vnum;
  358. long long price;
  359. BYTE count;
  360. BYTE display_pos;
  361. long alSockets[ITEM_SOCKET_SLOT_MAX_NUM];
  362. TPlayerItemAttribute aAttr[ITEM_ATTRIBUTE_SLOT_MAX_NUM];
  363. } TShopItemData;
  364. #pragma pack(pop)
  365. inline float GetSqrtDistance(int ix1, int iy1, int ix2, int iy2) // By sqrt
  366. {
  367. float dx, dy;
  368. dx = float(ix1 - ix2);
  369. dy = float(iy1 - iy2);
  370. return sqrtf(dx*dx + dy*dy);
  371. }
  372. // DEFAULT_FONT
  373. void DefaultFont_Startup();
  374. void DefaultFont_Cleanup();
  375. void DefaultFont_SetName(const char * c_szFontName);
  376. CResource* DefaultFont_GetResource();
  377. CResource* DefaultItalicFont_GetResource();
  378. // END_OF_DEFAULT_FONT
  379. void SetGuildSymbolPath(const char * c_szPathName);
  380. const char * GetGuildSymbolFileName(DWORD dwGuildID);
  381. BYTE SlotTypeToInvenType(BYTE bSlotType);