Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  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. constexpr DWORD c_Name_Max_Length = 64;
  37. constexpr DWORD c_FileName_Max_Length = 128;
  38. constexpr DWORD c_Short_Name_Max_Length = 32;
  39.  
  40. constexpr DWORD c_Inventory_Page_Column = 5;
  41. constexpr DWORD c_Inventory_Page_Row = 9;
  42. constexpr DWORD c_Inventory_Page_Size = c_Inventory_Page_Column*c_Inventory_Page_Row; // x*y
  43. #ifdef ENABLE_EXTEND_INVEN_SYSTEM
  44. constexpr DWORD c_Inventory_Page_Count = 4;
  45. #else
  46. constexpr DWORD c_Inventory_Page_Count = 2;
  47. #endif
  48. constexpr DWORD c_ItemSlot_Count = c_Inventory_Page_Size * c_Inventory_Page_Count;
  49. constexpr DWORD c_Equipment_Count = 12;
  50.  
  51. constexpr DWORD c_Equipment_Start = c_ItemSlot_Count;
  52.  
  53. constexpr DWORD c_Equipment_Body = c_Equipment_Start + CItemData::WEAR_BODY;
  54. constexpr DWORD c_Equipment_Head = c_Equipment_Start + CItemData::WEAR_HEAD;
  55. constexpr DWORD c_Equipment_Shoes = c_Equipment_Start + CItemData::WEAR_FOOTS;
  56. constexpr DWORD c_Equipment_Wrist = c_Equipment_Start + CItemData::WEAR_WRIST;
  57. constexpr DWORD c_Equipment_Weapon = c_Equipment_Start + CItemData::WEAR_WEAPON;
  58. constexpr DWORD c_Equipment_Neck = c_Equipment_Start + CItemData::WEAR_NECK;
  59. constexpr DWORD c_Equipment_Ear = c_Equipment_Start + CItemData::WEAR_EAR;
  60. constexpr DWORD c_Equipment_Unique1 = c_Equipment_Start + CItemData::WEAR_UNIQUE1;
  61. constexpr DWORD c_Equipment_Unique2 = c_Equipment_Start + CItemData::WEAR_UNIQUE2;
  62. constexpr DWORD c_Equipment_Arrow = c_Equipment_Start + CItemData::WEAR_ARROW;
  63. constexpr DWORD c_Equipment_Shield = c_Equipment_Start + CItemData::WEAR_SHIELD;
  64.  
  65. #ifdef ENABLE_NEW_EQUIPMENT_SYSTEM
  66. constexpr DWORD c_New_Equipment_Start = c_Equipment_Start + CItemData::WEAR_BELT;
  67. constexpr DWORD c_New_Equipment_Count = 1;
  68. constexpr DWORD c_Equipment_Belt = c_Equipment_Start + CItemData::WEAR_BELT;
  69. #endif
  70. #ifdef ENABLE_PENDANT_SYSTEM
  71. constexpr DWORD c_Equipment_Pendant = c_Equipment_Start + CItemData::WEAR_PENDANT;
  72. #endif
  73. #ifdef ENABLE_GLOVE_SYSTEM
  74. constexpr DWORD c_Equipment_Glove = c_Equipment_Start + CItemData::WEAR_GLOVE;
  75. #endif
  76.  
  77. #ifdef ENABLE_SKILL_COLOR_SYSTEM
  78. enum ESkillColorLength
  79. {
  80. MAX_SKILL_COUNT = 6,
  81. MAX_EFFECT_COUNT = 5,
  82. BUFF_BEGIN = MAX_SKILL_COUNT,
  83. MAX_BUFF_COUNT = 6,
  84. };
  85. #endif
  86.  
  87. enum EDragonSoulDeckType
  88. {
  89. DS_DECK_1,
  90. DS_DECK_2,
  91. DS_DECK_MAX_NUM = 2,
  92. };
  93.  
  94. enum EDragonSoulGradeTypes
  95. {
  96. DRAGON_SOUL_GRADE_NORMAL,
  97. DRAGON_SOUL_GRADE_BRILLIANT,
  98. DRAGON_SOUL_GRADE_RARE,
  99. DRAGON_SOUL_GRADE_ANCIENT,
  100. DRAGON_SOUL_GRADE_LEGENDARY,
  101. #ifdef ENABLE_DS_GRADE_MYTH
  102. DRAGON_SOUL_GRADE_MYTH,
  103. #endif
  104. DRAGON_SOUL_GRADE_MAX,
  105. };
  106.  
  107. enum EDragonSoulStepTypes
  108. {
  109. DRAGON_SOUL_STEP_LOWEST,
  110. DRAGON_SOUL_STEP_LOW,
  111. DRAGON_SOUL_STEP_MID,
  112. DRAGON_SOUL_STEP_HIGH,
  113. DRAGON_SOUL_STEP_HIGHEST,
  114. DRAGON_SOUL_STEP_MAX,
  115. };
  116.  
  117. #ifdef ENABLE_COSTUME_SYSTEM
  118. const DWORD c_Costume_Slot_Start = c_Equipment_Start + CItemData::WEAR_COSTUME_BODY;
  119. const DWORD c_Costume_Slot_Body = c_Costume_Slot_Start + CItemData::COSTUME_BODY;
  120. const DWORD c_Costume_Slot_Hair = c_Costume_Slot_Start + CItemData::COSTUME_HAIR;
  121. #ifdef ENABLE_MOUNT_COSTUME_SYSTEM
  122. const DWORD c_Costume_Slot_Mount = c_Costume_Slot_Start + CItemData::COSTUME_MOUNT;
  123. #endif
  124. #ifdef ENABLE_ACCE_COSTUME_SYSTEM
  125. const DWORD c_Costume_Slot_Acce = c_Costume_Slot_Start + CItemData::COSTUME_ACCE;
  126. #endif
  127.  
  128. const DWORD c_Costume_Effect_Body = c_Costume_Slot_Start + CItemData::COSTUME_EFFECT_BODY;
  129. const DWORD c_Costume_Effect_Weapon = c_Costume_Slot_Start + CItemData::COSTUME_EFFECT_WEAPON;
  130.  
  131.  
  132. //#if defined(ENABLE_WEAPON_COSTUME_SYSTEM) || defined(ENABLE_ACCE_COSTUME_SYSTEM)
  133. // const DWORD c_Costume_Slot_Count = 4;
  134. //#elif defined(ENABLE_MOUNT_COSTUME_SYSTEM)
  135. // const DWORD c_Costume_Slot_Count = 3;
  136. //#else
  137. // const DWORD c_Costume_Slot_Count = 2;
  138. //#endif // ASA ERA DEFAULT
  139.  
  140. const DWORD c_Costume_Slot_Count = 7;
  141.  
  142. const DWORD c_Costume_Slot_End = c_Costume_Slot_Start + c_Costume_Slot_Count;
  143.  
  144. #ifdef ENABLE_WEAPON_COSTUME_SYSTEM
  145. const DWORD c_Costume_Slot_Weapon = c_Equipment_Start + CItemData::WEAR_COSTUME_WEAPON; // c_Costume_Slot_End + 1;
  146. #endif
  147.  
  148. #endif
  149.  
  150. const DWORD c_Wear_Max = CItemData::WEAR_MAX_NUM;
  151. const DWORD c_DragonSoul_Equip_Start = c_ItemSlot_Count + c_Wear_Max;
  152. const DWORD c_DragonSoul_Equip_Slot_Max = 6;
  153. const DWORD c_DragonSoul_Equip_End = c_DragonSoul_Equip_Start + c_DragonSoul_Equip_Slot_Max * DS_DECK_MAX_NUM;
  154.  
  155. const DWORD c_DragonSoul_Equip_Reserved_Count = c_DragonSoul_Equip_Slot_Max * 3;
  156.  
  157. #ifdef ENABLE_NEW_EQUIPMENT_SYSTEM
  158. const DWORD c_Belt_Inventory_Slot_Start = c_DragonSoul_Equip_End + c_DragonSoul_Equip_Reserved_Count;
  159. const DWORD c_Belt_Inventory_Width = 4;
  160. const DWORD c_Belt_Inventory_Height= 4;
  161. const DWORD c_Belt_Inventory_Slot_Count = c_Belt_Inventory_Width * c_Belt_Inventory_Height;
  162. const DWORD c_Belt_Inventory_Slot_End = c_Belt_Inventory_Slot_Start + c_Belt_Inventory_Slot_Count;
  163.  
  164. const DWORD c_Inventory_Count = c_Belt_Inventory_Slot_End;
  165. #else
  166. const DWORD c_Inventory_Count = c_DragonSoul_Equip_End;
  167. #endif
  168.  
  169. const DWORD c_DragonSoul_Inventory_Start = 0;
  170. const DWORD c_DragonSoul_Inventory_Box_Size = 32;
  171. const DWORD c_DragonSoul_Inventory_Count = CItemData::DS_SLOT_NUM_TYPES * DRAGON_SOUL_GRADE_MAX * c_DragonSoul_Inventory_Box_Size;
  172. const DWORD c_DragonSoul_Inventory_End = c_DragonSoul_Inventory_Start + c_DragonSoul_Inventory_Count;
  173.  
  174. enum ESlotType
  175. {
  176. SLOT_TYPE_NONE,
  177. SLOT_TYPE_INVENTORY,
  178. SLOT_TYPE_SKILL,
  179. SLOT_TYPE_EMOTION,
  180. SLOT_TYPE_SHOP,
  181. SLOT_TYPE_EXCHANGE_OWNER,
  182. SLOT_TYPE_EXCHANGE_TARGET,
  183. SLOT_TYPE_QUICK_SLOT,
  184. SLOT_TYPE_SAFEBOX,
  185. SLOT_TYPE_PRIVATE_SHOP,
  186. SLOT_TYPE_MALL,
  187. SLOT_TYPE_DRAGON_SOUL_INVENTORY,
  188. #ifdef ENABLE_SWITCHBOT
  189. SLOT_TYPE_SWITCHBOT,
  190. #endif
  191. SLOT_TYPE_MAX,
  192. };
  193.  
  194. enum EWindows
  195. {
  196. RESERVED_WINDOW,
  197. INVENTORY,
  198. EQUIPMENT,
  199. SAFEBOX,
  200. MALL,
  201. DRAGON_SOUL_INVENTORY,
  202. #ifdef ENABLE_SWITCHBOT
  203. SWITCHBOT,
  204. #endif
  205. BELT_INVENTORY,
  206. GROUND,
  207. WINDOW_TYPE_MAX,
  208. };
  209.  
  210. enum EDSInventoryMaxNum
  211. {
  212. DS_INVENTORY_MAX_NUM = c_DragonSoul_Inventory_Count,
  213. DS_REFINE_WINDOW_MAX_NUM = 15,
  214. };
  215.  
  216. #ifdef ENABLE_SWITCHBOT
  217. enum ESwitchbotValues
  218. {
  219. SWITCHBOT_SLOT_COUNT = 7,
  220. SWITCHBOT_ALTERNATIVE_COUNT = 2,
  221. MAX_NORM_ATTR_NUM = 5,
  222. };
  223.  
  224. enum EAttributeSet
  225. {
  226. ATTRIBUTE_SET_WEAPON,
  227. ATTRIBUTE_SET_BODY,
  228. ATTRIBUTE_SET_WRIST,
  229. ATTRIBUTE_SET_FOOTS,
  230. ATTRIBUTE_SET_NECK,
  231. ATTRIBUTE_SET_HEAD,
  232. ATTRIBUTE_SET_SHIELD,
  233. ATTRIBUTE_SET_EAR,
  234.  
  235. ATTRIBUTE_SET_MAX_NUM,
  236. };
  237. #endif
  238.  
  239.  
  240. #pragma pack (push, 1)
  241. #define WORD_MAX 0xffff
  242.  
  243. typedef struct SItemPos
  244. {
  245. BYTE window_type;
  246. WORD cell;
  247. SItemPos ()
  248. {
  249. window_type = INVENTORY;
  250. cell = WORD_MAX;
  251. }
  252. SItemPos (BYTE _window_type, WORD _cell)
  253. {
  254. window_type = _window_type;
  255. cell = _cell;
  256. }
  257.  
  258. // int operator=(const int _cell)
  259. // {
  260. //window_type = INVENTORY;
  261. // cell = _cell;
  262. // return cell;
  263. // }
  264. bool IsValidCell()
  265. {
  266. switch (window_type)
  267. {
  268. case INVENTORY:
  269. return cell < c_Inventory_Count;
  270. break;
  271. case EQUIPMENT:
  272. return cell < c_DragonSoul_Equip_End;
  273. break;
  274. case DRAGON_SOUL_INVENTORY:
  275. return cell < (DS_INVENTORY_MAX_NUM);
  276. break;
  277. #ifdef ENABLE_SWITCHBOT
  278. case SWITCHBOT:
  279. return cell < SWITCHBOT_SLOT_COUNT;
  280. break;
  281. #endif
  282. default:
  283. return false;
  284. }
  285. }
  286. bool IsEquipCell()
  287. {
  288. switch (window_type)
  289. {
  290. case INVENTORY:
  291. case EQUIPMENT:
  292. return (c_Equipment_Start + c_Wear_Max > cell) && (c_Equipment_Start <= cell);
  293. break;
  294.  
  295. case BELT_INVENTORY:
  296. case DRAGON_SOUL_INVENTORY:
  297. return false;
  298. break;
  299.  
  300. default:
  301. return false;
  302. }
  303. }
  304.  
  305. #ifdef ENABLE_NEW_EQUIPMENT_SYSTEM
  306. bool IsBeltInventoryCell()
  307. {
  308. bool bResult = c_Belt_Inventory_Slot_Start <= cell && c_Belt_Inventory_Slot_End > cell;
  309. return bResult;
  310. }
  311. #endif
  312.  
  313. bool operator==(const struct SItemPos& rhs) const
  314. {
  315. return (window_type == rhs.window_type) && (cell == rhs.cell);
  316. }
  317.  
  318. bool operator<(const struct SItemPos& rhs) const
  319. {
  320. return (window_type < rhs.window_type) || ((window_type == rhs.window_type) && (cell < rhs.cell));
  321. }
  322. } TItemPos;
  323. #pragma pack(pop)
  324.  
  325. const DWORD c_QuickBar_Line_Count = 3;
  326. const DWORD c_QuickBar_Slot_Count = 12;
  327.  
  328. const float c_Idle_WaitTime = 5.0f;
  329.  
  330. const int c_Monster_Race_Start_Number = 6;
  331. const int c_Monster_Model_Start_Number = 20001;
  332.  
  333. const float c_fAttack_Delay_Time = 0.2f;
  334. const float c_fHit_Delay_Time = 0.1f;
  335. const float c_fCrash_Wave_Time = 0.2f;
  336. const float c_fCrash_Wave_Distance = 3.0f;
  337.  
  338. const float c_fHeight_Step_Distance = 50.0f;
  339.  
  340. enum
  341. {
  342. DISTANCE_TYPE_FOUR_WAY,
  343. DISTANCE_TYPE_EIGHT_WAY,
  344. DISTANCE_TYPE_ONE_WAY,
  345. DISTANCE_TYPE_MAX_NUM,
  346. };
  347.  
  348. const float c_fMagic_Script_Version = 1.0f;
  349. const float c_fSkill_Script_Version = 1.0f;
  350. const float c_fMagicSoundInformation_Version = 1.0f;
  351. const float c_fBattleCommand_Script_Version = 1.0f;
  352. const float c_fEmotionCommand_Script_Version = 1.0f;
  353. const float c_fActive_Script_Version = 1.0f;
  354. const float c_fPassive_Script_Version = 1.0f;
  355.  
  356. // Used by PushMove
  357. const float c_fWalkDistance = 175.0f;
  358. const float c_fRunDistance = 310.0f;
  359.  
  360. #define FILE_MAX_LEN 128
  361.  
  362. enum
  363. {
  364. ITEM_SOCKET_SLOT_MAX_NUM = 3,
  365. // refactored attribute slot begin
  366. ITEM_ATTRIBUTE_SLOT_NORM_NUM = 5,
  367. ITEM_ATTRIBUTE_SLOT_RARE_NUM = 2,
  368.  
  369. ITEM_ATTRIBUTE_SLOT_NORM_START = 0,
  370. ITEM_ATTRIBUTE_SLOT_NORM_END = ITEM_ATTRIBUTE_SLOT_NORM_START + ITEM_ATTRIBUTE_SLOT_NORM_NUM,
  371.  
  372. ITEM_ATTRIBUTE_SLOT_RARE_START = ITEM_ATTRIBUTE_SLOT_NORM_END,
  373. ITEM_ATTRIBUTE_SLOT_RARE_END = ITEM_ATTRIBUTE_SLOT_RARE_START + ITEM_ATTRIBUTE_SLOT_RARE_NUM,
  374.  
  375. ITEM_ATTRIBUTE_SLOT_MAX_NUM = ITEM_ATTRIBUTE_SLOT_RARE_END, // 7
  376. // refactored attribute slot end
  377. };
  378.  
  379. #pragma pack(push)
  380. #pragma pack(1)
  381.  
  382. typedef struct SQuickSlot
  383. {
  384. BYTE Type;
  385. BYTE Position;
  386. } TQuickSlot;
  387.  
  388. typedef struct TPlayerItemAttribute
  389. {
  390. BYTE bType;
  391. short sValue;
  392. } TPlayerItemAttribute;
  393.  
  394. typedef struct packet_item
  395. {
  396. DWORD vnum;
  397. BYTE count;
  398. DWORD flags;
  399. DWORD anti_flags;
  400. long alSockets[ITEM_SOCKET_SLOT_MAX_NUM];
  401. TPlayerItemAttribute aAttr[ITEM_ATTRIBUTE_SLOT_MAX_NUM];
  402. } TItemData;
  403.  
  404. typedef struct packet_shop_item
  405. {
  406. DWORD vnum;
  407. DWORD price;
  408. #ifdef ENABLE_CHEQUE_SYSTEM
  409. DWORD cheque;
  410. #endif
  411. BYTE count;
  412. #ifdef ENABLE_MULTISHOP
  413. DWORD wPriceVnum;
  414. DWORD wPrice;
  415. #endif
  416. BYTE display_pos;
  417. long alSockets[ITEM_SOCKET_SLOT_MAX_NUM];
  418. TPlayerItemAttribute aAttr[ITEM_ATTRIBUTE_SLOT_MAX_NUM];
  419. #if defined(ENABLE_RENEWAL_SHOPEX)
  420. BYTE price_type;
  421. DWORD price_vnum;
  422. #endif
  423. } TShopItemData;
  424.  
  425. #if defined(ENABLE_RENEWAL_SHOPEX)
  426. enum STableExTypes
  427. {
  428. SHOPEX_GOLD = 1,
  429. SHOPEX_SECONDARY,
  430. SHOPEX_ITEM,
  431. SHOPEX_EXP,
  432. SHOPEX_MAX,
  433. };
  434. #endif
  435.  
  436. #pragma pack(pop)
  437.  
  438. inline float GetSqrtDistance(int ix1, int iy1, int ix2, int iy2) // By sqrt
  439. {
  440. float dx, dy;
  441.  
  442. dx = float(ix1 - ix2);
  443. dy = float(iy1 - iy2);
  444.  
  445. return sqrtf(dx*dx + dy*dy);
  446. }
  447.  
  448. // DEFAULT_FONT
  449. void DefaultFont_Startup();
  450. void DefaultFont_Cleanup();
  451. void DefaultFont_SetName(const char * c_szFontName);
  452. CResource* DefaultFont_GetResource();
  453. CResource* DefaultItalicFont_GetResource();
  454. // END_OF_DEFAULT_FONT
  455.  
  456. void SetGuildSymbolPath(const char * c_szPathName);
  457. const char * GetGuildSymbolFileName(DWORD dwGuildID);
  458. BYTE SlotTypeToInvenType(BYTE bSlotType);
  459. BYTE ApplyTypeToPointType(BYTE bApplyType);
  460. //martysama0134's dcf42890919f0da1c0e6dbb7f15bc7ec
  461.