Guest User

Untitled

a guest
Feb 4th, 2019
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.82 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 = 5;
  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 + 23;
  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; // [주의] 숫자(19) 하드코딩 주의. 현재 서버에서 코스츔 슬롯은 19부터임. 서버 common/length.h 파일의 EWearPositions 열거형 참고.
  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_Mount = c_Costume_Slot_Start + 2;
  106. const DWORD c_Costume_Slot_Sash = c_Costume_Slot_Start + 3;
  107. const DWORD c_Costume_Slot_Count = 3;
  108. const DWORD c_Costume_Slot_End = c_Costume_Slot_Start + c_Costume_Slot_Count;
  109. #endif
  110.  
  111.  
  112.  
  113. // [주의] 숫자(32) 하드코딩 주의. 현재 서버에서 용혼석 슬롯은 32부터임.
  114. // 서버 common/length.h 파일의 EWearPositions 열거형이 32까지 확장될 것을 염두하고(32 이상은 확장 하기 힘들게 되어있음.),
  115. // 그 이후부터를 용혼석 장착 슬롯으로 사용.
  116. const DWORD c_Wear_Max = 32;
  117. const DWORD c_DragonSoul_Equip_Start = c_ItemSlot_Count + c_Wear_Max;
  118. const DWORD c_DragonSoul_Equip_Slot_Max = 6;
  119. const DWORD c_DragonSoul_Equip_End = c_DragonSoul_Equip_Start + c_DragonSoul_Equip_Slot_Max * DS_DECK_MAX_NUM;
  120.  
  121. // NOTE: 2013년 2월 5일 현재... 용혼석 데크는 2개가 존재하는데, 향후 확장 가능성이 있어서 3개 데크 여유분을 할당 해 둠. 그 뒤 공간은 벨트 인벤토리로 사용
  122. const DWORD c_DragonSoul_Equip_Reserved_Count = c_DragonSoul_Equip_Slot_Max * 3;
  123.  
  124. #ifdef ENABLE_NEW_EQUIPMENT_SYSTEM
  125. // 벨트 아이템이 제공하는 인벤토리
  126. const DWORD c_Belt_Inventory_Slot_Start = c_DragonSoul_Equip_End + c_DragonSoul_Equip_Reserved_Count;
  127. const DWORD c_Belt_Inventory_Width = 4;
  128. const DWORD c_Belt_Inventory_Height= 4;
  129. const DWORD c_Belt_Inventory_Slot_Count = c_Belt_Inventory_Width * c_Belt_Inventory_Height;
  130. const DWORD c_Belt_Inventory_Slot_End = c_Belt_Inventory_Slot_Start + c_Belt_Inventory_Slot_Count;
  131.  
  132. const DWORD c_Inventory_Count = c_Belt_Inventory_Slot_End;
  133. #else
  134. const DWORD c_Inventory_Count = c_DragonSoul_Equip_End;
  135. #endif
  136.  
  137. // 용혼석 전용 인벤토리
  138. const DWORD c_DragonSoul_Inventory_Start = 0;
  139. const DWORD c_DragonSoul_Inventory_Box_Size = 32;
  140. const DWORD c_DragonSoul_Inventory_Count = CItemData::DS_SLOT_NUM_TYPES * DRAGON_SOUL_GRADE_MAX * c_DragonSoul_Inventory_Box_Size;
  141. const DWORD c_DragonSoul_Inventory_End = c_DragonSoul_Inventory_Start + c_DragonSoul_Inventory_Count;
  142.  
  143. enum ESlotType
  144. {
  145. SLOT_TYPE_NONE,
  146. SLOT_TYPE_INVENTORY,
  147. SLOT_TYPE_SKILL,
  148. SLOT_TYPE_EMOTION,
  149. SLOT_TYPE_SHOP,
  150. SLOT_TYPE_EXCHANGE_OWNER,
  151. SLOT_TYPE_EXCHANGE_TARGET,
  152. SLOT_TYPE_QUICK_SLOT,
  153. SLOT_TYPE_SAFEBOX,
  154. SLOT_TYPE_PRIVATE_SHOP,
  155. SLOT_TYPE_MALL,
  156. SLOT_TYPE_DRAGON_SOUL_INVENTORY,
  157. SLOT_TYPE_MAX,
  158. };
  159.  
  160. enum EWindows
  161. {
  162. RESERVED_WINDOW,
  163. INVENTORY, // 기본 인벤토리. (45칸 짜리가 2페이지 존재 = 90칸)
  164. EQUIPMENT,
  165. SAFEBOX,
  166. MALL,
  167. DRAGON_SOUL_INVENTORY,
  168. GROUND, // NOTE: 2013년 2월5일 현재까지 unused.. 왜 있는거지???
  169. BELT_INVENTORY, // NOTE: W2.1 버전에 새로 추가되는 벨트 슬롯 아이템이 제공하는 벨트 인벤토리
  170.  
  171. WINDOW_TYPE_MAX,
  172. };
  173.  
  174. enum EDSInventoryMaxNum
  175. {
  176. DS_INVENTORY_MAX_NUM = c_DragonSoul_Inventory_Count,
  177. DS_REFINE_WINDOW_MAX_NUM = 15,
  178. };
  179.  
  180. #pragma pack (push, 1)
  181. #define WORD_MAX 0xffff
  182.  
  183. typedef struct SItemPos
  184. {
  185. BYTE window_type;
  186. WORD cell;
  187. SItemPos ()
  188. {
  189. window_type = INVENTORY;
  190. cell = WORD_MAX;
  191. }
  192. SItemPos (BYTE _window_type, WORD _cell)
  193. {
  194. window_type = _window_type;
  195. cell = _cell;
  196. }
  197.  
  198. // 기존에 cell의 형을 보면 BYTE가 대부분이지만, oi
  199. // 어떤 부분은 int, 어떤 부분은 WORD로 되어있어,
  200. // 가장 큰 자료형인 int로 받는다.
  201. // int operator=(const int _cell)
  202. // {
  203. //window_type = INVENTORY;
  204. // cell = _cell;
  205. // return cell;
  206. // }
  207. bool IsValidCell()
  208. {
  209. switch (window_type)
  210. {
  211. case INVENTORY:
  212. return cell < c_Inventory_Count;
  213. break;
  214. case EQUIPMENT:
  215. return cell < c_DragonSoul_Equip_End;
  216. break;
  217. case DRAGON_SOUL_INVENTORY:
  218. return cell < (DS_INVENTORY_MAX_NUM);
  219. break;
  220. default:
  221. return false;
  222. }
  223. }
  224. bool IsEquipCell()
  225. {
  226. switch (window_type)
  227. {
  228. case INVENTORY:
  229. case EQUIPMENT:
  230. return (c_Equipment_Start + c_Wear_Max > cell) && (c_Equipment_Start <= cell);
  231. break;
  232.  
  233. case BELT_INVENTORY:
  234. case DRAGON_SOUL_INVENTORY:
  235. return false;
  236. break;
  237.  
  238. default:
  239. return false;
  240. }
  241. }
  242.  
  243. #ifdef ENABLE_NEW_EQUIPMENT_SYSTEM
  244. bool IsBeltInventoryCell()
  245. {
  246. bool bResult = c_Belt_Inventory_Slot_Start <= cell && c_Belt_Inventory_Slot_End > cell;
  247. return bResult;
  248. }
  249. #endif
  250.  
  251. bool operator==(const struct SItemPos& rhs) const
  252. {
  253. return (window_type == rhs.window_type) && (cell == rhs.cell);
  254. }
  255.  
  256. bool operator<(const struct SItemPos& rhs) const
  257. {
  258. return (window_type < rhs.window_type) || ((window_type == rhs.window_type) && (cell < rhs.cell));
  259. }
  260. } TItemPos;
  261. #pragma pack(pop)
  262.  
  263. const DWORD c_QuickBar_Line_Count = 3;
  264. const DWORD c_QuickBar_Slot_Count = 12;
  265.  
  266. const float c_Idle_WaitTime = 5.0f;
  267.  
  268. const int c_Monster_Race_Start_Number = 6;
  269. const int c_Monster_Model_Start_Number = 20001;
  270.  
  271. const float c_fAttack_Delay_Time = 0.2f;
  272. const float c_fHit_Delay_Time = 0.1f;
  273. const float c_fCrash_Wave_Time = 0.2f;
  274. const float c_fCrash_Wave_Distance = 3.0f;
  275.  
  276. const float c_fHeight_Step_Distance = 50.0f;
  277.  
  278. enum
  279. {
  280. DISTANCE_TYPE_FOUR_WAY,
  281. DISTANCE_TYPE_EIGHT_WAY,
  282. DISTANCE_TYPE_ONE_WAY,
  283. DISTANCE_TYPE_MAX_NUM,
  284. };
  285.  
  286. const float c_fMagic_Script_Version = 1.0f;
  287. const float c_fSkill_Script_Version = 1.0f;
  288. const float c_fMagicSoundInformation_Version = 1.0f;
  289. const float c_fBattleCommand_Script_Version = 1.0f;
  290. const float c_fEmotionCommand_Script_Version = 1.0f;
  291. const float c_fActive_Script_Version = 1.0f;
  292. const float c_fPassive_Script_Version = 1.0f;
  293.  
  294. // Used by PushMove
  295. const float c_fWalkDistance = 175.0f;
  296. const float c_fRunDistance = 310.0f;
  297.  
  298. #define FILE_MAX_LEN 128
  299.  
  300. enum
  301. {
  302. ITEM_SOCKET_SLOT_MAX_NUM = 3,
  303. // refactored attribute slot begin
  304. ITEM_ATTRIBUTE_SLOT_NORM_NUM = 5,
  305. ITEM_ATTRIBUTE_SLOT_RARE_NUM = 2,
  306.  
  307. ITEM_ATTRIBUTE_SLOT_NORM_START = 0,
  308. ITEM_ATTRIBUTE_SLOT_NORM_END = ITEM_ATTRIBUTE_SLOT_NORM_START + ITEM_ATTRIBUTE_SLOT_NORM_NUM,
  309.  
  310. ITEM_ATTRIBUTE_SLOT_RARE_START = ITEM_ATTRIBUTE_SLOT_NORM_END,
  311. ITEM_ATTRIBUTE_SLOT_RARE_END = ITEM_ATTRIBUTE_SLOT_RARE_START + ITEM_ATTRIBUTE_SLOT_RARE_NUM,
  312.  
  313. ITEM_ATTRIBUTE_SLOT_MAX_NUM = ITEM_ATTRIBUTE_SLOT_RARE_END, // 7
  314. // refactored attribute slot end
  315. };
  316.  
  317. #pragma pack(push)
  318. #pragma pack(1)
  319.  
  320. typedef struct SQuickSlot
  321. {
  322. BYTE Type;
  323. BYTE Position;
  324. } TQuickSlot;
  325.  
  326. typedef struct TPlayerItemAttribute
  327. {
  328. BYTE bType;
  329. short sValue;
  330. } TPlayerItemAttribute;
  331.  
  332. typedef struct packet_item
  333. {
  334. DWORD vnum;
  335. BYTE count;
  336. DWORD flags;
  337. DWORD anti_flags;
  338. long alSockets[ITEM_SOCKET_SLOT_MAX_NUM];
  339. TPlayerItemAttribute aAttr[ITEM_ATTRIBUTE_SLOT_MAX_NUM];
  340. } TItemData;
  341.  
  342. typedef struct packet_shop_item
  343. {
  344. DWORD vnum;
  345. #ifdef ENABLE_FULL_YANG
  346. long long price; // PC 상점에만 이용
  347. #else
  348. DWORD price;
  349. #endif
  350. BYTE count;
  351. BYTE display_pos;
  352. long alSockets[ITEM_SOCKET_SLOT_MAX_NUM];
  353. TPlayerItemAttribute aAttr[ITEM_ATTRIBUTE_SLOT_MAX_NUM];
  354. } TShopItemData;
  355.  
  356. #pragma pack(pop)
  357.  
  358. inline float GetSqrtDistance(int ix1, int iy1, int ix2, int iy2) // By sqrt
  359. {
  360. float dx, dy;
  361.  
  362. dx = float(ix1 - ix2);
  363. dy = float(iy1 - iy2);
  364.  
  365. return sqrtf(dx*dx + dy*dy);
  366. }
  367.  
  368. // DEFAULT_FONT
  369. void DefaultFont_Startup();
  370. void DefaultFont_Cleanup();
  371. void DefaultFont_SetName(const char * c_szFontName);
  372. CResource* DefaultFont_GetResource();
  373. CResource* DefaultItalicFont_GetResource();
  374. // END_OF_DEFAULT_FONT
  375.  
  376. void SetGuildSymbolPath(const char * c_szPathName);
  377. const char * GetGuildSymbolFileName(DWORD dwGuildID);
  378. BYTE SlotTypeToInvenType(BYTE bSlotType);
Advertisement
Add Comment
Please, Sign In to add comment