Guest User

char.h

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