MrP0wers

char.h

Oct 1st, 2025
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 50.78 KB | None | 0 0
  1. #ifndef __INC_METIN_II_CHAR_H__
  2. #define __INC_METIN_II_CHAR_H__
  3.  
  4. #include "entity.h"
  5. #include "FSM.h"
  6. #include "horse_rider.h"
  7. #include "vid.h"
  8. #include "constants.h"
  9. #include "affect.h"
  10. #include "affect_flag.h"
  11. #include "cube.h"
  12. #include "mining.h"
  13.  
  14. #ifdef ENABLE_BLOCK_ITEM_MAP
  15. #include "block_items_system.h"
  16. #endif
  17.  
  18. #include <boost/unordered_map.hpp>
  19.  
  20. #include "../../common/stl.h"
  21.  
  22. enum eMountType {MOUNT_TYPE_NONE=0, MOUNT_TYPE_NORMAL=1, MOUNT_TYPE_COMBAT=2, MOUNT_TYPE_MILITARY=3};
  23. eMountType GetMountLevelByVnum(DWORD dwMountVnum, bool IsNew);
  24.  
  25. class CBuffOnAttributes;
  26. class CPetSystem;
  27.  
  28. #define INSTANT_FLAG_DEATH_PENALTY (1 << 0)
  29. #define INSTANT_FLAG_SHOP (1 << 1)
  30. #define INSTANT_FLAG_EXCHANGE (1 << 2)
  31. #define INSTANT_FLAG_STUN (1 << 3)
  32. #define INSTANT_FLAG_NO_REWARD (1 << 4)
  33.  
  34. #define AI_FLAG_NPC (1 << 0)
  35. #define AI_FLAG_AGGRESSIVE (1 << 1)
  36. #define AI_FLAG_HELPER (1 << 2)
  37. #define AI_FLAG_STAYZONE (1 << 3)
  38.  
  39. #define SET_OVER_TIME(ch, time) (ch)->SetOverTime(time)
  40.  
  41. extern int g_nPortalLimitTime;
  42.  
  43. enum
  44. {
  45. MAIN_RACE_WARRIOR_M,
  46. MAIN_RACE_ASSASSIN_W,
  47. MAIN_RACE_SURA_M,
  48. MAIN_RACE_SHAMAN_W,
  49. MAIN_RACE_WARRIOR_W,
  50. MAIN_RACE_ASSASSIN_M,
  51. MAIN_RACE_SURA_W,
  52. MAIN_RACE_SHAMAN_M,
  53. MAIN_RACE_MAX_NUM,
  54. };
  55.  
  56. enum
  57. {
  58. POISON_LENGTH = 30,
  59. STAMINA_PER_STEP = 1,
  60. SAFEBOX_PAGE_SIZE = 9,
  61. AI_CHANGE_ATTACK_POISITION_TIME_NEAR = 10000,
  62. AI_CHANGE_ATTACK_POISITION_TIME_FAR = 1000,
  63. AI_CHANGE_ATTACK_POISITION_DISTANCE = 100,
  64. SUMMON_MONSTER_COUNT = 3,
  65. };
  66.  
  67. enum
  68. {
  69. FLY_NONE,
  70. FLY_EXP,
  71. FLY_HP_MEDIUM,
  72. FLY_HP_BIG,
  73. FLY_SP_SMALL,
  74. FLY_SP_MEDIUM,
  75. FLY_SP_BIG,
  76. FLY_FIREWORK1,
  77. FLY_FIREWORK2,
  78. FLY_FIREWORK3,
  79. FLY_FIREWORK4,
  80. FLY_FIREWORK5,
  81. FLY_FIREWORK6,
  82. FLY_FIREWORK_CHRISTMAS,
  83. FLY_CHAIN_LIGHTNING,
  84. FLY_HP_SMALL,
  85. FLY_SKILL_MUYEONG,
  86. };
  87.  
  88. enum EDamageType
  89. {
  90. DAMAGE_TYPE_NONE,
  91. DAMAGE_TYPE_NORMAL,
  92. DAMAGE_TYPE_NORMAL_RANGE,
  93. DAMAGE_TYPE_MELEE,
  94. DAMAGE_TYPE_RANGE,
  95. DAMAGE_TYPE_FIRE,
  96. DAMAGE_TYPE_ICE,
  97. DAMAGE_TYPE_ELEC,
  98. DAMAGE_TYPE_MAGIC,
  99. DAMAGE_TYPE_POISON,
  100. DAMAGE_TYPE_SPECIAL,
  101. };
  102.  
  103. enum DamageFlag
  104. {
  105. DAMAGE_NORMAL = (1 << 0),
  106. DAMAGE_POISON = (1 << 1),
  107. DAMAGE_DODGE = (1 << 2),
  108. DAMAGE_BLOCK = (1 << 3),
  109. DAMAGE_PENETRATE= (1 << 4),
  110. DAMAGE_CRITICAL = (1 << 5),
  111. };
  112.  
  113. enum EPointTypes
  114. {
  115. POINT_NONE,
  116. POINT_LEVEL,
  117. POINT_VOICE,
  118. POINT_EXP,
  119. POINT_NEXT_EXP,
  120. POINT_HP,
  121. POINT_MAX_HP,
  122. POINT_SP,
  123. POINT_MAX_SP,
  124. POINT_STAMINA,
  125. POINT_MAX_STAMINA,
  126.  
  127. POINT_GOLD,
  128. POINT_ST,
  129. POINT_HT,
  130. POINT_DX,
  131. POINT_IQ,
  132. POINT_DEF_GRADE,
  133. POINT_ATT_SPEED,
  134. POINT_ATT_GRADE,
  135. POINT_MOV_SPEED,
  136. POINT_CLIENT_DEF_GRADE,
  137. POINT_CASTING_SPEED,
  138. POINT_MAGIC_ATT_GRADE,
  139. POINT_MAGIC_DEF_GRADE,
  140. POINT_EMPIRE_POINT,
  141. POINT_LEVEL_STEP,
  142. POINT_STAT,
  143. POINT_SUB_SKILL,
  144. POINT_SKILL,
  145. POINT_WEAPON_MIN,
  146. POINT_WEAPON_MAX,
  147. POINT_PLAYTIME,
  148. POINT_HP_REGEN,
  149. POINT_SP_REGEN,
  150.  
  151. POINT_BOW_DISTANCE,
  152.  
  153. POINT_HP_RECOVERY,
  154. POINT_SP_RECOVERY,
  155.  
  156. POINT_POISON_PCT,
  157. POINT_STUN_PCT,
  158. POINT_SLOW_PCT,
  159. POINT_CRITICAL_PCT,
  160. POINT_PENETRATE_PCT,
  161. POINT_CURSE_PCT,
  162.  
  163. POINT_ATTBONUS_HUMAN,
  164. POINT_ATTBONUS_ANIMAL,
  165. POINT_ATTBONUS_ORC,
  166. POINT_ATTBONUS_MILGYO,
  167. POINT_ATTBONUS_UNDEAD,
  168. POINT_ATTBONUS_DEVIL,
  169. POINT_ATTBONUS_INSECT,
  170. POINT_ATTBONUS_FIRE,
  171. POINT_ATTBONUS_ICE,
  172. POINT_ATTBONUS_DESERT,
  173. POINT_ATTBONUS_MONSTER,
  174. POINT_ATTBONUS_WARRIOR,
  175. POINT_ATTBONUS_ASSASSIN,
  176. POINT_ATTBONUS_SURA,
  177. POINT_ATTBONUS_SHAMAN,
  178. POINT_ATTBONUS_TREE,
  179.  
  180. POINT_RESIST_WARRIOR,
  181. POINT_RESIST_ASSASSIN,
  182. POINT_RESIST_SURA,
  183. POINT_RESIST_SHAMAN,
  184.  
  185. POINT_STEAL_HP,
  186. POINT_STEAL_SP,
  187.  
  188. POINT_MANA_BURN_PCT,
  189.  
  190. POINT_DAMAGE_SP_RECOVER,
  191.  
  192. POINT_BLOCK,
  193. POINT_DODGE,
  194.  
  195. POINT_RESIST_SWORD,
  196. POINT_RESIST_TWOHAND,
  197. POINT_RESIST_DAGGER,
  198. POINT_RESIST_BELL,
  199. POINT_RESIST_FAN,
  200. POINT_RESIST_BOW,
  201. POINT_RESIST_FIRE,
  202. POINT_RESIST_ELEC,
  203. POINT_RESIST_MAGIC,
  204. POINT_RESIST_WIND,
  205.  
  206. POINT_REFLECT_MELEE,
  207.  
  208. POINT_REFLECT_CURSE,
  209. POINT_POISON_REDUCE,
  210.  
  211. POINT_KILL_SP_RECOVER,
  212. POINT_EXP_DOUBLE_BONUS,
  213. POINT_GOLD_DOUBLE_BONUS,
  214. POINT_ITEM_DROP_BONUS,
  215.  
  216. POINT_POTION_BONUS,
  217. POINT_KILL_HP_RECOVERY,
  218.  
  219. POINT_IMMUNE_STUN,
  220. POINT_IMMUNE_SLOW,
  221. POINT_IMMUNE_FALL,
  222.  
  223. POINT_PARTY_ATTACKER_BONUS,
  224. POINT_PARTY_TANKER_BONUS,
  225.  
  226. POINT_ATT_BONUS,
  227. POINT_DEF_BONUS,
  228.  
  229. POINT_ATT_GRADE_BONUS,
  230. POINT_DEF_GRADE_BONUS,
  231. POINT_MAGIC_ATT_GRADE_BONUS,
  232. POINT_MAGIC_DEF_GRADE_BONUS,
  233.  
  234. POINT_RESIST_NORMAL_DAMAGE,
  235.  
  236. POINT_HIT_HP_RECOVERY,
  237. POINT_HIT_SP_RECOVERY,
  238. POINT_MANASHIELD,
  239.  
  240. POINT_PARTY_BUFFER_BONUS,
  241. POINT_PARTY_SKILL_MASTER_BONUS,
  242.  
  243. POINT_HP_RECOVER_CONTINUE,
  244. POINT_SP_RECOVER_CONTINUE,
  245.  
  246. POINT_STEAL_GOLD,
  247. POINT_POLYMORPH,
  248. POINT_MOUNT,
  249.  
  250. POINT_PARTY_HASTE_BONUS,
  251. POINT_PARTY_DEFENDER_BONUS,
  252. POINT_STAT_RESET_COUNT,
  253.  
  254. POINT_HORSE_SKILL,
  255.  
  256. POINT_MALL_ATTBONUS,
  257. POINT_MALL_DEFBONUS,
  258. POINT_MALL_EXPBONUS,
  259. POINT_MALL_ITEMBONUS,
  260. POINT_MALL_GOLDBONUS,
  261.  
  262. POINT_MAX_HP_PCT,
  263. POINT_MAX_SP_PCT,
  264.  
  265. POINT_SKILL_DAMAGE_BONUS,
  266. POINT_NORMAL_HIT_DAMAGE_BONUS,
  267.  
  268. POINT_SKILL_DEFEND_BONUS,
  269. POINT_NORMAL_HIT_DEFEND_BONUS,
  270.  
  271. POINT_RAMADAN_CANDY_BONUS_EXP,
  272.  
  273. POINT_ENERGY = 128,
  274.  
  275. POINT_ENERGY_END_TIME = 129,
  276.  
  277. POINT_COSTUME_ATTR_BONUS = 130,
  278. POINT_MAGIC_ATT_BONUS_PER = 131,
  279. POINT_MELEE_MAGIC_ATT_BONUS_PER = 132,
  280.  
  281. POINT_RESIST_ICE = 133,
  282. POINT_RESIST_EARTH = 134,
  283. POINT_RESIST_DARK = 135,
  284.  
  285. POINT_RESIST_CRITICAL = 136,
  286. POINT_RESIST_PENETRATE = 137,
  287.  
  288. #ifdef __TITLE_SYSTEM__
  289. POINT_TITLE = 150,
  290. POINT_TITLE_1 = 151,
  291. POINT_TITLE_2 = 152,
  292. POINT_TITLE_3 = 153,
  293. POINT_TITLE_4 = 154,
  294. POINT_TITLE_5 = 155,
  295. POINT_TITLE_6 = 156,
  296. POINT_TITLE_7 = 157,
  297. POINT_TITLE_8 = 158,
  298. POINT_TITLE_9 = 159,
  299. POINT_TITLE_10 = 160,
  300. POINT_TITLE_11 = 161,
  301. POINT_TITLE_12 = 162,
  302. POINT_TITLE_13 = 163,
  303. POINT_TITLE_14 = 164,
  304. POINT_TITLE_15 = 165,
  305. POINT_TITLE_16 = 166,
  306. POINT_TITLE_17 = 167,
  307. POINT_TITLE_18 = 168,
  308. POINT_TITLE_19 = 169,
  309. POINT_TITLE_20 = 170,
  310. #endif
  311.  
  312. //POINT_MAX_NUM = 129
  313. };
  314.  
  315. enum EPKModes
  316. {
  317. PK_MODE_PEACE,
  318. PK_MODE_REVENGE,
  319. PK_MODE_FREE,
  320. PK_MODE_PROTECT,
  321. PK_MODE_GUILD,
  322. PK_MODE_MAX_NUM
  323. };
  324.  
  325. enum EPositions
  326. {
  327. POS_DEAD,
  328. POS_SLEEPING,
  329. POS_RESTING,
  330. POS_SITTING,
  331. POS_FISHING,
  332. POS_FIGHTING,
  333. POS_MOUNTING,
  334. POS_STANDING
  335. };
  336.  
  337. enum EBlockAction
  338. {
  339. BLOCK_EXCHANGE = (1 << 0),
  340. BLOCK_PARTY_INVITE = (1 << 1),
  341. BLOCK_GUILD_INVITE = (1 << 2),
  342. BLOCK_WHISPER = (1 << 3),
  343. BLOCK_MESSENGER_INVITE = (1 << 4),
  344. BLOCK_PARTY_REQUEST = (1 << 5),
  345.  
  346. #ifdef __VIEW_EQUIP__
  347. BLOCK_VIEW_EQUIPMENT = (1 << 6),
  348. #endif
  349.  
  350. };
  351.  
  352. struct DynamicCharacterPtr
  353. {
  354. DynamicCharacterPtr() : is_pc(false), id(0) {}
  355.  
  356. DynamicCharacterPtr(const DynamicCharacterPtr& o)
  357. : is_pc(o.is_pc), id(o.id) {}
  358.  
  359.  
  360. LPCHARACTER Get() const;
  361. void Reset()
  362. {
  363. is_pc = false;
  364. id = 0;
  365. }
  366.  
  367. DynamicCharacterPtr& operator=(const DynamicCharacterPtr& rhs)
  368. {
  369. is_pc = rhs.is_pc;
  370. id = rhs.id;
  371.  
  372. return *this;
  373. }
  374.  
  375. DynamicCharacterPtr& operator=(LPCHARACTER character);
  376.  
  377. operator LPCHARACTER() const
  378. {
  379. return Get();
  380. }
  381.  
  382. bool is_pc;
  383. uint32_t id;
  384. };
  385.  
  386. typedef struct character_point
  387. {
  388. long long points[POINT_MAX_NUM];
  389.  
  390. BYTE job;
  391. BYTE voice;
  392.  
  393. BYTE level;
  394. DWORD exp;
  395. long long gold;
  396.  
  397. int hp;
  398. int sp;
  399.  
  400. int iRandomHP;
  401. int iRandomSP;
  402.  
  403. int stamina;
  404.  
  405. BYTE skill_group;
  406. } CHARACTER_POINT;
  407.  
  408. typedef struct character_point_instant
  409. {
  410. long long points[POINT_MAX_NUM];
  411.  
  412. float fRot;
  413.  
  414. int iMaxHP;
  415. int iMaxSP;
  416.  
  417. long position;
  418.  
  419. long instant_flag;
  420. DWORD dwAIFlag;
  421. DWORD dwImmuneFlag;
  422. DWORD dwLastShoutPulse;
  423.  
  424. WORD parts[PART_MAX_NUM];
  425.  
  426. LPITEM pItems[INVENTORY_AND_EQUIP_SLOT_MAX];
  427. BYTE bItemGrid[INVENTORY_AND_EQUIP_SLOT_MAX];
  428.  
  429. LPITEM pDSItems[DRAGON_SOUL_INVENTORY_MAX_NUM];
  430. WORD wDSItemGrid[DRAGON_SOUL_INVENTORY_MAX_NUM];
  431.  
  432. LPITEM pCubeItems[CUBE_MAX_NUM];
  433. LPCHARACTER pCubeNpc;
  434.  
  435. LPCHARACTER battle_victim;
  436.  
  437. BYTE gm_level;
  438.  
  439. BYTE bBasePart;
  440.  
  441. int iMaxStamina;
  442.  
  443. BYTE bBlockMode;
  444.  
  445. int iDragonSoulActiveDeck;
  446. LPENTITY m_pDragonSoulRefineWindowOpener;
  447.  
  448. #ifdef __SWITCHBOT__
  449. LPITEM pSwitchbotItems[SWITCHBOT_SLOT_COUNT];
  450. #endif
  451.  
  452. } CHARACTER_POINT_INSTANT;
  453.  
  454. #define TRIGGERPARAM LPCHARACTER ch, LPCHARACTER causer
  455.  
  456. typedef struct trigger
  457. {
  458. BYTE type;
  459. int (*func) (TRIGGERPARAM);
  460. long value;
  461. } TRIGGER;
  462.  
  463. class CTrigger
  464. {
  465. public:
  466. CTrigger() : bType(0), pFunc(NULL)
  467. {
  468. }
  469.  
  470. BYTE bType;
  471. int (*pFunc) (TRIGGERPARAM);
  472. };
  473.  
  474. EVENTINFO(char_event_info)
  475. {
  476. DynamicCharacterPtr ch;
  477. };
  478.  
  479. struct TSkillUseInfo
  480. {
  481. int iHitCount;
  482. int iMaxHitCount;
  483. int iSplashCount;
  484. DWORD dwNextSkillUsableTime;
  485. int iRange;
  486. bool bUsed;
  487. DWORD dwVID;
  488. bool isGrandMaster;
  489.  
  490. boost::unordered_map<VID, size_t> TargetVIDMap;
  491.  
  492. TSkillUseInfo()
  493. : iHitCount(0), iMaxHitCount(0), iSplashCount(0), dwNextSkillUsableTime(0), iRange(0), bUsed(false),
  494. dwVID(0), isGrandMaster(false)
  495. {}
  496.  
  497. bool HitOnce(DWORD dwVnum = 0);
  498.  
  499. bool UseSkill(bool isGrandMaster, DWORD vid, DWORD dwCooltime, int splashcount = 1, int hitcount = -1, int range = -1);
  500. DWORD GetMainTargetVID() const { return dwVID; }
  501. void SetMainTargetVID(DWORD vid) { dwVID=vid; }
  502. void ResetHitCount() { if (iSplashCount) { iHitCount = iMaxHitCount; iSplashCount--; } }
  503. };
  504.  
  505. typedef struct packet_party_update TPacketGCPartyUpdate;
  506.  
  507. class CExchange;
  508. class CSkillProto;
  509. class CParty;
  510. class CDungeon;
  511. class CWarMap;
  512. class CAffect;
  513. class CGuild;
  514. class CSafebox;
  515. class CArena;
  516.  
  517. class CShop;
  518.  
  519. typedef class CShop * LPSHOP;
  520.  
  521. class CMob;
  522. class CMobInstance;
  523.  
  524. typedef struct SMobSkillInfo TMobSkillInfo;
  525.  
  526. extern int GetSkillPowerByLevelFromType(int job, int skillgroup, int skilllevel);
  527.  
  528. namespace marriage
  529. {
  530. class WeddingMap;
  531. }
  532. enum e_overtime
  533. {
  534. OT_NONE,
  535. OT_3HOUR,
  536. OT_5HOUR,
  537. };
  538.  
  539. class CHARACTER : public CEntity, public CFSM, public CHorseRider
  540. {
  541. protected:
  542. virtual void EncodeInsertPacket(LPENTITY entity);
  543. virtual void EncodeRemovePacket(LPENTITY entity);
  544.  
  545.  
  546. public:
  547. LPCHARACTER FindCharacterInView(const char * name, bool bFindPCOnly);
  548. void UpdatePacket();
  549.  
  550. protected:
  551. CStateTemplate<CHARACTER> m_stateMove;
  552. CStateTemplate<CHARACTER> m_stateBattle;
  553. CStateTemplate<CHARACTER> m_stateIdle;
  554.  
  555. public:
  556. virtual void StateMove();
  557. virtual void StateBattle();
  558. virtual void StateIdle();
  559. virtual void StateFlag();
  560. virtual void StateFlagBase();
  561. void StateHorse();
  562.  
  563. protected:
  564. void __StateIdle_Monster();
  565. void __StateIdle_Stone();
  566. void __StateIdle_NPC();
  567.  
  568. public:
  569. DWORD GetAIFlag() const { return m_pointsInstant.dwAIFlag; }
  570.  
  571. void SetAggressive();
  572. bool IsAggressive() const;
  573.  
  574. void SetCoward();
  575. bool IsCoward() const;
  576. void CowardEscape();
  577.  
  578. void SetNoAttackShinsu();
  579. bool IsNoAttackShinsu() const;
  580.  
  581. void SetNoAttackChunjo();
  582. bool IsNoAttackChunjo() const;
  583.  
  584. void SetNoAttackJinno();
  585. bool IsNoAttackJinno() const;
  586.  
  587. void SetAttackMob();
  588. bool IsAttackMob() const;
  589.  
  590. virtual void BeginStateEmpty();
  591. virtual void EndStateEmpty() {}
  592.  
  593. void RestartAtSamePos();
  594.  
  595. protected:
  596. DWORD m_dwStateDuration;
  597.  
  598. public:
  599. CHARACTER();
  600. virtual ~CHARACTER();
  601.  
  602. void Create(const char * c_pszName, DWORD vid, bool isPC);
  603. void Destroy();
  604.  
  605. void Disconnect(const char * c_pszReason);
  606.  
  607. protected:
  608. void Initialize();
  609.  
  610. public:
  611. DWORD GetPlayerID() const { return m_dwPlayerID; }
  612.  
  613. #ifdef ENABLE_VIP_SYSTEM
  614. public:
  615. void VipSystem();
  616. bool VipSystemTime();
  617.  
  618. public:
  619. bool IsVIP() const { return m_afAffectFlag.IsSet(AFF_VIP); }
  620. #endif
  621.  
  622. #ifdef ENABLE_PREMIUM_SYSTEM
  623. void PremiumSystem();
  624. bool PremiumSystemTime();
  625.  
  626. public:
  627. bool IsPREMIUM() const { return m_afAffectFlag.IsSet(AFF_PREMIUM); }
  628. #endif
  629. void SetPlayerProto(const TPlayerTable * table);
  630. void CreatePlayerProto(TPlayerTable & tab);
  631.  
  632. void SetProto(const CMob * c_pkMob);
  633. WORD GetRaceNum() const;
  634.  
  635. void Save();
  636. void SaveReal();
  637. void FlushDelayedSaveItem();
  638.  
  639. #ifdef __CUSTOM_TITLE_SYSTEM__
  640. void UpdateTitle();
  641. const char * GetTitle();
  642. void SetTitle(const char* title);
  643. void SetTitleColor(int index, BYTE val);
  644. void SetTitleColors(const BYTE* colors);
  645. BYTE* GetTitleColors() const;
  646. BYTE GetTitleColor(int index);
  647.  
  648. void UpdateTitle2();
  649. const char * GetTitle2();
  650. void SetTitle2(const char* title2);
  651. void SetTitle2Color(int index, BYTE val);
  652. void SetTitle2Colors(const BYTE* colors2);
  653. BYTE* GetTitle2Colors() const;
  654. BYTE GetTitle2Color(int index);
  655. #endif
  656. const char * GetName() const;
  657. const VID & GetVID() const { return m_vid; }
  658.  
  659. void SetName(const std::string& name) { m_stName = name; }
  660.  
  661. void SetRace(BYTE race);
  662. bool ChangeSex();
  663.  
  664. DWORD GetAID() const;
  665. int GetChangeEmpireCount() const;
  666. void SetChangeEmpireCount();
  667. int ChangeEmpire(BYTE empire);
  668.  
  669. BYTE GetJob() const;
  670. BYTE GetCharType() const;
  671.  
  672. bool IsPC() const { return GetDesc() ? true : false; }
  673. bool IsNPC() const { return m_bCharType != CHAR_TYPE_PC; }
  674. bool IsMonster() const { return m_bCharType == CHAR_TYPE_MONSTER; }
  675. bool IsStone() const { return m_bCharType == CHAR_TYPE_STONE; }
  676. bool IsDoor() const { return m_bCharType == CHAR_TYPE_DOOR; }
  677. bool IsBuilding() const { return m_bCharType == CHAR_TYPE_BUILDING; }
  678. bool IsWarp() const { return m_bCharType == CHAR_TYPE_WARP; }
  679. bool IsGoto() const { return m_bCharType == CHAR_TYPE_GOTO; }
  680. // bool IsPet() const { return m_bCharType == CHAR_TYPE_PET; }
  681.  
  682. DWORD GetLastShoutPulse() const { return m_pointsInstant.dwLastShoutPulse; }
  683. void SetLastShoutPulse(DWORD pulse) { m_pointsInstant.dwLastShoutPulse = pulse; }
  684. int GetLevel() const { return m_points.level; }
  685. void SetLevel(BYTE level);
  686.  
  687. BYTE GetGMLevel() const;
  688. BOOL IsGM() const;
  689. void SetGMLevel();
  690.  
  691. #ifdef __INVENTORY_PROTECT_SYSTEM__
  692. void SendInventoryLock();
  693. void SendInventoryUnlock();
  694. void SendInventoryAsk(int state);
  695. void SetInventoryState();
  696. bool SetInventoryPassword(const char * password);
  697. bool GetInventoryPassword(const char * password);
  698. #endif
  699. DWORD GetExp() const { return m_points.exp; }
  700. void SetExp(DWORD exp) { m_points.exp = exp; }
  701. DWORD GetNextExp() const;
  702. LPCHARACTER DistributeExp();
  703. void DistributeHP(LPCHARACTER pkKiller);
  704. void DistributeSP(LPCHARACTER pkKiller, int iMethod=0);
  705.  
  706. void SetPosition(int pos);
  707. bool IsPosition(int pos) const { return m_pointsInstant.position == pos ? true : false; }
  708. int GetPosition() const { return m_pointsInstant.position; }
  709.  
  710. void SetPart(BYTE bPartPos, WORD wVal);
  711. WORD GetPart(BYTE bPartPos) const;
  712. WORD GetOriginalPart(BYTE bPartPos) const;
  713.  
  714. void SetHP(int hp) { m_points.hp = hp; }
  715. int GetHP() const { return m_points.hp; }
  716.  
  717. void SetSP(int sp) { m_points.sp = sp; }
  718. int GetSP() const { return m_points.sp; }
  719.  
  720. void SetStamina(int stamina) { m_points.stamina = stamina; }
  721. int GetStamina() const { return m_points.stamina; }
  722.  
  723. void SetMaxHP(int iVal) { m_pointsInstant.iMaxHP = iVal; }
  724. int GetMaxHP() const { return m_pointsInstant.iMaxHP; }
  725.  
  726. void SetMaxSP(int iVal) { m_pointsInstant.iMaxSP = iVal; }
  727. int GetMaxSP() const { return m_pointsInstant.iMaxSP; }
  728.  
  729. void SetMaxStamina(int iVal) { m_pointsInstant.iMaxStamina = iVal; }
  730. int GetMaxStamina() const { return m_pointsInstant.iMaxStamina; }
  731.  
  732. void SetRandomHP(int v) { m_points.iRandomHP = v; }
  733. void SetRandomSP(int v) { m_points.iRandomSP = v; }
  734.  
  735. int GetRandomHP() const { return m_points.iRandomHP; }
  736. int GetRandomSP() const { return m_points.iRandomSP; }
  737.  
  738. int GetHPPct() const;
  739.  
  740. void SetRealPoint(BYTE idx, int val);
  741. int GetRealPoint(BYTE idx) const;
  742.  
  743. void SetPoint(BYTE idx, long long val);
  744. long long GetPoint(BYTE idx) const;
  745. int GetLimitPoint(BYTE idx) const;
  746. int GetPolymorphPoint(BYTE idx) const;
  747.  
  748. const TMobTable & GetMobTable() const;
  749. BYTE GetMobRank() const;
  750. BYTE GetMobBattleType() const;
  751. BYTE GetMobSize() const;
  752. DWORD GetMobDamageMin() const;
  753. DWORD GetMobDamageMax() const;
  754. WORD GetMobAttackRange() const;
  755. DWORD GetMobDropItemVnum() const;
  756. float GetMobDamageMultiply() const;
  757.  
  758. bool IsBerserker() const;
  759. bool IsBerserk() const;
  760. void SetBerserk(bool mode);
  761.  
  762. bool IsStoneSkinner() const;
  763.  
  764. bool IsGodSpeeder() const;
  765. bool IsGodSpeed() const;
  766. void SetGodSpeed(bool mode);
  767.  
  768. bool IsDeathBlower() const;
  769. bool IsDeathBlow() const;
  770.  
  771. bool IsReviver() const;
  772. bool HasReviverInParty() const;
  773. bool IsRevive() const;
  774. void SetRevive(bool mode);
  775.  
  776. bool IsRaceFlag(DWORD dwBit) const;
  777. bool IsSummonMonster() const;
  778. DWORD GetSummonVnum() const;
  779.  
  780. DWORD GetPolymorphItemVnum() const;
  781. DWORD GetMonsterDrainSPPoint() const;
  782.  
  783. void MainCharacterPacket();
  784.  
  785. void ComputePoints();
  786. void ComputeBattlePoints();
  787. void PointChange(BYTE type, long long amount, bool bAmount = false, bool bBroadcast = false);
  788. void PointsPacket();
  789. void ApplyPoint(BYTE bApplyType, int iVal);
  790. void CheckMaximumPoints();
  791.  
  792. bool Show(long lMapIndex, long x, long y, long z = LONG_MAX, bool bShowSpawnMotion = false, bool bAggressive = false);
  793.  
  794. void Sitdown(int is_ground);
  795. void Standup();
  796.  
  797. void SetRotation(float fRot);
  798. void SetRotationToXY(long x, long y);
  799. float GetRotation() const { return m_pointsInstant.fRot; }
  800.  
  801. void MotionPacketEncode(BYTE motion, LPCHARACTER victim, struct packet_motion * packet);
  802. void Motion(BYTE motion, LPCHARACTER victim = NULL);
  803.  
  804. void ChatPacket(BYTE type, const char *format, ...);
  805. void MonsterChat(BYTE bMonsterChatType);
  806.  
  807. void ResetPoint(int iLv);
  808.  
  809. void SetBlockMode(BYTE bFlag);
  810. void SetBlockModeForce(BYTE bFlag);
  811. bool IsBlockMode(BYTE bFlag) const { return (m_pointsInstant.bBlockMode & bFlag)?true:false; }
  812.  
  813. bool IsPolymorphed() const { return m_dwPolymorphRace>0; }
  814. bool IsPolyMaintainStat() const { return m_bPolyMaintainStat; }
  815. void SetPolymorph(DWORD dwRaceNum, bool bMaintainStat = false);
  816. DWORD GetPolymorphVnum() const { return m_dwPolymorphRace; }
  817. int GetPolymorphPower() const;
  818.  
  819. void fishing();
  820. void fishing_take();
  821.  
  822. void mining(LPCHARACTER chLoad);
  823. void mining_cancel();
  824. void mining_take();
  825.  
  826. void ResetPlayTime(DWORD dwTimeRemain = 0);
  827.  
  828. void CreateFly(BYTE bType, LPCHARACTER pkVictim);
  829.  
  830. void ResetChatCounter();
  831. BYTE IncreaseChatCounter();
  832. BYTE GetChatCounter() const;
  833.  
  834. #ifdef __TITLE_SYSTEM__
  835. void EquipTitle(LPITEM item);
  836. void UnequipTitle(LPITEM item);
  837. void CheckTitle();
  838. void SetTitle(int iTitle, BYTE bValue);
  839. bool GetTitle(int iTitle);
  840. bool ChooseTitle(int iTitle);
  841. void pChooseTitle(int iTitle);
  842. int ChoosedTitle();
  843. #endif
  844.  
  845. protected:
  846. DWORD m_dwPolymorphRace;
  847. bool m_bPolyMaintainStat;
  848. DWORD m_dwLoginPlayTime;
  849. DWORD m_dwPlayerID;
  850. VID m_vid;
  851. std::string m_stName;
  852.  
  853. #ifdef __CUSTOM_TITLE_SYSTEM__
  854. std::string m_stTitle;
  855. BYTE m_bTitleColor[TITLE_COLOR_MAX_NUM];
  856.  
  857. std::string m_stTitle2;
  858. BYTE m_bTitle2Color[TITLE2_COLOR_MAX_NUM];
  859. #endif
  860. BYTE m_bCharType;
  861.  
  862. CHARACTER_POINT m_points;
  863. CHARACTER_POINT_INSTANT m_pointsInstant;
  864.  
  865. int m_iMoveCount;
  866. DWORD m_dwPlayStartTime;
  867. BYTE m_bAddChrState;
  868. bool m_bSkipSave;
  869. BYTE m_bChatCounter;
  870.  
  871. public:
  872. bool IsStateMove() const { return IsState((CState&)m_stateMove); }
  873. bool IsStateIdle() const { return IsState((CState&)m_stateIdle); }
  874. bool IsWalking() const { return m_bNowWalking || GetStamina()<=0; }
  875. void SetWalking(bool bWalkFlag) { m_bWalking=bWalkFlag; }
  876. void SetNowWalking(bool bWalkFlag);
  877. void ResetWalking() { SetNowWalking(m_bWalking); }
  878.  
  879. bool Goto(long x, long y);
  880. void Stop();
  881.  
  882. bool CanMove() const;
  883.  
  884. void SyncPacket();
  885. bool Sync(long x, long y);
  886. bool Move(long x, long y);
  887. void OnMove(bool bIsAttack = false);
  888. DWORD GetMotionMode() const;
  889. float GetMoveMotionSpeed() const;
  890. float GetMoveSpeed() const;
  891. void CalculateMoveDuration();
  892. void SendMovePacket(BYTE bFunc, BYTE bArg, DWORD x, DWORD y, DWORD dwDuration, DWORD dwTime=0, int iRot=-1);
  893. DWORD GetCurrentMoveDuration() const { return m_dwMoveDuration; }
  894. DWORD GetWalkStartTime() const { return m_dwWalkStartTime; }
  895. DWORD GetLastMoveTime() const { return m_dwLastMoveTime; }
  896. DWORD GetLastAttackTime() const { return m_dwLastAttackTime; }
  897.  
  898. void SetLastAttacked(DWORD time);
  899.  
  900. bool SetSyncOwner(LPCHARACTER ch, bool bRemoveFromList = true);
  901. bool IsSyncOwner(LPCHARACTER ch) const;
  902.  
  903. bool WarpSet(long x, long y, long lRealMapIndex = 0);
  904. void SetWarpLocation(long lMapIndex, long x, long y);
  905. void WarpEnd();
  906. const PIXEL_POSITION & GetWarpPosition() const { return m_posWarp; }
  907. bool WarpToPID(DWORD dwPID);
  908.  
  909. void SaveExitLocation();
  910. void ExitToSavedLocation();
  911.  
  912. void StartStaminaConsume();
  913. void StopStaminaConsume();
  914. bool IsStaminaConsume() const;
  915. bool IsStaminaHalfConsume() const;
  916.  
  917. void ResetStopTime();
  918. DWORD GetStopTime() const;
  919.  
  920. protected:
  921. void ClearSync();
  922.  
  923. float m_fSyncTime;
  924. LPCHARACTER m_pkChrSyncOwner;
  925. CHARACTER_LIST m_kLst_pkChrSyncOwned;
  926.  
  927. PIXEL_POSITION m_posDest;
  928. PIXEL_POSITION m_posStart;
  929. PIXEL_POSITION m_posWarp;
  930. long m_lWarpMapIndex;
  931.  
  932. PIXEL_POSITION m_posExit;
  933. long m_lExitMapIndex;
  934.  
  935. DWORD m_dwMoveStartTime;
  936. DWORD m_dwMoveDuration;
  937.  
  938. DWORD m_dwLastMoveTime;
  939. DWORD m_dwLastAttackTime;
  940. DWORD m_dwWalkStartTime;
  941. DWORD m_dwStopTime;
  942.  
  943. bool m_bWalking;
  944. bool m_bNowWalking;
  945. bool m_bStaminaConsume;
  946.  
  947. public:
  948. void SyncQuickslot(BYTE bType, BYTE bOldPos, BYTE bNewPos);
  949. bool GetQuickslot(BYTE pos, TQuickslot ** ppSlot);
  950. bool SetQuickslot(BYTE pos, TQuickslot & rSlot);
  951. bool DelQuickslot(BYTE pos);
  952. bool SwapQuickslot(BYTE a, BYTE b);
  953. void ChainQuickslotItem(LPITEM pItem, BYTE bType, BYTE bOldPos);
  954.  
  955. protected:
  956. TQuickslot m_quickslot[QUICKSLOT_MAX_NUM];
  957.  
  958. public:
  959. void StartAffectEvent();
  960. void ClearAffect(bool bSave=false);
  961. void ComputeAffect(CAffect * pkAff, bool bAdd);
  962. bool AddAffect(DWORD dwType, BYTE bApplyOn, long lApplyValue, DWORD dwFlag, long lDuration, long lSPCost, bool bOverride, bool IsCube = false);
  963. void RefreshAffect();
  964. bool RemoveAffect(DWORD dwType);
  965. bool IsAffectFlag(DWORD dwAff) const;
  966.  
  967. bool UpdateAffect();
  968. int ProcessAffect();
  969.  
  970. void LoadAffect(DWORD dwCount, TPacketAffectElement * pElements);
  971. void SaveAffect();
  972.  
  973. bool IsLoadedAffect() const { return m_bIsLoadedAffect; }
  974.  
  975. bool IsGoodAffect(BYTE bAffectType) const;
  976.  
  977. void RemoveGoodAffect();
  978. void RemoveBadAffect();
  979.  
  980. CAffect * FindAffect(DWORD dwType, BYTE bApply=APPLY_NONE) const;
  981. const std::list<CAffect *> & GetAffectContainer() const { return m_list_pkAffect; }
  982. bool RemoveAffect(CAffect * pkAff);
  983.  
  984. protected:
  985. bool m_bIsLoadedAffect;
  986. TAffectFlag m_afAffectFlag;
  987. std::list<CAffect *> m_list_pkAffect;
  988.  
  989. public:
  990. void SetParty(LPPARTY pkParty);
  991. LPPARTY GetParty() const { return m_pkParty; }
  992.  
  993. bool RequestToParty(LPCHARACTER leader);
  994. void DenyToParty(LPCHARACTER member);
  995. void AcceptToParty(LPCHARACTER member);
  996.  
  997. void PartyInvite(LPCHARACTER pchInvitee);
  998.  
  999. void PartyInviteAccept(LPCHARACTER pchInvitee);
  1000.  
  1001. void PartyInviteDeny(DWORD dwPID);
  1002.  
  1003. bool BuildUpdatePartyPacket(TPacketGCPartyUpdate & out);
  1004. int GetLeadershipSkillLevel() const;
  1005.  
  1006. bool CanSummon(int iLeaderShip);
  1007.  
  1008. void SetPartyRequestEvent(LPEVENT pkEvent) { m_pkPartyRequestEvent = pkEvent; }
  1009.  
  1010. protected:
  1011. void PartyJoin(LPCHARACTER pkLeader);
  1012.  
  1013. enum PartyJoinErrCode
  1014. {
  1015. PERR_NONE = 0,
  1016. PERR_SERVER,
  1017. PERR_DUNGEON,
  1018. PERR_OBSERVER,
  1019. PERR_LVBOUNDARY,
  1020. PERR_LOWLEVEL,
  1021. PERR_HILEVEL,
  1022. PERR_ALREADYJOIN,
  1023. PERR_PARTYISFULL,
  1024. PERR_SEPARATOR,
  1025. PERR_DIFFEMPIRE,
  1026. PERR_MAX
  1027. };
  1028.  
  1029. static PartyJoinErrCode IsPartyJoinableCondition(const LPCHARACTER pchLeader, const LPCHARACTER pchGuest);
  1030. static PartyJoinErrCode IsPartyJoinableMutableCondition(const LPCHARACTER pchLeader, const LPCHARACTER pchGuest);
  1031.  
  1032. LPPARTY m_pkParty;
  1033. DWORD m_dwLastDeadTime;
  1034. LPEVENT m_pkPartyRequestEvent;
  1035.  
  1036. typedef std::map< DWORD, LPEVENT > EventMap;
  1037. EventMap m_PartyInviteEventMap;
  1038.  
  1039. public:
  1040. void SetDungeon(LPDUNGEON pkDungeon);
  1041. LPDUNGEON GetDungeon() const { return m_pkDungeon; }
  1042. LPDUNGEON GetDungeonForce() const;
  1043.  
  1044. protected:
  1045. LPDUNGEON m_pkDungeon;
  1046. int m_iEventAttr;
  1047.  
  1048. public:
  1049. void SetGuild(CGuild * pGuild);
  1050. CGuild* GetGuild() const { return m_pGuild; }
  1051.  
  1052. void SetWarMap(CWarMap* pWarMap);
  1053. CWarMap* GetWarMap() const { return m_pWarMap; }
  1054.  
  1055. protected:
  1056. CGuild * m_pGuild;
  1057. DWORD m_dwUnderGuildWarInfoMessageTime;
  1058. CWarMap * m_pWarMap;
  1059.  
  1060. public:
  1061. bool CanHandleItem(bool bSkipRefineCheck = false, bool bSkipObserver = false); // 아이템 관련 행위를 할 수 있는가?
  1062.  
  1063. bool IsItemLoaded() const { return m_bItemLoaded; }
  1064. void SetItemLoaded() { m_bItemLoaded = true; }
  1065.  
  1066. void ClearItem();
  1067.  
  1068. #ifdef ENABLE_SORT_INVEN
  1069. void SortInven(BYTE option);
  1070. DWORD GetLastSortTime() const { return m_dwLastSortTime; }
  1071. void SetLastSortTime(DWORD time) { m_dwLastSortTime = time; }
  1072. #endif
  1073.  
  1074. #ifdef __HIGHLIGHT_SYSTEM__
  1075. void SetItem(TItemPos Cell, LPITEM item, bool isHighLight = false);
  1076. #else
  1077. void SetItem(TItemPos Cell, LPITEM item);
  1078. #endif
  1079.  
  1080. LPITEM GetItem(TItemPos Cell) const;
  1081. LPITEM GetInventoryItem(WORD wCell) const;
  1082. bool IsEmptyItemGrid(TItemPos Cell, BYTE size, int iExceptionCell = -1) const;
  1083.  
  1084. void SetWear(BYTE bCell, LPITEM item);
  1085. LPITEM GetWear(BYTE bCell) const;
  1086.  
  1087. void UseSilkBotary(void);
  1088.  
  1089. void UseSilkBotaryReal(const TPacketMyshopPricelistHeader* p);
  1090.  
  1091. bool UseItemEx(LPITEM item, TItemPos DestCell);
  1092. bool UseItem(TItemPos Cell, TItemPos DestCell = NPOS);
  1093.  
  1094. bool IsRefineThroughGuild() const;
  1095. CGuild * GetRefineGuild() const;
  1096. int ComputeRefineFee(int iCost, int iMultiply = 5) const;
  1097. void PayRefineFee(int iTotalMoney);
  1098. void SetRefineNPC(LPCHARACTER ch);
  1099.  
  1100. bool RefineItem(LPITEM pkItem, LPITEM pkTarget);
  1101. bool DropItem(TItemPos Cell, WORD bCount=0);
  1102.  
  1103. #ifdef ENABLE_DESTORY_ITEM
  1104. bool DestroyItem(TItemPos Cell);
  1105. #endif
  1106.  
  1107. bool GiveRecallItem(LPITEM item);
  1108. void ProcessRecallItem(LPITEM item);
  1109.  
  1110. // void PotionPacket(int iPotionType);
  1111. void EffectPacket(int enumEffectType);
  1112. void SpecificEffectPacket(const char filename[128]);
  1113.  
  1114. bool DoRefine(LPITEM item, bool bMoneyOnly = false);
  1115.  
  1116. bool DoRefineWithScroll(LPITEM item);
  1117. bool RefineInformation(BYTE bCell, BYTE bType, int iAdditionalCell = -1);
  1118.  
  1119. void SetRefineMode(int iAdditionalCell = -1);
  1120. void ClearRefineMode();
  1121.  
  1122. bool GiveItem(LPCHARACTER victim, TItemPos Cell);
  1123. bool CanReceiveItem(LPCHARACTER from, LPITEM item) const;
  1124. void ReceiveItem(LPCHARACTER from, LPITEM item);
  1125. bool GiveItemFromSpecialItemGroup(DWORD dwGroupNum, std::vector <DWORD> &dwItemVnums, std::vector <DWORD> &dwItemCounts, std::vector <LPITEM> &item_gets, int &count);
  1126.  
  1127. bool MoveItem(TItemPos pos, TItemPos change_pos, WORD num);
  1128. bool PickupItem(DWORD vid);
  1129. bool EquipItem(LPITEM item, int iCandidateCell = -1);
  1130. bool UnequipItem(LPITEM item);
  1131.  
  1132. bool CanEquipNow(const LPITEM item, const TItemPos& srcCell = NPOS, const TItemPos& destCell = NPOS);
  1133.  
  1134. bool CanUnequipNow(const LPITEM item, const TItemPos& srcCell = NPOS, const TItemPos& destCell = NPOS);
  1135.  
  1136. bool SwapItem(BYTE bCell, BYTE bDestCell);
  1137. LPITEM AutoGiveItem(DWORD dwItemVnum, WORD bCount=1, int iRarePct = -1, bool bMsg = true);
  1138. void AutoGiveItem(LPITEM item, bool longOwnerShip = false);
  1139.  
  1140. int GetEmptyInventory(BYTE size) const;
  1141. int GetEmptyDragonSoulInventory(LPITEM pItem) const;
  1142. void CopyDragonSoulItemGrid(std::vector<WORD>& vDragonSoulItemGrid) const;
  1143.  
  1144. int CountEmptyInventory() const;
  1145.  
  1146. int CountSpecifyItem(DWORD vnum) const;
  1147. void RemoveSpecifyItem(DWORD vnum, DWORD count = 1);
  1148. LPITEM FindSpecifyItem(DWORD vnum) const;
  1149. LPITEM FindItemByID(DWORD id) const;
  1150.  
  1151. int CountSpecifyTypeItem(BYTE type) const;
  1152. void RemoveSpecifyTypeItem(BYTE type, DWORD count = 1);
  1153.  
  1154. bool IsEquipUniqueItem(DWORD dwItemVnum) const;
  1155.  
  1156. bool IsEquipUniqueGroup(DWORD dwGroupVnum) const;
  1157.  
  1158. void SendEquipment(LPCHARACTER ch);
  1159.  
  1160. #ifdef SET_LEVEL_FIRST_LOGIN
  1161. void FirstLogin();
  1162. #endif
  1163.  
  1164. protected:
  1165. void SendMyShopPriceListCmd(DWORD dwItemVnum, long long dwItemPrice);
  1166.  
  1167. bool m_bNoOpenedShop;
  1168.  
  1169. bool m_bItemLoaded;
  1170. int m_iRefineAdditionalCell;
  1171. bool m_bUnderRefine;
  1172. DWORD m_dwRefineNPCVID;
  1173.  
  1174. public:
  1175.  
  1176. long long GetGold() const { return m_points.gold; }
  1177. void SetGold(long long gold) { m_points.gold = gold; }
  1178. bool DropGold(INT gold);
  1179. long long GetAllowedGold() const;
  1180. void GiveGold(long long iAmount);
  1181.  
  1182. public:
  1183. void SetShop(LPSHOP pkShop);
  1184. LPSHOP GetShop() const { return m_pkShop; }
  1185. void ShopPacket(BYTE bSubHeader);
  1186.  
  1187. void SetShopOwner(LPCHARACTER ch) { m_pkChrShopOwner = ch; }
  1188. LPCHARACTER GetShopOwner() const { return m_pkChrShopOwner;}
  1189.  
  1190. void OpenMyShop(const char * c_pszSign, TShopItemTable * pTable, BYTE bItemCount);
  1191. LPSHOP GetMyShop() const { return m_pkMyShop; }
  1192. void CloseMyShop();
  1193.  
  1194. protected:
  1195.  
  1196. LPSHOP m_pkShop;
  1197. LPSHOP m_pkMyShop;
  1198. std::string m_stShopSign;
  1199. LPCHARACTER m_pkChrShopOwner;
  1200.  
  1201. public:
  1202. bool ExchangeStart(LPCHARACTER victim, BYTE dice);
  1203. void SetExchange(CExchange * pkExchange);
  1204. CExchange * GetExchange() const { return m_pkExchange; }
  1205.  
  1206. protected:
  1207. CExchange * m_pkExchange;
  1208.  
  1209. public:
  1210. struct TBattleInfo
  1211. {
  1212. int iTotalDamage;
  1213. int iAggro;
  1214.  
  1215. TBattleInfo(int iTot, int iAggr)
  1216. : iTotalDamage(iTot), iAggro(iAggr)
  1217. {}
  1218. };
  1219. typedef std::map<VID, TBattleInfo> TDamageMap;
  1220.  
  1221. typedef struct SAttackLog
  1222. {
  1223. DWORD dwVID;
  1224. DWORD dwTime;
  1225. } AttackLog;
  1226.  
  1227. bool Damage(LPCHARACTER pAttacker, int dam, EDamageType type = DAMAGE_TYPE_NORMAL);
  1228. bool __Profile__Damage(LPCHARACTER pAttacker, int dam, EDamageType type = DAMAGE_TYPE_NORMAL);
  1229. void DeathPenalty(BYTE bExpLossPercent);
  1230. void ReviveInvisible(int iDur);
  1231.  
  1232. bool Attack(LPCHARACTER pkVictim, BYTE bType = 0);
  1233. bool IsAlive() const { return m_pointsInstant.position == POS_DEAD ? false : true; }
  1234. bool CanFight() const;
  1235.  
  1236. bool CanBeginFight() const;
  1237. void BeginFight(LPCHARACTER pkVictim);
  1238.  
  1239. bool CounterAttack(LPCHARACTER pkChr);
  1240.  
  1241. bool IsStun() const;
  1242. void Stun();
  1243. bool IsDead() const;
  1244. void Dead(LPCHARACTER pkKiller = NULL, bool bImmediateDead=false);
  1245.  
  1246. void Reward(bool bItemDrop);
  1247. void RewardGold(LPCHARACTER pkAttacker);
  1248.  
  1249. bool Shoot(BYTE bType);
  1250. void FlyTarget(DWORD dwTargetVID, long x, long y, BYTE bHeader);
  1251.  
  1252. void ForgetMyAttacker();
  1253. void AggregateMonster();
  1254. void AttractRanger();
  1255. void PullMonster();
  1256.  
  1257. int GetArrowAndBow(LPITEM * ppkBow, LPITEM * ppkArrow, int iArrowCount = 1);
  1258. void UseArrow(LPITEM pkArrow, DWORD dwArrowCount);
  1259.  
  1260. void AttackedByPoison(LPCHARACTER pkAttacker);
  1261. void RemovePoison();
  1262.  
  1263. void AttackedByFire(LPCHARACTER pkAttacker, int amount, int count);
  1264. void RemoveFire();
  1265.  
  1266. void UpdateAlignment(int iAmount);
  1267. int GetAlignment() const;
  1268.  
  1269. int GetRealAlignment() const;
  1270. void ShowAlignment(bool bShow);
  1271.  
  1272. void SetKillerMode(bool bOn);
  1273. bool IsKillerMode() const;
  1274. void UpdateKillerMode();
  1275.  
  1276. BYTE GetPKMode() const;
  1277. void SetPKMode(BYTE bPKMode);
  1278.  
  1279. void ItemDropPenalty(LPCHARACTER pkKiller);
  1280.  
  1281. void UpdateAggrPoint(LPCHARACTER ch, EDamageType type, int dam);
  1282.  
  1283. public:
  1284. void SetComboSequence(BYTE seq);
  1285. BYTE GetComboSequence() const;
  1286.  
  1287. void SetLastComboTime(DWORD time);
  1288. DWORD GetLastComboTime() const;
  1289.  
  1290. int GetValidComboInterval() const;
  1291. void SetValidComboInterval(int interval);
  1292.  
  1293. BYTE GetComboIndex() const;
  1294.  
  1295. void IncreaseComboHackCount(int k = 1);
  1296. void ResetComboHackCount();
  1297. void SkipComboAttackByTime(int interval);
  1298. DWORD GetSkipComboAttackByTime() const;
  1299.  
  1300. protected:
  1301. BYTE m_bComboSequence;
  1302. DWORD m_dwLastComboTime;
  1303. int m_iValidComboInterval;
  1304. BYTE m_bComboIndex;
  1305. int m_iComboHackCount;
  1306. DWORD m_dwSkipComboAttackByTime;
  1307.  
  1308. protected:
  1309. void UpdateAggrPointEx(LPCHARACTER ch, EDamageType type, int dam, TBattleInfo & info);
  1310. void ChangeVictimByAggro(int iNewAggro, LPCHARACTER pNewVictim);
  1311.  
  1312. DWORD m_dwFlyTargetID;
  1313. std::vector<DWORD> m_vec_dwFlyTargets;
  1314. TDamageMap m_map_kDamage;
  1315. // AttackLog m_kAttackLog;
  1316. DWORD m_dwKillerPID;
  1317.  
  1318. int m_iAlignment;
  1319. int m_iRealAlignment;
  1320. int m_iKillerModePulse;
  1321. BYTE m_bPKMode;
  1322.  
  1323. DWORD m_dwLastVictimSetTime;
  1324. int m_iMaxAggro;
  1325.  
  1326. public:
  1327. void SetStone(LPCHARACTER pkChrStone);
  1328. void ClearStone();
  1329. void DetermineDropMetinStone();
  1330. DWORD GetDropMetinStoneVnum() const { return m_dwDropMetinStone; }
  1331. BYTE GetDropMetinStonePct() const { return m_bDropMetinStonePct; }
  1332.  
  1333. protected:
  1334. LPCHARACTER m_pkChrStone;
  1335. CHARACTER_SET m_set_pkChrSpawnedBy;
  1336. DWORD m_dwDropMetinStone;
  1337. BYTE m_bDropMetinStonePct;
  1338.  
  1339. public:
  1340. enum
  1341. {
  1342. SKILL_UP_BY_POINT,
  1343. SKILL_UP_BY_BOOK,
  1344. SKILL_UP_BY_TRAIN,
  1345. SKILL_UP_BY_QUEST,
  1346. };
  1347.  
  1348. void SkillLevelPacket();
  1349. void SkillLevelUp(DWORD dwVnum, BYTE bMethod = SKILL_UP_BY_POINT);
  1350. bool SkillLevelDown(DWORD dwVnum);
  1351.  
  1352. bool UseSkill(DWORD dwVnum, LPCHARACTER pkVictim, bool bUseGrandMaster = true);
  1353. void ResetSkill();
  1354. void SetSkillLevel(DWORD dwVnum, BYTE bLev);
  1355. int GetUsedSkillMasterType(DWORD dwVnum);
  1356.  
  1357. bool IsLearnableSkill(DWORD dwSkillVnum) const;
  1358.  
  1359. bool CheckSkillHitCount(const BYTE SkillID, const VID dwTargetVID);
  1360. bool CanUseSkill(DWORD dwSkillVnum) const;
  1361. bool IsUsableSkillMotion(DWORD dwMotionIndex) const;
  1362. int GetSkillLevel(DWORD dwVnum) const;
  1363. int GetSkillMasterType(DWORD dwVnum) const;
  1364. int GetSkillPower(DWORD dwVnum, BYTE bLevel = 0) const;
  1365.  
  1366. time_t GetSkillNextReadTime(DWORD dwVnum) const;
  1367. void SetSkillNextReadTime(DWORD dwVnum, time_t time);
  1368. void SkillLearnWaitMoreTimeMessage(DWORD dwVnum);
  1369.  
  1370. void ComputePassiveSkill(DWORD dwVnum);
  1371. int ComputeSkill(DWORD dwVnum, LPCHARACTER pkVictim, BYTE bSkillLevel = 0);
  1372. int ComputeSkillAtPosition(DWORD dwVnum, const PIXEL_POSITION& posTarget, BYTE bSkillLevel = 0);
  1373. void ComputeSkillPoints();
  1374.  
  1375. void SetSkillGroup(BYTE bSkillGroup);
  1376. BYTE GetSkillGroup() const { return m_points.skill_group; }
  1377.  
  1378. int ComputeCooltime(int time);
  1379.  
  1380. void GiveRandomSkillBook();
  1381.  
  1382. void DisableCooltime();
  1383. bool LearnSkillByBook(DWORD dwSkillVnum, BYTE bProb = 0);
  1384. bool LearnGrandMasterSkill(DWORD dwSkillVnum);
  1385.  
  1386. private:
  1387. bool m_bDisableCooltime;
  1388. DWORD m_dwLastSkillTime;
  1389.  
  1390. #ifdef ENABLE_SORT_INVEN
  1391. DWORD m_dwLastSortTime;
  1392. #endif
  1393.  
  1394.  
  1395. public:
  1396. bool HasMobSkill() const;
  1397. size_t CountMobSkill() const;
  1398. const TMobSkillInfo * GetMobSkill(unsigned int idx) const;
  1399. bool CanUseMobSkill(unsigned int idx) const;
  1400. bool UseMobSkill(unsigned int idx);
  1401. void ResetMobSkillCooltime();
  1402.  
  1403. protected:
  1404. DWORD m_adwMobSkillCooltime[MOB_SKILL_MAX_NUM];
  1405.  
  1406. public:
  1407. void StartMuyeongEvent();
  1408. void StopMuyeongEvent();
  1409.  
  1410. private:
  1411. LPEVENT m_pkMuyeongEvent;
  1412.  
  1413. public:
  1414. int GetChainLightningIndex() const { return m_iChainLightingIndex; }
  1415. void IncChainLightningIndex() { ++m_iChainLightingIndex; }
  1416. void AddChainLightningExcept(LPCHARACTER ch) { m_setExceptChainLighting.insert(ch); }
  1417. void ResetChainLightningIndex() { m_iChainLightingIndex = 0; m_setExceptChainLighting.clear(); }
  1418. int GetChainLightningMaxCount() const;
  1419. const CHARACTER_SET& GetChainLightingExcept() const { return m_setExceptChainLighting; }
  1420.  
  1421. private:
  1422. int m_iChainLightingIndex;
  1423. CHARACTER_SET m_setExceptChainLighting;
  1424.  
  1425. public:
  1426. void SetAffectedEunhyung();
  1427. void ClearAffectedEunhyung() { m_dwAffectedEunhyungLevel = 0; }
  1428. bool GetAffectedEunhyung() const { return m_dwAffectedEunhyungLevel; }
  1429.  
  1430. private:
  1431. DWORD m_dwAffectedEunhyungLevel;
  1432.  
  1433. protected:
  1434. TPlayerSkill* m_pSkillLevels;
  1435. boost::unordered_map<BYTE, int> m_SkillDamageBonus;
  1436. std::map<int, TSkillUseInfo> m_SkillUseInfo;
  1437.  
  1438. public:
  1439. void AssignTriggers(const TMobTable * table);
  1440. LPCHARACTER GetVictim() const;
  1441.  
  1442. void SetVictim(LPCHARACTER pkVictim);
  1443.  
  1444. LPCHARACTER GetNearestVictim(LPCHARACTER pkChr);
  1445. LPCHARACTER GetProtege() const;
  1446.  
  1447. bool Follow(LPCHARACTER pkChr, float fMinimumDistance = 150.0f);
  1448. bool Return();
  1449. bool IsGuardNPC() const;
  1450. bool IsChangeAttackPosition(LPCHARACTER target) const;
  1451. void ResetChangeAttackPositionTime() { m_dwLastChangeAttackPositionTime = get_dword_time() - AI_CHANGE_ATTACK_POISITION_TIME_NEAR;}
  1452. void SetChangeAttackPositionTime() { m_dwLastChangeAttackPositionTime = get_dword_time();}
  1453.  
  1454. bool OnIdle();
  1455.  
  1456. void OnAttack(LPCHARACTER pkChrAttacker);
  1457. void OnClick(LPCHARACTER pkChrCauser);
  1458.  
  1459. VID m_kVIDVictim;
  1460.  
  1461. protected:
  1462. DWORD m_dwLastChangeAttackPositionTime;
  1463. CTrigger m_triggerOnClick;
  1464.  
  1465. protected:
  1466. LPCHARACTER m_pkChrTarget;
  1467. CHARACTER_SET m_set_pkChrTargetedBy;
  1468.  
  1469. public:
  1470. void SetTarget(LPCHARACTER pkChrTarget);
  1471. void BroadcastTargetPacket();
  1472. void ClearTarget();
  1473. void CheckTarget();
  1474. LPCHARACTER GetTarget() const { return m_pkChrTarget; }
  1475.  
  1476. public:
  1477. int GetSafeboxSize() const;
  1478. void QuerySafeboxSize();
  1479. void SetSafeboxSize(int size);
  1480.  
  1481. CSafebox * GetSafebox() const;
  1482. void LoadSafebox(int iSize, DWORD dwGold, int iItemCount, TPlayerItem * pItems);
  1483. void ChangeSafeboxSize(BYTE bSize);
  1484. void CloseSafebox();
  1485.  
  1486. void ReqSafeboxLoad(const char* pszPassword);
  1487.  
  1488. void CancelSafeboxLoad( void ) { m_bOpeningSafebox = false; }
  1489.  
  1490. void SetMallLoadTime(int t) { m_iMallLoadTime = t; }
  1491. int GetMallLoadTime() const { return m_iMallLoadTime; }
  1492.  
  1493. CSafebox * GetMall() const;
  1494. void LoadMall(int iItemCount, TPlayerItem * pItems);
  1495. void CloseMall();
  1496.  
  1497. void SetSafeboxOpenPosition();
  1498. float GetDistanceFromSafeboxOpen() const;
  1499.  
  1500. protected:
  1501. CSafebox * m_pkSafebox;
  1502. int m_iSafeboxSize;
  1503. int m_iSafeboxLoadTime;
  1504. bool m_bOpeningSafebox;
  1505.  
  1506. CSafebox * m_pkMall;
  1507. int m_iMallLoadTime;
  1508.  
  1509. PIXEL_POSITION m_posSafeboxOpen;
  1510.  
  1511. public:
  1512. void MountVnum(DWORD vnum);
  1513. DWORD GetMountVnum() const { return m_dwMountVnum; }
  1514. DWORD GetLastMountTime() const { return m_dwMountTime; }
  1515.  
  1516. bool CanUseHorseSkill();
  1517.  
  1518. virtual void SetHorseLevel(int iLevel);
  1519.  
  1520. virtual bool StartRiding();
  1521. virtual bool StopRiding();
  1522.  
  1523. virtual DWORD GetMyHorseVnum() const;
  1524.  
  1525. virtual void HorseDie();
  1526. virtual bool ReviveHorse();
  1527.  
  1528. virtual void SendHorseInfo();
  1529. virtual void ClearHorseInfo();
  1530.  
  1531. void HorseSummon(bool bSummon, bool bFromFar = false, DWORD dwVnum = 0, const char* name = 0);
  1532.  
  1533. LPCHARACTER GetHorse() const { return m_chHorse; }
  1534. LPCHARACTER GetRider() const;
  1535. void SetRider(LPCHARACTER ch);
  1536.  
  1537. bool IsRiding() const;
  1538.  
  1539. #ifdef __PET_SYSTEM__
  1540. public:
  1541. CPetSystem* GetPetSystem() { return m_petSystem; }
  1542. void PetSummon(LPITEM petItem);
  1543. void PetUnsummon(LPITEM petItem);
  1544. void CheckPet();
  1545. bool IsPetSummon();
  1546.  
  1547. protected:
  1548. CPetSystem* m_petSystem;
  1549.  
  1550. public:
  1551. #endif
  1552.  
  1553. protected:
  1554. LPCHARACTER m_chHorse;
  1555. LPCHARACTER m_chRider;
  1556.  
  1557. DWORD m_dwMountVnum;
  1558. DWORD m_dwMountTime;
  1559.  
  1560. BYTE m_bSendHorseLevel;
  1561. BYTE m_bSendHorseHealthGrade;
  1562. BYTE m_bSendHorseStaminaGrade;
  1563.  
  1564. public:
  1565. void DetailLog() { m_bDetailLog = !m_bDetailLog; }
  1566. void ToggleMonsterLog();
  1567. void MonsterLog(const char* format, ...);
  1568.  
  1569. private:
  1570. bool m_bDetailLog;
  1571. bool m_bMonsterLog;
  1572.  
  1573. public:
  1574. void SetEmpire(BYTE bEmpire);
  1575. BYTE GetEmpire() const { return m_bEmpire; }
  1576.  
  1577. protected:
  1578. BYTE m_bEmpire;
  1579.  
  1580. public:
  1581. void SetRegen(LPREGEN pkRegen);
  1582.  
  1583. protected:
  1584. PIXEL_POSITION m_posRegen;
  1585. float m_fRegenAngle;
  1586. LPREGEN m_pkRegen;
  1587. size_t regen_id_;
  1588.  
  1589. public:
  1590. bool CannotMoveByAffect() const;
  1591. bool IsImmune(DWORD dwImmuneFlag);
  1592. void SetImmuneFlag(DWORD dw) { m_pointsInstant.dwImmuneFlag = dw; }
  1593.  
  1594. protected:
  1595. void ApplyMobAttribute(const TMobTable* table);
  1596.  
  1597. public:
  1598. void SetQuestNPCID(DWORD vid);
  1599. DWORD GetQuestNPCID() const { return m_dwQuestNPCVID; }
  1600. LPCHARACTER GetQuestNPC() const;
  1601.  
  1602. void SetQuestItemPtr(LPITEM item);
  1603. void ClearQuestItemPtr();
  1604. LPITEM GetQuestItemPtr() const;
  1605.  
  1606. void SetQuestBy(DWORD dwQuestVnum) { m_dwQuestByVnum = dwQuestVnum; }
  1607. DWORD GetQuestBy() const { return m_dwQuestByVnum; }
  1608.  
  1609. int GetQuestFlag(const std::string& flag) const;
  1610. void SetQuestFlag(const std::string& flag, int value);
  1611.  
  1612. void ConfirmWithMsg(const char* szMsg, int iTimeout, DWORD dwRequestPID);
  1613.  
  1614. private:
  1615. DWORD m_dwQuestNPCVID;
  1616. DWORD m_dwQuestByVnum;
  1617. LPITEM m_pQuestItem;
  1618.  
  1619. public:
  1620. bool StartStateMachine(int iPulse = 1);
  1621. void StopStateMachine();
  1622. void UpdateStateMachine(DWORD dwPulse);
  1623. void SetNextStatePulse(int iPulseNext);
  1624.  
  1625. void UpdateCharacter(DWORD dwPulse);
  1626.  
  1627. protected:
  1628. DWORD m_dwNextStatePulse;
  1629.  
  1630. public:
  1631. LPCHARACTER GetMarryPartner() const;
  1632. void SetMarryPartner(LPCHARACTER ch);
  1633. int GetMarriageBonus(DWORD dwItemVnum, bool bSum = true);
  1634.  
  1635. void SetWeddingMap(marriage::WeddingMap* pMap);
  1636. marriage::WeddingMap* GetWeddingMap() const { return m_pWeddingMap; }
  1637.  
  1638. private:
  1639. marriage::WeddingMap* m_pWeddingMap;
  1640. LPCHARACTER m_pkChrMarried;
  1641.  
  1642. public:
  1643. void StartWarpNPCEvent();
  1644.  
  1645. public:
  1646. void StartSaveEvent();
  1647. void StartRecoveryEvent();
  1648. void StartCheckSpeedHackEvent();
  1649. void StartDestroyWhenIdleEvent();
  1650.  
  1651. LPEVENT m_pkDeadEvent;
  1652. LPEVENT m_pkStunEvent;
  1653. LPEVENT m_pkSaveEvent;
  1654. LPEVENT m_pkRecoveryEvent;
  1655. LPEVENT m_pkTimedEvent;
  1656. LPEVENT m_pkFishingEvent;
  1657. LPEVENT m_pkAffectEvent;
  1658. LPEVENT m_pkPoisonEvent;
  1659. LPEVENT m_pkFireEvent;
  1660. LPEVENT m_pkWarpNPCEvent;
  1661. LPEVENT m_pkMiningEvent;
  1662. LPEVENT m_pkWarpEvent;
  1663. LPEVENT m_pkCheckSpeedHackEvent;
  1664. LPEVENT m_pkDestroyWhenIdleEvent;
  1665. LPEVENT m_pkPetSystemUpdateEvent;
  1666.  
  1667. bool IsWarping() const { return m_pkWarpEvent ? true : false; }
  1668.  
  1669. bool m_bHasPoisoned;
  1670.  
  1671. const CMob * m_pkMobData;
  1672. CMobInstance * m_pkMobInst;
  1673.  
  1674. std::map<int, LPEVENT> m_mapMobSkillEvent;
  1675.  
  1676. friend struct FuncSplashDamage;
  1677. friend struct FuncSplashAffect;
  1678. friend class CFuncShoot;
  1679.  
  1680. public:
  1681. int GetPremiumRemainSeconds(BYTE bType) const;
  1682.  
  1683. private:
  1684. int m_aiPremiumTimes[PREMIUM_MAX_NUM];
  1685.  
  1686. static const DWORD msc_dwDefaultChangeItemAttrCycle;
  1687. static const char msc_szLastChangeItemAttrFlag[];
  1688. static const char msc_szChangeItemAttrCycleFlag[];
  1689.  
  1690. public :
  1691. bool ItemProcess_Hair(LPITEM item, int iDestCell);
  1692.  
  1693. public :
  1694. void ClearSkill();
  1695. void ClearSubSkill();
  1696.  
  1697. bool ResetOneSkill(DWORD dwVnum);
  1698.  
  1699. private :
  1700. void SendDamagePacket(LPCHARACTER pAttacker, int Damage, BYTE DamageFlag);
  1701.  
  1702.  
  1703. private :
  1704. CArena *m_pArena;
  1705. bool m_ArenaObserver;
  1706. int m_nPotionLimit;
  1707.  
  1708. public :
  1709. void SetArena(CArena* pArena) { m_pArena = pArena; }
  1710. void SetArenaObserverMode(bool flag) { m_ArenaObserver = flag; }
  1711.  
  1712. CArena* GetArena() const { return m_pArena; }
  1713. bool GetArenaObserverMode() const { return m_ArenaObserver; }
  1714.  
  1715. void SetPotionLimit(int count) { m_nPotionLimit = count; }
  1716. int GetPotionLimit() const { return m_nPotionLimit; }
  1717.  
  1718. public:
  1719. bool IsOpenSafebox() const { return m_isOpenSafebox ? true : false; }
  1720. void SetOpenSafebox(bool b) { m_isOpenSafebox = b; }
  1721.  
  1722. int GetSafeboxLoadTime() const { return m_iSafeboxLoadTime; }
  1723. void SetSafeboxLoadTime() { m_iSafeboxLoadTime = thecore_pulse(); }
  1724.  
  1725. private:
  1726. bool m_isOpenSafebox;
  1727.  
  1728. public:
  1729. int GetSkillPowerByLevel(int level, bool bMob = false) const;
  1730.  
  1731. int GetRefineTime() const { return m_iRefineTime; }
  1732. void SetRefineTime() { m_iRefineTime = thecore_pulse(); }
  1733. int m_iRefineTime;
  1734.  
  1735. int GetUseSeedOrMoonBottleTime() const { return m_iSeedTime; }
  1736. void SetUseSeedOrMoonBottleTime() { m_iSeedTime = thecore_pulse(); }
  1737. int m_iSeedTime;
  1738.  
  1739. int GetExchangeTime() const { return m_iExchangeTime; }
  1740. void SetExchangeTime() { m_iExchangeTime = thecore_pulse(); }
  1741. int m_iExchangeTime;
  1742.  
  1743. int m_iMyShopTime;
  1744. int GetMyShopTime() const { return m_iMyShopTime; }
  1745. void SetMyShopTime() { m_iMyShopTime = thecore_pulse(); }
  1746.  
  1747. bool IsHack(bool bSendMsg = true, bool bCheckShopOwner = true, int limittime = g_nPortalLimitTime);
  1748.  
  1749. void Say(const std::string & s);
  1750.  
  1751. public:
  1752. bool ItemProcess_Polymorph(LPITEM item);
  1753.  
  1754. LPITEM* GetCubeItem() { return m_pointsInstant.pCubeItems; }
  1755.  
  1756. bool IsCubeOpen () const { return (m_pointsInstant.pCubeNpc?true:false); }
  1757. void SetCubeNpc(LPCHARACTER npc) { m_pointsInstant.pCubeNpc = npc; }
  1758. bool CanDoCube() const;
  1759.  
  1760. public:
  1761. bool IsSiegeNPC() const;
  1762.  
  1763. private:
  1764. e_overtime m_eOverTime;
  1765.  
  1766. public:
  1767. bool IsOverTime(e_overtime e) const { return (e == m_eOverTime); }
  1768. void SetOverTime(e_overtime e) { m_eOverTime = e; }
  1769.  
  1770. private:
  1771. int m_deposit_pulse;
  1772.  
  1773. public:
  1774. void UpdateDepositPulse();
  1775. bool CanDeposit() const;
  1776.  
  1777. private:
  1778. void __OpenPrivateShop();
  1779.  
  1780. public:
  1781. struct AttackedLog
  1782. {
  1783. DWORD dwPID;
  1784. DWORD dwAttackedTime;
  1785.  
  1786. AttackedLog() : dwPID(0), dwAttackedTime(0)
  1787. {
  1788. }
  1789. };
  1790.  
  1791. AttackLog m_kAttackLog;
  1792. AttackedLog m_AttackedLog;
  1793. int m_speed_hack_count;
  1794.  
  1795. private :
  1796. std::string m_strNewName;
  1797.  
  1798. public :
  1799. const std::string GetNewName() const { return this->m_strNewName; }
  1800. void SetNewName(const std::string name) { this->m_strNewName = name; }
  1801.  
  1802. public :
  1803. void GoHome();
  1804.  
  1805. private :
  1806. std::set<DWORD> m_known_guild;
  1807.  
  1808. public :
  1809. void SendGuildName(CGuild* pGuild);
  1810. void SendGuildName(DWORD dwGuildID);
  1811.  
  1812. private :
  1813. DWORD m_dwLogOffInterval;
  1814.  
  1815. public :
  1816. DWORD GetLogOffInterval() const { return m_dwLogOffInterval; }
  1817.  
  1818. public:
  1819. bool UnEquipSpecialRideUniqueItem ();
  1820.  
  1821. bool CanWarp () const;
  1822.  
  1823. private:
  1824. DWORD m_dwLastGoldDropTime;
  1825.  
  1826. public:
  1827. void AutoRecoveryItemProcess (const EAffectTypes);
  1828.  
  1829. public:
  1830. void BuffOnAttr_AddBuffsFromItem(LPITEM pItem);
  1831. void BuffOnAttr_RemoveBuffsFromItem(LPITEM pItem);
  1832.  
  1833. private:
  1834. void BuffOnAttr_ValueChange(BYTE bType, BYTE bOldValue, BYTE bNewValue);
  1835. void BuffOnAttr_ClearAll();
  1836.  
  1837. typedef std::map <BYTE, CBuffOnAttributes*> TMapBuffOnAttrs;
  1838. TMapBuffOnAttrs m_map_buff_on_attrs;
  1839.  
  1840. public:
  1841. void SetArmada() { cannot_dead = true; }
  1842. void ResetArmada() { cannot_dead = false; }
  1843.  
  1844. private:
  1845. bool cannot_dead;
  1846.  
  1847. #ifdef __PET_SYSTEM__
  1848. private:
  1849. bool m_bIsPet;
  1850.  
  1851. public:
  1852. void SetPet() { m_bIsPet = true; }
  1853. bool IsPet() { return m_bIsPet; }
  1854. #endif
  1855.  
  1856. private:
  1857. float m_fAttMul;
  1858. float m_fDamMul;
  1859.  
  1860. public:
  1861. float GetAttMul() { return this->m_fAttMul; }
  1862. void SetAttMul(float newAttMul) {this->m_fAttMul = newAttMul; }
  1863. float GetDamMul() { return this->m_fDamMul; }
  1864. void SetDamMul(float newDamMul) {this->m_fDamMul = newDamMul; }
  1865.  
  1866. private:
  1867. bool IsValidItemPosition(TItemPos Pos) const;
  1868.  
  1869. private:
  1870. unsigned int itemAward_vnum;
  1871. char itemAward_cmd[20];
  1872. //bool itemAward_flag;
  1873.  
  1874. public:
  1875. unsigned int GetItemAward_vnum() { return itemAward_vnum; }
  1876. char* GetItemAward_cmd() { return itemAward_cmd; }
  1877. //bool GetItemAward_flag() { return itemAward_flag; }
  1878. void SetItemAward_vnum(unsigned int vnum) { itemAward_vnum = vnum; }
  1879. void SetItemAward_cmd(char* cmd) { strcpy(itemAward_cmd,cmd); }
  1880. //void SetItemAward_flag(bool flag) { itemAward_flag = flag; }
  1881.  
  1882. public:
  1883. void DragonSoul_Initialize();
  1884.  
  1885. bool DragonSoul_IsQualified() const;
  1886. void DragonSoul_GiveQualification();
  1887.  
  1888. int DragonSoul_GetActiveDeck() const;
  1889. bool DragonSoul_IsDeckActivated() const;
  1890. bool DragonSoul_ActivateDeck(int deck_idx);
  1891.  
  1892. void DragonSoul_DeactivateAll();
  1893.  
  1894. void DragonSoul_CleanUp();
  1895.  
  1896. public:
  1897. void RefreshBonusDuel();
  1898. void SetDuel(const char* type, int value);
  1899. void DestroyPvP();
  1900.  
  1901. #ifdef SKILL_SELECT_RENEWALL
  1902. public:
  1903. void SelectSkillGroupWithWindow(BYTE group);
  1904. #endif
  1905.  
  1906. #ifdef ENABLE_HIDE_COSTUME_SYSTEM
  1907. public:
  1908. void FuncHideCostume(int slot);
  1909. void FuncHideCostumeLoad();
  1910.  
  1911. int GetHideCostume(int wear) const ;
  1912.  
  1913. void SetHideCostumeUpdate();
  1914.  
  1915. int GetSlotsCostume();
  1916. int GetSlotDefault(int slot);
  1917. #endif
  1918.  
  1919. #ifdef __SEND_TARGET_INFO__
  1920. private:
  1921. DWORD dwLastTargetInfoPulse;
  1922.  
  1923. public:
  1924. DWORD GetLastTargetInfoPulse() const { return dwLastTargetInfoPulse; }
  1925. void SetLastTargetInfoPulse(DWORD pulse) { dwLastTargetInfoPulse = pulse; }
  1926. #endif
  1927.  
  1928. #ifdef ENABLE_COINS_SYSTEM
  1929. public:
  1930. void SetCoins(bool bVoucher = false, int iCoins = 0, DWORD dwVnum = 0);
  1931. int GetCoins();
  1932.  
  1933. void SetJD(bool bVoucher = false, int iCoins = 0, DWORD dwVnum = 0);
  1934. int GetJD();
  1935.  
  1936. void SetEuro(bool bVoucher = false, int iCoins = 0, DWORD dwVnum = 0);
  1937. int GetEuro();
  1938. #endif
  1939.  
  1940. #ifdef __EQUIP_RESTRICT_SYSTEM__
  1941. public:
  1942. bool IsEquipRestricted();
  1943. #endif
  1944.  
  1945. public:
  1946. bool DragonSoul_RefineWindow_Open(LPENTITY pEntity);
  1947. bool DragonSoul_RefineWindow_Close();
  1948. LPENTITY DragonSoul_RefineWindow_GetOpener() { return m_pointsInstant.m_pDragonSoulRefineWindowOpener; }
  1949. bool DragonSoul_RefineWindow_CanRefine();
  1950.  
  1951. private:
  1952. timeval m_tvLastSyncTime;
  1953. int m_iSyncHackCount;
  1954.  
  1955. public:
  1956. void SetLastSyncTime(const timeval &tv) { memcpy(&m_tvLastSyncTime, &tv, sizeof(timeval)); }
  1957. const timeval& GetLastSyncTime() { return m_tvLastSyncTime; }
  1958. void SetSyncHackCount(int iCount) { m_iSyncHackCount = iCount;}
  1959. int GetSyncHackCount() { return m_iSyncHackCount; }
  1960. };
  1961.  
  1962. ESex GET_SEX(LPCHARACTER ch);
  1963.  
  1964. #endif
  1965.  
Tags: char.h
Advertisement
Add Comment
Please, Sign In to add comment