Advertisement
Guest User

Untitled

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