#pragma once #include "Extern.h" #include "../shared/STLMap.h" #include "../GameServer/Unit.h" class MAP; enum TransformationType { TransformationNone, TransformationMonster, TransformationNPC, TransformationSiege }; class CUser : public Unit { public: INLINE bool isGM() { return m_byIsOP == AUTHORITY_GAME_MASTER; } virtual uint16 GetID() { return m_iUserId; } virtual std::string & GetName() { return m_strUserID; } virtual int32 GetHealth() { return m_sHP; } virtual int32 GetMaxHealth() { return m_sMaxHP; } virtual int32 GetMana() { return m_sMP; } virtual int32 GetMaxMana() { return m_sMaxMP; } virtual void GetInOut(Packet &, uint8) {} virtual void AddToRegion(int16 sRegionX, int16 sRegionZ) {} virtual void BlinkStart() {} virtual void DcFlash() {} virtual void ExpFlash() {} virtual void WarFlash() {} virtual void HpChange(int amount, Unit *pAttacker = nullptr, bool bSendToAI = true) {} virtual void MSpChange(int amount) {} virtual bool isDead() { return m_bLive == AI_USER_DEAD || GetHealth() <= 0; } INLINE bool isInParty() { return m_byNowParty != 0; } INLINE uint16 GetPartyID() { return m_sPartyNumber; } std::string m_strUserID; short m_iUserId; // UserÀÇ ¹øÈ£ uint8 m_bLive; // Á×¾ú´Ï? »ì¾Ò´Ï? float m_fWill_x; // ´ÙÀ½ X ÁÂÇ¥ float m_fWill_y; // ´ÙÀ½ Y ÁÂÇ¥ float m_fWill_z; // ´ÙÀ½ Z ÁÂÇ¥ short m_sSpeed; // À¯ÀúÀÇ ½ºÇǵå short m_sHP; // HP short m_sMP; // MP short m_sMaxHP; // HP short m_sMaxMP; // MP uint8 m_state; // UserÀÇ »óÅ uint8 m_byNowParty; uint8 m_byPartyTotalMan; short m_sPartyTotalLevel; short m_sPartyNumber; uint16 m_sItemAc; short m_sSurroundNpcNumber[8]; // Npc ´Ù±¼~ uint8 m_byIsOP; uint8 m_bInvisibilityType; TransformationType m_transformationType; public: void Initialize(); void InitNpcAttack(); void OnDeath(Unit * pKiller); int IsSurroundCheck(float fX, float fY, float fZ, int NpcID); void HealMagic(); void HealAreaCheck(int rx, int rz); bool isHostileTo(Unit * pTarget); bool isInArena(); bool isInPartyArena(); bool isInPVPZone(); bool isInSafetyArea(); short GetDamage(Unit *pTarget, _MAGIC_TABLE *pSkill = nullptr, bool bPreviewOnly = false); CUser(); virtual ~CUser(); // Placeholders, for the magic system. // These should really be using the same base class. INLINE bool isInClan() { return false; } INLINE uint16 GetClanID() { return 0; } INLINE uint8 GetStat(StatType type) { return 0; } INLINE void SetStatBuff(StatType type, int8 val) {} INLINE void RemoveStatBuff(StatType type, int8 val) {} INLINE void SetUserEventRoom(uint16 nEventRoom) {m_bEventRoom = nEventRoom;} void RemoveSavedMagic(uint32 nSkillID) {} void SendUserStatusUpdate(UserStatus type, UserStatusBehaviour status) {} void SetUserAbility(bool bSendPacket = true) {} void Send(Packet * pkt) {} time_t m_tLastRegeneTime; uint32 m_nOldAbnormalType; uint8 m_sExpGainAmount; uint8 m_bMaxWeightAmount, m_bNPGainAmount, m_bNoahGainAmount, m_bPlayerAttackAmount, m_bSkillNPBonus, m_bAddWeaponDamage; uint16 m_sAddArmourAc; uint8 m_bPctArmourAc; uint8 m_FlashExpBonus; uint8 m_FlashDcBonus; uint8 m_FlashWarBonus; bool m_bPremiumMerchant; };