Hallo liebe Community,
Nach einbau eines Eventkalenders bekomme ich nun sobald ich monster/metins angreife einen game.core .
evtl. hat jemand einen Vorschlag oder könnte helfen.
char.h:
Code
- #pragma once
- #include "stdafx.h"
- #include "event.h"
- #include "entity.h"
- #include "fsm.h"
- #include "horse_rider.h"
- #include "vid.h"
- #include "constants.h"
- #include "affect.h"
- #include "affect_flag.h"
- #include "mining.h"
- #include "new_activity.h"
- #include <unordered_set>
- #include <unordered_map>
- #include "../../common/stl.h"
- #include "pet_system.h"
- #include "shop.h"
- #include "shop_manager.h"
- #include "cmd.h"
- #ifndef ENABLE_CUBE_RENEWAL_WORLDARD
- #include "cube.h"
- #else
- #include "new_cuberenewal.h"
- #endif
- #ifdef ENABLE_BIOLOG_SYSTEM
- #include "new_biolog_system.h"
- #endif
- extern int g_nPortalLimitTime;
- enum EInstantFlags
- {
- INSTANT_FLAG_DEATH_PENALTY = (1 << 0),
- INSTANT_FLAG_SHOP = (1 << 1),
- INSTANT_FLAG_EXCHANGE = (1 << 2),
- INSTANT_FLAG_STUN = (1 << 3),
- INSTANT_FLAG_NO_REWARD = (1 << 4),
- };
- enum EAiFlags
- {
- AI_FLAG_NPC = (1 << 0),
- AI_FLAG_AGGRESSIVE = (1 << 1),
- AI_FLAG_HELPER = (1 << 2),
- AI_FLAG_STAYZONE = (1 << 3),
- };
- enum RaceTypes
- {
- MAIN_RACE_WARRIOR_M,
- MAIN_RACE_ASSASSIN_W,
- MAIN_RACE_SURA_M,
- MAIN_RACE_SHAMAN_W,
- MAIN_RACE_WARRIOR_W,
- MAIN_RACE_ASSASSIN_M,
- MAIN_RACE_SURA_W,
- MAIN_RACE_SHAMAN_M,
- #ifdef ENABLE_WOLFMAN
- MAIN_RACE_WOLFMAN_M,
- #endif
- MAIN_RACE_MAX_NUM,
- };
- #if defined(ENABLE_FAKE_PC) || defined(ENABLE_FAKE_BUFF)
- enum FakeRaceTypes
- {
- MAIN_RACE_MOB_WARRIOR_M = 12015,
- MAIN_RACE_MOB_ASSASSIN_W,
- MAIN_RACE_MOB_SURA_M,
- MAIN_RACE_MOB_SHAMAN_W,
- MAIN_RACE_MOB_WARRIOR_W,
- MAIN_RACE_MOB_ASSASSIN_M,
- MAIN_RACE_MOB_SURA_W,
- MAIN_RACE_MOB_SHAMAN_M,
- MAIN_RACE_MOB_WOLFMAN_M,
- MAIN_RACE_MOB_MAX_NUM = MAIN_RACE_MOB_WOLFMAN_M,
- };
- #endif
- enum EOther
- {
- POISON_LENGTH = 30,
- #ifdef ENABLE_WOLFMAN
- BLEEDING_LENGTH = 30,
- #endif
- STAMINA_PER_STEP = 1,
- SAFEBOX_PAGE_SIZE = 9,
- AI_CHANGE_ATTACK_POISITION_TIME_NEAR = 10000,
- AI_CHANGE_ATTACK_POISITION_TIME_FAR = 1000,
- AI_CHANGE_ATTACK_POISITION_DISTANCE = 100,
- SUMMON_MONSTER_COUNT = 3,
- SUMMON_HEALER_COUNT = 4,
- };
- enum FlyTypes
- {
- FLY_NONE,
- FLY_EXP,
- FLY_HP_MEDIUM,
- FLY_HP_BIG,
- FLY_SP_SMALL,
- FLY_SP_MEDIUM,
- FLY_SP_BIG,
- FLY_FIREWORK1,
- FLY_FIREWORK2,
- FLY_FIREWORK3,
- FLY_FIREWORK4,
- FLY_FIREWORK5,
- FLY_FIREWORK6,
- FLY_FIREWORK_CHRISTMAS,
- FLY_CHAIN_LIGHTNING,
- FLY_HP_SMALL,
- FLY_SKILL_MUYEONG,
- #ifdef ENABLE_QUIVER_SYSTEM
- FLY_QUIVER_ATTACK_NORMAL,
- #endif
- };
- enum EDamageType
- {
- DAMAGE_TYPE_NONE,
- DAMAGE_TYPE_NORMAL,
- DAMAGE_TYPE_NORMAL_RANGE,
- DAMAGE_TYPE_MELEE,
- DAMAGE_TYPE_RANGE,
- DAMAGE_TYPE_FIRE,
- DAMAGE_TYPE_ICE,
- DAMAGE_TYPE_ELEC,
- DAMAGE_TYPE_MAGIC,
- DAMAGE_TYPE_POISON,
- DAMAGE_TYPE_SPECIAL,
- DAMAGE_TYPE_EARTH,
- #ifdef ENABLE_WOLFMAN
- DAMAGE_TYPE_BLEEDING,
- #endif
- };
- enum EDamageFlag
- {
- DAMAGE_NORMAL = (1 << 0),
- DAMAGE_POISON = (1 << 1),
- DAMAGE_DODGE = (1 << 2),
- DAMAGE_BLOCK = (1 << 3),
- DAMAGE_PENETRATE = (1 << 4),
- DAMAGE_CRITICAL = (1 << 5),
- #ifdef ENABLE_WOLFMAN
- DAMAGE_BLEEDING = (1 << 6),
- #endif
- };
- enum EDamageEvents
- {
- CRITICAL = (1 << 0),
- PENETRATE = (1 << 1),
- BLOCK = (1 << 2),
- DODGE = (1 << 3),
- BERSEK = (1 << 4),
- FEAR = (1 << 5),
- BLESSING = (1 << 6),
- REFLECT = (1 << 7),
- STEAL_HP = (1 << 8),
- STEAL_SP = (1 << 9),
- HP_RECOVER = (1 << 10),
- SP_BURN = (1 << 11),
- APOTHIC_ABSORB = (1 << 12),
- };
- enum EPointTypes
- {
- POINT_NONE,
- POINT_LEVEL,
- POINT_VOICE,
- POINT_EXP,
- POINT_NEXT_EXP,
- POINT_HP,
- POINT_MAX_HP,
- POINT_SP,
- POINT_MAX_SP,
- POINT_STAMINA,
- POINT_MAX_STAMINA,
- POINT_GOLD,
- POINT_ST,
- POINT_HT,
- POINT_DX,
- POINT_IQ,
- POINT_DEF_GRADE,
- POINT_ATT_SPEED,
- POINT_ATT_GRADE,
- POINT_MOV_SPEED,
- POINT_CLIENT_DEF_GRADE,
- POINT_CASTING_SPEED,
- POINT_MAGIC_ATT_GRADE,
- POINT_MAGIC_DEF_GRADE,
- POINT_EMPIRE_POINT,
- POINT_LEVEL_STEP,
- POINT_STAT,
- POINT_SUB_SKILL,
- POINT_SKILL,
- POINT_WEAPON_MIN,
- POINT_WEAPON_MAX,
- POINT_PLAYTIME,
- POINT_HP_REGEN,
- POINT_SP_REGEN,
- POINT_BOW_DISTANCE,
- POINT_HP_RECOVERY,
- POINT_SP_RECOVERY,
- POINT_POISON_PCT,
- POINT_STUN_PCT,
- POINT_SLOW_PCT,
- POINT_CRITICAL_PCT,
- POINT_PENETRATE_PCT,
- POINT_CURSE_PCT,
- POINT_ATTBONUS_HUMAN,
- POINT_ATTBONUS_ANIMAL,
- POINT_ATTBONUS_ORC,
- POINT_ATTBONUS_MILGYO,
- POINT_ATTBONUS_UNDEAD,
- POINT_ATTBONUS_DEVIL,
- POINT_ATTBONUS_INSECT,
- POINT_ATTBONUS_FIRE,
- POINT_ATTBONUS_ICE,
- POINT_ATTBONUS_DESERT,
- POINT_ATTBONUS_MONSTER,
- POINT_ATTBONUS_WARRIOR,
- POINT_ATTBONUS_ASSASSIN,
- POINT_ATTBONUS_SURA,
- POINT_ATTBONUS_SHAMAN,
- POINT_ATTBONUS_TREE,
- POINT_RESIST_WARRIOR,
- POINT_RESIST_ASSASSIN,
- POINT_RESIST_SURA,
- POINT_RESIST_SHAMAN,
- POINT_STEAL_HP,
- POINT_STEAL_SP,
- POINT_MANA_BURN_PCT,
- POINT_DAMAGE_SP_RECOVER,
- POINT_BLOCK,
- POINT_DODGE,
- POINT_RESIST_SWORD,
- POINT_RESIST_TWOHAND,
- POINT_RESIST_DAGGER,
- POINT_RESIST_BELL,
- POINT_RESIST_FAN,
- POINT_RESIST_BOW,
- POINT_RESIST_FIRE,
- POINT_RESIST_ELEC,
- POINT_RESIST_MAGIC,
- POINT_RESIST_WIND,
- POINT_REFLECT_MELEE,
- POINT_REFLECT_CURSE,
- POINT_POISON_REDUCE,
- POINT_KILL_SP_RECOVER,
- POINT_EXP_DOUBLE_BONUS,
- POINT_GOLD_DOUBLE_BONUS,
- POINT_ITEM_DROP_BONUS,
- POINT_POTION_BONUS,
- POINT_KILL_HP_RECOVERY,
- POINT_IMMUNE_STUN,
- POINT_IMMUNE_SLOW,
- POINT_IMMUNE_FALL,
- POINT_PARTY_ATTACKER_BONUS,
- POINT_PARTY_TANKER_BONUS,
- POINT_ATT_BONUS,
- POINT_DEF_BONUS,
- POINT_ATT_GRADE_BONUS,
- POINT_DEF_GRADE_BONUS,
- POINT_MAGIC_ATT_GRADE_BONUS,
- POINT_MAGIC_DEF_GRADE_BONUS,
- POINT_RESIST_NORMAL_DAMAGE,
- POINT_HIT_HP_RECOVERY,
- POINT_HIT_SP_RECOVERY,
- POINT_MANASHIELD,
- POINT_PARTY_BUFFER_BONUS,
- POINT_PARTY_SKILL_MASTER_BONUS,
- POINT_HP_RECOVER_CONTINUE,
- POINT_SP_RECOVER_CONTINUE,
- POINT_STEAL_GOLD,
- POINT_POLYMORPH,
- POINT_MOUNT,
- POINT_PARTY_HASTE_BONUS,
- POINT_PARTY_DEFENDER_BONUS,
- POINT_STAT_RESET_COUNT,
- POINT_HORSE_SKILL,
- POINT_MALL_ATTBONUS,
- POINT_MALL_DEFBONUS,
- POINT_MALL_EXPBONUS,
- POINT_MALL_ITEMBONUS,
- POINT_MALL_GOLDBONUS,
- POINT_MAX_HP_PCT,
- POINT_MAX_SP_PCT,
- POINT_SKILL_DAMAGE_BONUS,
- POINT_NORMAL_HIT_DAMAGE_BONUS,
- POINT_SKILL_DEFEND_BONUS,
- POINT_NORMAL_HIT_DEFEND_BONUS,
- POINT_PC_BANG_EXP_BONUS,
- POINT_PC_BANG_DROP_BONUS,
- POINT_RAMADAN_CANDY_BONUS_EXP,
- POINT_ENERGY = 128,
- POINT_ENERGY_END_TIME = 129,
- POINT_COSTUME_ATTR_BONUS = 130,
- POINT_MAGIC_ATT_BONUS_PER = 131,
- POINT_MELEE_MAGIC_ATT_BONUS_PER = 132,
- POINT_RESIST_ICE = 133,
- POINT_RESIST_EARTH = 134,
- POINT_RESIST_DARK = 135,
- POINT_RESIST_CRITICAL = 136,
- POINT_RESIST_PENETRATE = 137,
- #ifdef ENABLE_WOLFMAN
- POINT_BLEEDING_PCT = 142,
- POINT_BLEEDING_REDUCE = 143,
- POINT_ATTBONUS_WOLFMAN = 144,
- POINT_RESIST_WOLFMAN = 145,
- POINT_RESIST_CLAW = 146,
- #endif
- #ifdef ENABLE_MAGIC_REDUCTION_SYSTEM
- POINT_RESIST_MAGIC_REDUCTION,
- #endif
- #ifdef ENABLE_BOSS_AND_STONE_BONUS
- POINT_ATTBONUS_SEFI,
- POINT_ATTBONUS_METINE,
- #endif
- #ifdef ENABLE_ZODIAC_TEMPLE_SHOP
- POINT_ZODIAC = 170,
- #endif
- #ifdef ENABLE_GAYA_SYSTEM
- POINT_GAYA = 175,
- #endif
- #ifdef ENABLE_ELEMENT_ADD
- POINT_ATTBONUS_ELEC = 177,
- POINT_ATTBONUS_WIND,
- POINT_ATTBONUS_EARTH,
- POINT_ATTBONUS_DARK,
- POINT_ATTBONUS_CZ,
- #endif
- #ifdef ENABLE_PENDANT
- POINT_ATTBONUS_SWORD,
- POINT_ATTBONUS_TWOHAND,
- POINT_ATTBONUS_DAGGER,
- POINT_ATTBONUS_BELL,
- POINT_ATTBONUS_FAN,
- POINT_ATTBONUS_BOW,
- #ifdef ENABLE_WOLFMAN
- POINT_ATTBONUS_CLAW,
- #endif
- POINT_RESIST_HUMAN,
- POINT_RESIST_MOUNT_FALL,
- #endif
- #ifdef ENABLE_HYDRA_DUNGEON
- POINT_ATTBONUS_HYDRA,
- #endif
- #ifdef ENABLE_BATTLE_PASS
- POINT_BATTLE_PASS_ID,
- #endif
- #ifdef ENABLE_RUNE_SYSTEM
- POINT_RUNE_PAGE1_KEYSTONE1,
- POINT_RUNE_PAGE1_KEYSTONE2,
- POINT_RUNE_PAGE1_KEYSTONE3,
- POINT_RUNE_PAGE2_KEYSTONE1,
- POINT_RUNE_PAGE2_KEYSTONE2,
- POINT_RUNE_PAGE2_KEYSTONE3,
- POINT_RUNE_PAGE3_KEYSTONE1,
- POINT_RUNE_PAGE3_KEYSTONE2,
- POINT_RUNE_PAGE3_KEYSTONE3,
- POINT_RUNE_PAGE1_ROW1,
- POINT_RUNE_PAGE1_ROW2,
- POINT_RUNE_PAGE1_ROW3,
- POINT_RUNE_PAGE2_ROW1,
- POINT_RUNE_PAGE2_ROW2,
- POINT_RUNE_PAGE2_ROW3,
- POINT_RUNE_PAGE3_ROW1,
- POINT_RUNE_PAGE3_ROW2,
- POINT_RUNE_PAGE3_ROW3,
- #endif
- };
- enum EPKModes
- {
- PK_MODE_PEACE,
- PK_MODE_REVENGE,
- PK_MODE_FREE,
- PK_MODE_PROTECT,
- PK_MODE_GUILD,
- PK_MODE_MAX_NUM,
- };
- enum EPositions
- {
- POS_DEAD,
- POS_SLEEPING,
- POS_RESTING,
- POS_SITTING,
- POS_FISHING,
- POS_FIGHTING,
- POS_MOUNTING,
- POS_STANDING,
- };
- enum EBlockAction
- {
- BLOCK_EXCHANGE = (1 << 0),
- BLOCK_PARTY_INVITE = (1 << 1),
- BLOCK_GUILD_INVITE = (1 << 2),
- BLOCK_WHISPER = (1 << 3),
- BLOCK_MESSENGER_INVITE = (1 << 4),
- BLOCK_PARTY_REQUEST = (1 << 5),
- // BLOCK_VIEW_EQUIP = (1 << 6),
- #ifdef ENABLE_TELEPORT_TO_A_FRIEND
- BLOCK_WARP_REQUEST = (1 << 6),
- #endif
- };
- enum ESkillUpBy
- {
- SKILL_UP_BY_POINT,
- SKILL_UP_BY_BOOK,
- SKILL_UP_BY_TRAIN,
- SKILL_UP_BY_QUEST,
- };
- struct DynamicCharacterPtr
- {
- DynamicCharacterPtr()
- : is_pc(false)
- , id(0)
- {
- }
- DynamicCharacterPtr(const DynamicCharacterPtr &o)
- : is_pc(o.is_pc)
- , id(o.id)
- {
- }
- LPCHARACTER Get() const;
- void Reset()
- {
- is_pc = false;
- id = 0;
- }
- DynamicCharacterPtr &operator= (const DynamicCharacterPtr &rhs)
- {
- is_pc = rhs.is_pc;
- id = rhs.id;
- return *this;
- }
- DynamicCharacterPtr &operator= (LPCHARACTER character);
- operator LPCHARACTER() const
- {
- return Get();
- }
- bool is_pc;
- uint32_t id;
- };
- typedef struct character_point
- {
- long points[POINT_MAX_NUM];
- BYTE job;
- BYTE voice;
- BYTE level;
- DWORD exp;
- unsigned long long gold;
- #ifdef ENABLE_CHAT_COLOR_SYSTEM
- BYTE color;
- #endif
- #ifdef ENABLE_GAYA_SYSTEM
- int gaya;
- #endif
- long hp; /*** Fix for long HP/SP (50k +) ***/
- long sp; /*** Fix for long HP/SP (50k +) ***/
- long iRandomHP; /*** Fix for long HP/SP (50k +) ***/
- long iRandomSP; /*** Fix for long HP/SP (50k +) ***/
- int stamina;
- BYTE skill_group;
- #ifdef ENABLE_ZODIAC_TEMPLE_SHOP
- uint16_t zodiac_point;
- #endif
- } CHARACTER_POINT;
- typedef struct character_point_instant
- {
- long points[POINT_MAX_NUM];
- float fRot;
- long iMaxHP; /*** Fix for long HP/SP (50k +) ***/
- long iMaxSP; /*** Fix for long HP/SP (50k +) ***/
- long position;
- long instant_flag;
- DWORD dwAIFlag;
- DWORD dwImmuneFlag;
- DWORD dwLastShoutPulse;
- DWORD parts[PART_MAX_NUM];
- LPITEM pItems[INVENTORY_AND_EQUIP_SLOT_MAX];
- uint16_t bItemGrid[INVENTORY_AND_EQUIP_SLOT_MAX];
- LPITEM pDSItems[DRAGON_SOUL_INVENTORY_MAX_NUM];
- uint16_t wDSItemGrid[DRAGON_SOUL_INVENTORY_MAX_NUM];
- #ifdef ENABLE_SWITCHBOT
- LPITEM pSwitchbotItems[SWITCHBOT_SLOT_COUNT];
- #endif
- LPITEM pCubeItems[CUBE_MAX_NUM];
- LPCHARACTER pCubeNpc;
- #ifdef ENABLE_SHOULDER_SASH_SYSTEM
- LPITEM pSashMaterials[SASH_WINDOW_MAX_MATERIALS];
- #endif
- #ifdef ENABLE_COSTUME_AURA_SYSTEM
- LPENTITY m_pAuraRefineWindowOpener;
- #endif
- LPCHARACTER battle_victim;
- BYTE gm_level;
- BYTE bBasePart;
- int iMaxStamina;
- DWORD bBlockMode;
- int iDragonSoulActiveDeck;
- LPENTITY m_pDragonSoulRefineWindowOpener;
- } CHARACTER_POINT_INSTANT;
- #define TRIGGERPARAM LPCHARACTER ch, LPCHARACTER causer
- class CTrigger
- {
- public:
- CTrigger()
- : bType(0)
- , pFunc(NULL)
- {
- }
- BYTE bType;
- int (*pFunc)(TRIGGERPARAM);
- };
- EVENTINFO(char_event_info)
- {
- DynamicCharacterPtr ch;
- };
- struct TSkillUseInfo
- {
- int iHitCount;
- int iMaxHitCount;
- int iSplashCount;
- DWORD dwNextSkillUsableTime;
- int iRange;
- bool bUsed;
- DWORD dwVID;
- bool isGrandMaster;
- std::unordered_map<VID, size_t> TargetVIDMap;
- TSkillUseInfo()
- : iHitCount(0)
- , iMaxHitCount(0)
- , iSplashCount(0)
- , dwNextSkillUsableTime(0)
- , iRange(0)
- , bUsed(false)
- , dwVID(0)
- , isGrandMaster(false)
- {
- }
- bool HitOnce(DWORD dwVnum = 0);
- bool UseSkill(bool isGrandMaster, DWORD vid, DWORD dwCooltime, int splashcount = 1, int hitcount = -1, int range = -1);
- #if defined(ENABLE_FAKE_PC) || defined(ENABLE_FAKE_BUFF)
- bool IsCooltimeOver() const;
- #endif
- DWORD GetMainTargetVID() const
- {
- return dwVID;
- }
- void SetMainTargetVID(DWORD vid)
- {
- dwVID = vid;
- }
- void ResetHitCount()
- {
- if (iSplashCount)
- {
- iHitCount = iMaxHitCount;
- iSplashCount--;
- }
- }
- };
- class CBuffOnAttributes;
- class CPVP;
- class CInventory;
- #ifdef ENABLE_COSTUME_MOUNT_SYSTEM
- class CMountSystem;
- #endif
- #ifdef ENABLE_NEW_PET_SYSTEM
- class CNewPetSystem;
- #endif
- class CExchange;
- class CSkillProto;
- class CParty;
- class CDungeon;
- class CWarMap;
- class CAffect;
- class CGuild;
- class CSafebox;
- class CArena;
- #ifdef __ENABLE_NEW_OFFLINESHOP__
- namespace offlineshop
- {
- class CShop;
- class CShopSafebox;
- class CAuction;
- }
- #endif
- class CMob;
- class CMobInstance;
- class WeddingMap;
- typedef struct SPacketGCPartyUpdate TPacketGCPartyUpdate;
- typedef struct SMobSkillInfo TMobSkillInfo;
- extern int GetSkillPowerByLevelFromType(int job, int skillgroup, int skilllevel);
- class CHARACTER: public CEntity, public CFSM, public CHorseRider
- {
- protected:
- virtual void EncodeInsertPacket(LPENTITY entity);
- virtual void EncodeRemovePacket(LPENTITY entity);
- public:
- LPCHARACTER FindCharacterInView(const char* name, bool bFindPCOnly);
- #ifdef ENABLE_SPECULAR_SYSTEM
- void UpdatePacket(bool bUnequip = false);
- #else
- void UpdatePacket();
- #endif
- #ifdef ENABLE_GLOBAL_LANGUAGE
- std::string GetLang();
- void SetLanguage(std::string language);
- #endif
- protected:
- CStateTemplate<CHARACTER> m_stateMove;
- CStateTemplate<CHARACTER> m_stateBattle;
- CStateTemplate<CHARACTER> m_stateIdle;
- #ifdef ENABLE_KICK_HACK_SECURITY
- public:
- void ClearPMCounter(void)
- {
- m_iPMCounter = 0;
- }
- void IncreasePMCounter(void)
- {
- m_iPMCounter++;
- }
- void SetLastPMPulse(void);
- int GetPMCounter(void) const
- {
- return m_iPMCounter;
- }
- int GetLastPMPulse(void) const
- {
- return m_iLastPMPulse;
- }
- protected:
- int m_iLastPMPulse;
- int m_iPMCounter;
- #endif
- public:
- virtual void StateMove();
- virtual void StateBattle();
- virtual void StateIdle();
- virtual void StateFlag();
- virtual void StateFlagBase();
- void StateHorse();
- protected:
- void StateIdle_Monster();
- void StateIdle_Stone();
- void StateIdle_NPC();
- public:
- DWORD GetAIFlag() const
- {
- return m_pointsInstant.dwAIFlag;
- }
- void SetAggressive();
- bool IsAggressive() const;
- void SetCoward();
- bool IsCoward() const;
- void CowardEscape();
- void SetNoAttackShinsu();
- bool IsNoAttackShinsu() const;
- void SetNoAttackChunjo();
- bool IsNoAttackChunjo() const;
- void SetNoAttackJinno();
- bool IsNoAttackJinno() const;
- void SetAttackMob();
- bool IsAttackMob() const;
- #ifdef ENABLE_FAKE_BUFF
- bool CanNPCFollowTarget(LPCHARACTER pkTarget);
- #endif
- void SetNoMoveFlag()
- {
- SET_BIT(m_pointsInstant.dwAIFlag, AIFLAG_NOMOVE);
- }
- bool IsNoMoveFlag() const
- {
- return IS_SET(m_pointsInstant.dwAIFlag, AIFLAG_NOMOVE);
- }
- virtual void BeginStateEmpty();
- virtual void EndStateEmpty() {}
- void RestartAtSamePos();
- protected:
- DWORD m_dwStateDuration;
- public:
- CHARACTER();
- virtual ~CHARACTER();
- void Create(std::string c_pszName, DWORD vid, bool isPC);
- void Destroy();
- void Disconnect(const char* c_pszReason);
- protected:
- void Initialize();
- #ifdef ENABLE_SEND_TARGET_INFO
- private:
- DWORD dwLastTargetInfoPulse;
- public:
- DWORD GetLastTargetInfoPulse() const
- {
- return dwLastTargetInfoPulse;
- }
- void SetLastTargetInfoPulse(DWORD pulse)
- {
- dwLastTargetInfoPulse = pulse;
- }
- #endif
- public:
- void SetPlayerID(DWORD pid)
- {
- m_dwPlayerID = pid;
- }
- DWORD GetPlayerID() const
- {
- return m_dwPlayerID;
- }
- void SetPlayerProto(const TPlayerTable* table);
- void CreatePlayerProto(TPlayerTable &tab);
- void SetProto(const CMob* c_pkMob);
- uint16_t GetRaceNum() const;
- #ifdef __ADMIN_MANAGER__
- uint16_t GetRealRaceNum() const;
- #endif
- void Save();
- void SaveReal();
- void FlushDelayedSaveItem();
- const char* GetName() const;
- std::string GetStringName() const;
- const char* GetProtoName() const;
- const VID &GetVID() const
- {
- return m_vid;
- }
- void SetName(const std::string &name)
- {
- m_stName = name;
- }
- void SetRace(BYTE race);
- bool ChangeSex();
- DWORD GetAID() const;
- int GetChangeEmpireCount() const;
- void SetChangeEmpireCount();
- int ChangeEmpire(BYTE empire);
- BYTE GetJob() const;
- BYTE GetCharType() const;
- bool IsPC() const
- {
- return GetDesc() ? true : false;
- }
- bool IsNPC() const
- {
- return m_bCharType != CHAR_TYPE_PC;
- }
- bool IsMonster() const
- {
- return m_bCharType == CHAR_TYPE_MONSTER;
- }
- bool IsStone() const
- {
- return m_bCharType == CHAR_TYPE_STONE;
- }
- bool IsDoor() const
- {
- return m_bCharType == CHAR_TYPE_DOOR;
- }
- bool IsBuilding() const
- {
- return m_bCharType == CHAR_TYPE_BUILDING;
- }
- bool IsWarp() const
- {
- return m_bCharType == CHAR_TYPE_WARP;
- }
- bool IsGoto() const
- {
- return m_bCharType == CHAR_TYPE_GOTO;
- }
- bool IsSpecialRefineItem(LPITEM item);
- #ifdef ENABLE_FAKE_PC
- bool IsEnemy() const;
- bool IsPurgeable() const;
- #endif
- DWORD GetLastShoutPulse() const
- {
- return m_pointsInstant.dwLastShoutPulse;
- }
- void SetLastShoutPulse(DWORD pulse)
- {
- m_pointsInstant.dwLastShoutPulse = pulse;
- }
- #ifdef ENABLE_FAKE_PC
- int GetLevel() const
- {
- return FakePC_Check() ? FakePC_GetOwner()->m_points.level : m_points.level;
- }
- #else
- int GetLevel() const
- {
- return m_points.level;
- }
- #endif
- void SetLevel(BYTE level);
- BYTE GetGMLevel(bool bIgnoreTestServer = false) const;
- bool IsGM() const;
- void StripPowers()
- {
- m_powersStripped = true;
- }
- bool IsStrippedPowers() const
- {
- return m_powersStripped;
- }
- void SetGMLevel();
- DWORD GetExp() const
- {
- return m_points.exp;
- }
- void SetExp(DWORD exp)
- {
- m_points.exp = exp;
- }
- bool CanFall();
- DWORD GetNextExp() const;
- #ifdef ENABLE_NEW_PET_SYSTEM
- DWORD PetGetNextExp() const;
- #endif
- LPCHARACTER DistributeExp();
- void DistributeHP(LPCHARACTER pkKiller);
- void DistributeSP(LPCHARACTER pkKiller, int iMethod = 0);
- LPCHARACTER GetMostAttacked();
- void SetPosition(int pos);
- bool IsPosition(int pos) const
- {
- return m_pointsInstant.position == pos ? true : false;
- }
- int GetPosition() const
- {
- return m_pointsInstant.position;
- }
- void SetPart(BYTE bPartPos, DWORD wVal);
- DWORD GetPart(BYTE bPartPos) const;
- DWORD GetOriginalPart(BYTE bPartPos) const;
- /*** Fix for long HP/SP (50k +) ***/
- void SetHP(long hp)
- {
- m_points.hp = hp;
- }
- long GetHP() const
- {
- return m_points.hp;
- }
- void SetSP(long sp)
- {
- m_points.sp = sp;
- }
- long GetSP() const
- {
- return m_points.sp;
- }
- /*** End ***/
- void SetStamina(int stamina)
- {
- m_points.stamina = stamina;
- }
- int GetStamina() const
- {
- return m_points.stamina;
- }
- /*** Fix for long HP/SP (50k +) ***/
- void SetMaxHP(long iVal)
- {
- m_pointsInstant.iMaxHP = iVal;
- }
- long GetMaxHP() const
- {
- return m_pointsInstant.iMaxHP;
- }
- void SetMaxSP(long iVal)
- {
- m_pointsInstant.iMaxSP = iVal;
- }
- long GetMaxSP() const
- {
- return m_pointsInstant.iMaxSP;
- }
- /*** End ***/
- void SetMaxStamina(int iVal)
- {
- m_pointsInstant.iMaxStamina = iVal;
- }
- int GetMaxStamina() const
- {
- return m_pointsInstant.iMaxStamina;
- }
- /*** Fix for long HP/SP (50k +) ***/
- void SetRandomHP(long v)
- {
- m_points.iRandomHP = v;
- }
- void SetRandomSP(long v)
- {
- m_points.iRandomSP = v;
- }
- long GetRandomHP() const
- {
- return m_points.iRandomHP;
- }
- long GetRandomSP() const
- {
- return m_points.iRandomSP;
- }
- /*** End ***/
- int GetHPPct() const;
- void SetRealPoint(BYTE idx, int val);
- int GetRealPoint(BYTE idx) const;
- void SetPoint(BYTE idx, int val);
- int GetPoint(BYTE idx) const;
- #ifdef __ADMIN_MANAGER__
- int GetConvPoint(BYTE idx) const;
- #endif
- int GetLimitPoint(BYTE idx) const;
- int GetPolymorphPoint(BYTE idx) const;
- const TMobTable &GetMobTable() const;
- BYTE GetMobRank() const;
- BYTE GetMobBattleType() const;
- uint16_t GetMobSize() const;
- DWORD GetMobSkillRange() const;
- DWORD GetMobDamageMin() const;
- DWORD GetMobDamageMax() const;
- uint16_t GetMobAttackRange() const;
- DWORD GetMobDropItemVnum() const;
- float GetMobDamageMultiply() const;
- bool IsBerserker() const;
- bool IsBerserk() const;
- void SetBerserk(bool mode);
- bool IsStoneSkinner() const;
- bool IsGodSpeeder() const;
- bool IsGodSpeed() const;
- void SetGodSpeed(bool mode);
- bool IsDeathBlower() const;
- bool IsDeathBlow() const;
- bool IsReviver() const;
- bool HasReviverInParty() const;
- bool IsRevive() const;
- void SetRevive(bool mode);
- bool IsRaceFlag(DWORD dwBit) const;
- bool IsSummonMonster() const;
- DWORD GetSummonVnum() const;
- DWORD GetPolymorphItemVnum() const;
- DWORD GetMonsterDrainSPPoint() const;
- void MainCharacterPacket();
- void ComputePoints();
- void ComputeBattlePoints();
- void PointChange(BYTE type, long long amount, bool bAmount = false, bool bBroadcast = false);
- void PointsPacket();
- void ApplyPoint(BYTE bApplyType, int iVal);
- #ifdef ENABLE_NEW_PET_SYSTEM
- void SendPetLevelUpEffect(int vid, int type, int value, int amount);
- #endif
- void CheckMaximumPoints();
- bool Show(long lMapIndex, long x, long y, long z = LONG_MAX, bool bShowSpawnMotion = false);
- void Sitdown(int is_ground);
- void Standup();
- void SetRotation(float fRot);
- void SetRotationToXY(long x, long y);
- float GetRotation() const
- {
- return m_pointsInstant.fRot;
- }
- void MotionPacketEncode(BYTE motion, LPCHARACTER victim, struct packet_motion* packet);
- void Motion(BYTE motion, LPCHARACTER victim = NULL);
- void ChatPacket(BYTE type, const char* format, ...);
- #ifdef ENABLE_GLOBAL_LANGUAGE
- void ChatInfo(const char * format, ...);
- void ChatInfoCond(bool cond, const char * format, ...);
- void ChatInfoTrans(const char * format, ...);
- void ChatShoutTrans(const char * lang, const char * format, ...);
- #endif
- void MonsterChat(BYTE bMonsterChatType);
- void ResetPoint(int iLv);
- void SetBlockMode(DWORD bFlag);
- void SetBlockModeForce(DWORD bFlag);
- bool IsBlockMode(DWORD bFlag) const
- {
- return (m_pointsInstant.bBlockMode & bFlag) ? true : false;
- }
- bool IsPolymorphed() const
- {
- return m_dwPolymorphRace > 0;
- }
- bool IsPolyMaintainStat() const
- {
- return m_bPolyMaintainStat;
- }
- void SetPolymorph(DWORD dwRaceNum, bool bMaintainStat = false);
- DWORD GetPolymorphVnum() const
- {
- return m_dwPolymorphRace;
- }
- int GetPolymorphPower() const;
- #ifdef ENABLE_RUNE_SYSTEM
- std::string GetRunes();
- void EnableRuneRow(int bRow);
- void SetRunes(std::string bNew) { m_dwRuneString = bNew; }
- void AddRuneBonus(int bType, int bValue);
- void RemoveRuneBonus(int bType);
- bool HasRuneBonus(int bType);
- int GetBonusValue(int bType);
- void RegisterStrike(DWORD dwTargetVID);
- void ResetStrikes(DWORD dwTargetVID);
- bool GetStrikeByVid(DWORD dwTargetVID, DWORD * iAmount);
- #endif
- void fishing();
- void fishing_take();
- void mining(LPCHARACTER chLoad);
- void mining_cancel();
- void mining_take();
- void ResetPlayTime(DWORD dwTimeRemain = 0);
- void CreateFly(BYTE bType, LPCHARACTER pkVictim);
- void ResetChatCounter();
- BYTE IncreaseChatCounter();
- BYTE GetChatCounter() const;
- // I think it's for 'Store whisper' after log out, disconnect.
- void ResetWhisperCounter()
- {
- m_bWhisperCounter = 0;
- }
- bool IncreaseWhisperCounter()
- {
- ++m_bWhisperCounter;
- return m_bWhisperCounter;
- }
- BYTE GetWhisperCounter() const
- {
- return m_bWhisperCounter;
- }
- // End
- protected:
- DWORD m_dwPolymorphRace;
- bool m_bPolyMaintainStat;
- DWORD m_dwLoginPlayTime;
- DWORD m_dwPlayerID;
- VID m_vid;
- std::string m_stName;
- #ifdef ENABLE_NEW_PET_SYSTEM
- BYTE m_stImmortalSt;
- #endif
- BYTE m_bCharType;
- #ifdef ENABLE_NEW_PET_SYSTEM
- DWORD m_newpetskillcd[3];
- #endif
- #ifdef ENABLE_RUNE_SYSTEM
- std::string m_dwRuneString;
- std::map<int, int> m_dwRuneBonuses;
- std::map<DWORD, DWORD> m_iStrike;
- #endif
- CHARACTER_POINT m_points;
- CHARACTER_POINT_INSTANT m_pointsInstant;
- int m_iMoveCount;
- DWORD m_dwPlayStartTime;
- BYTE m_bAddChrState;
- bool m_bSkipSave;
- BYTE m_bChatCounter;
- BYTE m_bWhisperCounter; // I think it's for 'Store whisper' after log out, disconnect.
- bool m_powersStripped;
- int m_RegenDelay;
- int m_RegenPctReduction;
- public:
- bool IsStateMove() const
- {
- return IsState((CState &) m_stateMove);
- }
- bool IsStateIdle() const
- {
- return IsState((CState &) m_stateIdle);
- }
- bool IsWalking() const
- {
- return m_bNowWalking || GetStamina() <= 0;
- }
- void SetWalking(bool bWalkFlag)
- {
- m_bWalking = bWalkFlag;
- }
- void SetNowWalking(bool bWalkFlag);
- void ResetWalking()
- {
- SetNowWalking(m_bWalking);
- }
- bool Goto(long x, long y);
- void Stop();
- bool CanMove() const;
- void SyncPacket();
- bool Sync(long x, long y);
- bool Move(long x, long y);
- void OnMove(bool bIsAttack = false);
- DWORD GetMotionMode() const;
- float GetMoveMotionSpeed() const;
- float GetMoveSpeed() const;
- void CalculateMoveDuration();
- void SendMovePacket(BYTE bFunc, UINT uArg, DWORD x, DWORD y, DWORD dwDuration, DWORD dwTime = 0, int iRot = -1);
- DWORD GetCurrentMoveDuration() const
- {
- return m_dwMoveDuration;
- }
- DWORD GetWalkStartTime() const
- {
- return m_dwWalkStartTime;
- }
- DWORD GetLastMoveTime() const
- {
- return m_dwLastMoveTime;
- }
- DWORD GetLastAttackTime() const
- {
- return m_dwLastAttackTime;
- }
- void SetLastAttacked(DWORD time);
- bool SetSyncOwner(LPCHARACTER ch, bool bRemoveFromList = true);
- bool IsSyncOwner(LPCHARACTER ch) const;
- #ifdef ENABLE_ZODIAC_TEMPLE
- void SetLastZodiacCzLastTime(int time) { m_dwZodiacCzLastTime = time; }
- int GetLastZodiacCzLastTime() const { return m_dwZodiacCzLastTime; }
- #endif
- bool WarpSet(long x, long y, long lRealMapIndex = 0);
- #ifdef ENABLE_P2P_WARP
- bool WarpSet(long x, long y, long lPrivateMapIndex, long lMapIndex, long lAddr, WORD wPort);
- #endif
- void SetWarpLocation(long lMapIndex, long x, long y);
- void WarpEnd();
- const PIXEL_POSITION &GetWarpPosition() const
- {
- return m_posWarp;
- }
- bool WarpToPID(DWORD dwPID);
- long GetWarpMapIndex()
- {
- return m_lWarpMapIndex;
- }
- #ifdef ENABLE_TELEPORT_TO_A_FRIEND
- bool SummonCharacter(LPCHARACTER victim);
- bool IsAllowedMapIndex(int mapindex);
- #endif
- void SaveExitLocation();
- void ExitToSavedLocation();
- void StartStaminaConsume();
- void StopStaminaConsume();
- bool IsStaminaConsume() const;
- void ResetStopTime();
- DWORD GetStopTime() const;
- #ifdef __ENABLE_NEW_OFFLINESHOP__
- public:
- int GetOfflineShopUseTime() const {return m_iOfflineShopUseTime;}
- void SetOfflineShopUseTime(){m_iOfflineShopUseTime = thecore_pulse();}
- private:
- int m_iOfflineShopUseTime = 0;
- public:
- #endif
- int GetPenaltyRegenTime()
- {
- return m_RegenDelay;
- }
- void SetPenaltyRegenTime(int value)
- {
- m_RegenDelay = value;
- }
- int GetPenaltyRegenPct()
- {
- return m_RegenPctReduction;
- }
- void SetPenaltyRegenPct(int value)
- {
- m_RegenPctReduction = MINMAX(0, value, 100);
- }
- protected:
- void ClearSync();
- float m_fSyncTime;
- LPCHARACTER m_pkChrSyncOwner;
- CHARACTER_LIST m_kLst_pkChrSyncOwned;
- PIXEL_POSITION m_posDest;
- PIXEL_POSITION m_posStart;
- PIXEL_POSITION m_posWarp;
- long m_lWarpMapIndex;
- PIXEL_POSITION m_posExit;
- long m_lExitMapIndex;
- DWORD m_dwMoveStartTime;
- DWORD m_dwMoveDuration;
- DWORD m_dwLastMoveTime;
- DWORD m_dwLastAttackTime;
- DWORD m_dwWalkStartTime;
- DWORD m_dwStopTime;
- bool m_bWalking;
- bool m_bNowWalking;
- bool m_bStaminaConsume;
- #ifdef ENABLE_ZODIAC_TEMPLE
- int m_dwZodiacCzLastTime;
- #endif
- public:
- void SyncQuickslot(BYTE bType, BYTE bOldPos, BYTE bNewPos);
- int GetQuickslotPosition(BYTE bType, BYTE bInventoryPos);
- bool GetQuickslot(BYTE pos, TQuickslot ** ppSlot);
- bool SetQuickslot(BYTE pos, TQuickslot & rSlot);
- bool DelQuickslot(BYTE pos);
- bool SwapQuickslot(BYTE a, BYTE b);
- void ChainQuickslotItem(LPITEM pItem, BYTE bType, BYTE bOldPos);
- protected:
- TQuickslot m_quickslot[QUICKSLOT_MAX_NUM];
- std::vector<TQuickslot> m_tmpQuickslots;
- public:
- void StartAffectEvent();
- void ClearAffect(bool bSave = false
- #ifdef ENABLE_NO_CLEAR_BUFF_WHEN_MONSTER_KILL
- , bool letBuffs = false
- #endif
- );
- void ComputeAffect(CAffect* pkAff, bool bAdd);
- bool AddAffect(DWORD dwType, BYTE bApplyOn, long lApplyValue, DWORD dwFlag, long lDuration, long lSPCost, bool bOverride, bool IsCube = false);
- void RefreshAffect();
- bool RemoveAffect(DWORD dwType);
- bool IsAffectFlag(DWORD dwAff) const;
- #ifdef ENABLE_PERMANENT_EFFECT_ITEMS
- void RemoveAffectBlend(DWORD dwType, BYTE bApplyOn);
- #endif
- bool UpdateAffect();
- int ProcessAffect();
- void LoadAffect(DWORD dwCount, TPacketAffectElement* pElements);
- void SaveAffect();
- public:
- bool IsLoadedAffect() const
- {
- return m_bIsLoadedAffect;
- }
- bool IsGoodAffect(BYTE bAffectType) const;
- void RemoveGoodAffect();
- void RemoveBadAffect();
- CAffect* FindAffect(DWORD dwType, BYTE bApply = APPLY_NONE) const;
- const std::list<CAffect*> &GetAffectContainer() const
- {
- return m_list_pkAffect;
- }
- bool RemoveAffect(CAffect * pkAff, bool single = true);
- protected:
- bool m_bIsLoadedAffect;
- TAffectFlag m_afAffectFlag;
- std::list<CAffect*> m_list_pkAffect;
- public:
- void SetParty(LPPARTY pkParty);
- LPPARTY GetParty() const
- {
- return m_pkParty;
- }
- bool RequestToParty(LPCHARACTER leader);
- void DenyToParty(LPCHARACTER member);
- bool ProcessPartyJoin(LPCHARACTER member, LPCHARACTER requester, bool callJoin = false, bool informPlayers = false);
- void AcceptToParty(LPCHARACTER member);
- void PartyInvite(LPCHARACTER pchInvitee);
- void PartyInviteAccept(LPCHARACTER pchInvitee);
- void PartyInviteDeny(DWORD dwPID);
- bool BuildUpdatePartyPacket(TPacketGCPartyUpdate &out);
- int GetLeadershipSkillLevel() const;
- bool CanSummon(int iLeaderShip);
- void SetPartyRequestEvent(LPEVENT pkEvent)
- {
- m_pkPartyRequestEvent = pkEvent;
- }
- protected:
- enum PartyJoinErrCode
- {
- PERR_NONE = 0,
- PERR_SERVER,
- PERR_DUNGEON,
- PERR_OBSERVER,
- PERR_LVBOUNDARY,
- PERR_LOWLEVEL,
- PERR_HILEVEL,
- PERR_ALREADYJOIN,
- PERR_PARTYISFULL,
- PERR_SEPARATOR,
- PERR_DIFFEMPIRE,
- PERR_MAX,
- };
- void PartyJoin(LPCHARACTER pkLeader);
- static PartyJoinErrCode IsPartyJoinableCondition(const LPCHARACTER pchLeader, const LPCHARACTER pchGuest);
- static PartyJoinErrCode IsPartyJoinableMutableCondition(const LPCHARACTER pchLeader, const LPCHARACTER pchGuest);
- LPPARTY m_pkParty;
- DWORD m_dwLastDeadTime;
- LPEVENT m_pkPartyRequestEvent;
- typedef std::map<DWORD, LPEVENT> EventMap;
- EventMap m_PartyInviteEventMap;
- #ifdef ENABLE_DAILY_BOSS
- std::map<DWORD, DWORD> m_CharacterDamageInfo;
- #endif
- public:
- void SetDungeon(LPDUNGEON pkDungeon);
- LPDUNGEON GetDungeon() const
- {
- return m_pkDungeon;
- }
- LPDUNGEON GetDungeonForce() const;
- protected:
- LPDUNGEON m_pkDungeon;
- int m_iEventAttr;
- #ifdef ENABLE_ZODIAC_TEMPLE
- public:
- void SetZodiac(LPZODIAC pkZodiac);
- LPZODIAC GetZodiac() const { return m_pkZodiac; }
- LPZODIAC GetZodiacForce() const;
- protected:
- LPZODIAC m_pkZodiac;
- #endif
- public:
- void SetGuild(CGuild* pGuild);
- CGuild* GetGuild() const
- {
- return m_pGuild;
- }
- void SetWarMap(CWarMap* pWarMap);
- CWarMap* GetWarMap() const
- {
- return m_pWarMap;
- }
- protected:
- CGuild* m_pGuild;
- DWORD m_dwUnderGuildWarInfoMessageTime;
- CWarMap* m_pWarMap;
- public:
- bool CanHandleItem(bool bSkipRefineCheck = false, bool bSkipObserver = false);
- bool IsItemLoaded() const
- {
- return m_bItemLoaded;
- }
- void SetItemLoaded()
- {
- m_bItemLoaded = true;
- }
- void ClearItem();
- void SetItem(const TItemPos &Cell, LPITEM item);
- LPITEM GetItem(const TItemPos &Cell) const;
- LPITEM GetItem_NEW(const TItemPos &Cell) const;
- LPITEM GetInventoryItem(const uint16_t &wCell) const;
- LPITEM GetDragonSoulItem(const uint16_t & wCell) const;
- bool IsEmptyItemGrid(const TItemPos &Cell, BYTE size, int iExceptionCell = -1) const;
- bool IsEmptyItemGridSpecial(const TItemPos &Cell, BYTE bSize, int iExceptionCell, std::vector<uint16_t>& vec) const;
- #ifdef ENABLE_SPECIAL_STORAGE
- LPITEM GetSkillBookInventoryItem(uint16_t wCell) const;
- LPITEM GetUpgradeItemsInventoryItem(uint16_t wCell) const;
- LPITEM GetStoneInventoryItem(uint16_t wCell) const;
- LPITEM GetBonusInventoryItem(uint16_t wCell) const;
- LPITEM GetChestInventoryItem(uint16_t wCell) const;
- #endif
- void SetWear(uint16_t bCell, LPITEM item);
- LPITEM GetWear(uint16_t bCell) const;
- void UseSilkBotary(void);
- void UseSilkBotaryReal(const TPacketMyshopPricelistHeader* p);
- bool UseItemEx(LPITEM item, const TItemPos &DestCell);
- bool UseItem(const TItemPos &Cell, const TItemPos & = NPOS);
- bool IsRefineThroughGuild() const;
- CGuild* GetRefineGuild() const;
- int ComputeRefineFee(int iCost, int iMultiply = 5) const;
- void PayRefineFee(int iTotalMoney);
- void SetRefineNPC(LPCHARACTER ch);
- LPCHARACTER GetRefineNPC() const;
- bool RefineItem(LPITEM pkItem, LPITEM pkTarget);
- #ifdef ENABLE_EXTENDED_COUNT_ITEMS
- bool DropItem(const TItemPos &Cell, uint16_t bCount=0);
- bool RemoveItem(const TItemPos &Cell, uint16_t bCount = 0);
- #else
- bool DropItem(const TItemPos &Cell, BYTE bCount=0);
- bool RemoveItem(const TItemPos &Cell, BYTE bCount = 0);
- #endif
- bool GiveRecallItem(LPITEM item);
- void ProcessRecallItem(LPITEM item);
- void EffectPacket(int enumEffectType);
- void SpecificEffectPacket(const char filename[128]);
- bool DoRefine(LPITEM item, bool bMoneyOnly = false
- #ifdef ENABLE_AUTO_REFINE
- , bool bAutoReopen = false
- #endif
- );
- bool DoRefineWithScroll(LPITEM item
- #ifdef ENABLE_AUTO_REFINE
- , bool autoReopen = false
- #endif
- );
- #ifdef ENABLE_AUTO_REFINE
- bool RefineInformation(CItem* item, BYTE bType, CItem* additionalItem = nullptr);
- void SetRefineMode(CItem* additionalItem);
- #else
- bool RefineInformation(uint16_t bCell, BYTE bType, int iAdditionalCell = -1);
- void SetRefineMode(int iAdditionalCell = -1);
- #endif
- void ClearRefineMode();
- bool GiveItem(LPCHARACTER victim, const TItemPos &Cell);
- bool CanReceiveItem(LPCHARACTER from, LPITEM item, bool ignoreDist = false) const;
- void ReceiveItem(LPCHARACTER from, LPITEM item);
- bool GiveItemFromSpecialItemGroup(DWORD dwGroupNum, std::vector <DWORD> &dwItemVnums, std::vector <DWORD> &dwItemCounts, std::vector <LPITEM> &item_gets, int &count);
- #ifdef ENABLE_EXTENDED_COUNT_ITEMS
- bool MoveItem(const TItemPos &pos, TItemPos change_pos, uint16_t num);
- #else
- bool MoveItem(const TItemPos &pos, TItemPos change_pos, BYTE num);
- #endif
- private:
- DWORD _LastPickupTime;
- public:
- DWORD LastPickupTime() const
- {
- return _LastPickupTime;
- }
- void SetLastPickupTime(DWORD time)
- {
- _LastPickupTime = time;
- }
- private:
- DWORD _LastDelayPotionTime;
- public:
- DWORD LastDelayPotionTime() const
- {
- return _LastDelayPotionTime;
- }
- void SetLastDelayPotionTime(DWORD time)
- {
- _LastDelayPotionTime = time;
- }
- bool PickupItem(DWORD vid);
- #ifdef ENABLE_SPECIAL_CHAT
- void SendPickupItemPacket(int item_vnum, BYTE bArg = 0);
- #endif
- bool EquipItem(LPITEM item, int iCandidateCell = -1);
- bool UnequipItem(LPITEM item);
- bool CanEquipNow(const LPITEM item, const TItemPos &srcCell = NPOS, const TItemPos &destCell = NPOS);
- bool CanUnequipNow(const LPITEM item, const TItemPos& swapCell = NPOS);
- bool SwapItem(uint16_t bCell, uint16_t bDestCell);
- #ifdef ENABLE_EXTENDED_COUNT_ITEMS
- LPITEM AutoGiveItem(DWORD dwItemVnum, uint16_t bCount = 1, int iRarePct = -1, bool bMsg = true);
- #else
- LPITEM AutoGiveItem(DWORD dwItemVnum, BYTE bCount = 1, int iRarePct = -1, bool bMsg = true);
- #endif
- #ifdef ENABLE_AUTOSTACK_EXCHANGE
- bool AutoGiveItem(LPITEM item, bool longOwnerShip = false, bool autoStack = false);
- #else
- void AutoGiveItem(LPITEM item, bool longOwnerShip = false);
- #endif
- int GetEmptyInventory(BYTE size) const;
- int GetEmptyInventoryCount(BYTE size) const;
- int GetEmptyDragonSoulInventory(LPITEM pItem, int iExceptCell = -1) const;
- int GetEmptyDragonSoulInventoryWithExceptions(LPITEM pItem, std::vector<uint16_t>& vec) const;
- #ifdef ENABLE_SPECIAL_STORAGE
- int GetEmptySkillBookInventory(BYTE size) const;
- int GetEmptyUpgradeItemsInventory(BYTE size) const;
- int GetEmptyStoneInventory(BYTE size) const;
- int GetEmptyBonusInventory(BYTE size) const;
- int GetEmptyChestInventory(BYTE size) const;
- #endif
- #ifdef __ENABLE_COMMON_DROP_IN_INVENTORY__
- bool NewAutoGiveStackDefaultInventory(LPITEM item);
- bool NewAutoGiveStackDragonSoulInventory(LPITEM item);
- #ifdef ENABLE_SPECIAL_STORAGE
- bool NewAutoGiveStackBookInventory(LPITEM item);
- bool NewAutoGiveStackUpgradeItemsInventory(LPITEM item);
- bool NewAutoGiveStackStoneInventory(LPITEM item);
- bool NewAutoGiveStackBonusInventory(LPITEM item);
- bool NewAutoGiveStackChestInventory(LPITEM item);
- #endif
- bool NewAutoGiveStack(LPITEM item);
- #endif
- /*** Ikarus function created for offlineshop & special inventory ***/
- bool CanTakeInventoryItem(LPITEM item, TItemPos* cell);
- /*** End ***/
- void CopyDragonSoulItemGrid(std::vector<uint16_t> &vDragonSoulItemGrid) const;
- int CountEmptyInventory() const;
- #ifdef ENABLE_PENDANT
- int CountSpecifyItem(DWORD vnum, int iExceptionCell = -1) const;
- void RemoveSpecifyItem(DWORD vnum, DWORD count = 1, int iExceptionCell = -1);
- #else
- int CountSpecifyItem(DWORD vnum) const;
- void RemoveSpecifyItem(DWORD vnum, DWORD count = 1);
- #endif
- LPITEM FindSpecifyItem(DWORD vnum) const;
- #ifdef ENABLE_QUIVER_SYSTEM
- LPITEM FindQuiver() const;
- LPITEM FindArrow() const;
- #endif
- LPITEM FindItemByID(DWORD id) const;
- int CountSpecifyTypeItem(BYTE type) const;
- void RemoveSpecifyTypeItem(BYTE type, DWORD count = 1);
- bool IsEquipUniqueItem(DWORD dwItemVnum) const;
- bool IsEquipUniqueGroup(DWORD dwGroupVnum) const;
- void SendEquipment(LPCHARACTER ch);
- #ifdef __ENABLE_NEW_OFFLINESHOP__
- public:
- offlineshop::CShop* GetOfflineShop() {return m_pkOfflineShop;}
- void SetOfflineShop(offlineshop::CShop* pkShop) {m_pkOfflineShop = pkShop;}
- offlineshop::CShop* GetOfflineShopGuest() {return m_pkOfflineShopGuest;}
- void SetOfflineShopGuest(offlineshop::CShop* pkShop) {m_pkOfflineShopGuest = pkShop;}
- offlineshop::CShopSafebox*
- GetShopSafebox() {return m_pkShopSafebox;}
- void SetShopSafebox(offlineshop::CShopSafebox* pk);
- void SetAuction(offlineshop::CAuction* pk) {m_pkAuction = pk;}
- void SetAuctionGuest(offlineshop::CAuction* pk) {m_pkAuctionGuest = pk;}
- offlineshop::CAuction* GetAuction() {return m_pkAuction;}
- offlineshop::CAuction* GetAuctionGuest() {return m_pkAuctionGuest;}
- void SetLookingOfflineshopOfferList(bool is) { m_bIsLookingOfflineshopOfferList = is; }
- bool IsLookingOfflineshopOfferList() { return m_bIsLookingOfflineshopOfferList; }
- private:
- offlineshop::CShop* m_pkOfflineShop;
- offlineshop::CShop* m_pkOfflineShopGuest;
- offlineshop::CShopSafebox* m_pkShopSafebox;
- offlineshop::CAuction* m_pkAuction;
- offlineshop::CAuction* m_pkAuctionGuest;
- bool m_bIsLookingOfflineshopOfferList;
- #endif
- protected:
- void SendMyShopPriceListCmd(DWORD dwItemVnum, DWORD dwItemPrice);
- bool m_bNoOpenedShop;
- bool m_bItemLoaded;
- int m_iRefineAdditionalCell;
- bool m_bUnderRefine;
- DWORD m_dwRefineNPCVID;
- #ifdef ENABLE_AUTO_REFINE
- TItemPos additionalItemPos_;
- #endif
- #ifdef ENABLE_ZODIAC_TEMPLE_SHOP
- public:
- long GetNewUnit() const
- {
- return m_NewUnit;
- }
- void SetNewUnit(long NewUnit);
- long GetPZ() const;
- void SetPZ(long NewUnit);
- protected:
- long m_NewUnit;
- public:
- uint16_t GetZodiacPoint() const
- {
- return m_points.zodiac_point;
- }
- void SetZodiacPoint(uint16_t zodiac_point)
- {
- m_points.zodiac_point = zodiac_point;
- }
- DWORD GetLastZodiacPointReward() const
- {
- return m_dwLastZodiacPointReward;
- }
- void SetLastZodiacPointReward(DWORD time)
- {
- m_dwLastZodiacPointReward = time;
- }
- protected:
- DWORD m_dwLastZodiacPointReward;
- #endif
- public:
- unsigned long long GetGold() const
- {
- return m_points.gold;
- }
- void SetGold(unsigned long long gold)
- {
- m_points.gold = gold;
- }
- bool DropGold(INT gold);
- unsigned long long GetAllowedGold() const;
- void GiveGold(INT iAmount);
- void ChangeGold(long long amount);
- #ifdef ENABLE_SORT_INVENTORY
- void SetNextSortInventoryPulse(int pulse)
- {
- m_sortInventoryPulse = pulse;
- }
- int GetSortInventoryPulse()
- {
- return m_sortInventoryPulse;
- }
- void SetNextSortSpecialStoragePulse(int pulse)
- {
- m_sortSpecialStoragePulse = pulse;
- }
- int GetSortSpecialStoragePulse()
- {
- return m_sortSpecialStoragePulse;
- }
- #endif
- #ifdef ENABLE_GAYA_SYSTEM
- INT GetGaya() const
- {
- return m_points.gaya;
- }
- void SetGaya(INT gaya)
- {
- m_points.gaya = gaya;
- }
- #endif
- #ifdef ENABLE_HYDRA_DUNGEON
- public:
- bool IsDefanceWaweMastAttackMob(DWORD dwMobVnum) const { return (dwMobVnum >= 3950 && dwMobVnum <= 3964); }
- #endif
- public:
- void SetShop(LPSHOP pkShop);
- LPSHOP GetShop() const
- {
- return m_pkShop;
- }
- void SetShopOwner(LPCHARACTER ch)
- {
- m_pkChrShopOwner = ch;
- }
- LPCHARACTER GetShopOwner() const
- {
- return m_pkChrShopOwner;
- }
- #ifdef ENABLE_EXTENDED_COUNT_ITEMS
- void OpenMyShop(const char* c_pszSign, TShopItemTable* pTable, uint16_t bItemCount);
- #else
- void OpenMyShop(const char* c_pszSign, TShopItemTable* pTable, BYTE bItemCount);
- #endif
- LPSHOP GetMyShop() const
- {
- return m_pkMyShop;
- }
- void CloseMyShop();
- protected:
- LPSHOP m_pkShop;
- LPSHOP m_pkMyShop;
- std::string m_stShopSign;
- LPCHARACTER m_pkChrShopOwner;
- #ifdef ENABLE_SORT_INVENTORY
- int m_sortInventoryPulse;
- int m_sortSpecialStoragePulse;
- #endif
- #ifdef ENABLE_SKILL_COLOR_SYSTEM
- public:
- void SetSkillColor(DWORD* dwSkillColor);
- DWORD* GetSkillColor() { return m_dwSkillColor[0]; }
- protected:
- DWORD m_dwSkillColor[ESkillColorLength::MAX_SKILL_COUNT + ESkillColorLength::MAX_BUFF_COUNT][ESkillColorLength::MAX_EFFECT_COUNT];
- #endif
- public:
- bool ExchangeStart(LPCHARACTER victim);
- void SetExchange(CExchange* pkExchange);
- CExchange* GetExchange() const
- {
- return m_pkExchange;
- }
- protected:
- CExchange* m_pkExchange;
- public:
- struct TBattleInfo
- {
- int iTotalDamage;
- #ifdef ENABLE_FAKE_PC
- int iTotalFakePCDamage;
- #endif
- int iAggro;
- #ifdef ENABLE_FAKE_PC
- TBattleInfo(int iTot, int iTotFakePC, int iAggr) : iTotalDamage(iTot), iTotalFakePCDamage(iTotFakePC), iAggro(iAggr)
- #else
- TBattleInfo(int iTot, int iAggr) : iTotalDamage(iTot), iAggro(iAggr)
- #endif
- {
- }
- };
- typedef std::map<VID, TBattleInfo> TDamageMap;
- typedef struct SAttackLog
- {
- DWORD dwVID;
- DWORD dwTime;
- } AttackLog;
- bool Damage(LPCHARACTER pAttacker, int dam, EDamageType type = DAMAGE_TYPE_NORMAL, DWORD skillVnum = 0);
- void DeathPenalty(BYTE bExpLossPercent);
- void ReviveInvisible(int iDur);
- bool Attack(LPCHARACTER pkVictim, BYTE bType = 0);
- bool IsAlive() const
- {
- return m_pointsInstant.position == POS_DEAD ? false : true;
- }
- bool CanFight() const;
- bool CanBeginFight() const;
- void BeginFight(LPCHARACTER pkVictim);
- #ifdef ENABLE_DAILY_BOSS
- int GetDamageByVid(DWORD dwTargetVID);
- void RegisterDamage(DWORD dwTargetVID, int iDamage);
- #endif
- bool IsStun() const;
- void Stun();
- bool IsDead() const;
- void Dead(LPCHARACTER pkKiller = NULL, bool bImmediateDead = false);
- #ifdef ENABLE_NEW_PET_SYSTEM
- void SetImmortal(int st)
- {
- m_stImmortalSt = st;
- }
- bool IsImmortal()
- {
- return 1 == m_stImmortalSt;
- }
- void SetNewPetSkillCD(int s, DWORD time)
- {
- m_newpetskillcd[s] = time;
- }
- DWORD GetNewPetSkillCD(int s)
- {
- return m_newpetskillcd[s];
- }
- #endif
- void SetNoRewardFlag()
- {
- SET_BIT(m_pointsInstant.instant_flag, INSTANT_FLAG_NO_REWARD);
- }
- void RemoveNoRewardFlag()
- {
- REMOVE_BIT(m_pointsInstant.instant_flag, INSTANT_FLAG_NO_REWARD);
- }
- bool HasNoRewardFlag() const
- {
- return IS_SET(m_pointsInstant.instant_flag, INSTANT_FLAG_NO_REWARD);
- }
- void Reward(bool bItemDrop);
- void RewardGold(LPCHARACTER pkAttacker);
- bool Shoot(BYTE bType);
- void FlyTarget(DWORD dwTargetVID, long x, long y, BYTE bHeader);
- void ForgetMyAttacker();
- void AggregateMonster();
- void AttractRanger();
- void PullMonster();
- int GetArrowAndBow(LPITEM* ppkBow, LPITEM* ppkArrow, int iArrowCount = 1);
- void UseArrow(LPITEM pkArrow, DWORD dwArrowCount);
- void AttackedByPoison(LPCHARACTER pkAttacker);
- void RemovePoison();
- #ifdef ENABLE_WOLFMAN
- void AttackedByBleeding(LPCHARACTER pkAttacker);
- void RemoveBleeding();
- #endif
- void AttackedByFire(LPCHARACTER pkAttacker, int amount, int count);
- void RemoveFire();
- void UpdateAlignment(int iAmount);
- int GetAlignment() const;
- int GetRealAlignment() const;
- void ShowAlignment(bool bShow);
- void SetKillerMode(bool bOn);
- bool IsKillerMode() const;
- void UpdateKillerMode();
- BYTE GetPKMode() const;
- void SetPKMode(BYTE bPKMode);
- void ItemDropPenalty(LPCHARACTER pkKiller);
- void UpdateAggrPoint(LPCHARACTER ch, EDamageType type, int dam);
- #ifdef ENABLE_AFTERDEATH_SHIELD
- public:
- void AddAfterdeathShield();
- void RemoveAfterdeathShield();
- bool IsAfterdeathShieldProtected();
- #endif
- #ifdef ENABLE_AFK_MODE_SYSTEM
- public:
- void SetAway(bool f)
- {
- m_isAway = f;
- }
- bool IsAway() const
- {
- return m_isAway;
- }
- void StartUpdateCharacterEvent();
- #endif
- public:
- DWORD GetSkipComboAttackByTime() const;
- protected:
- BYTE m_bComboIndex;
- DWORD m_dwSkipComboAttackByTime;
- protected:
- void UpdateAggrPointEx(LPCHARACTER ch, EDamageType type, int dam, TBattleInfo &info);
- void ChangeVictimByAggro(int iNewAggro, LPCHARACTER pNewVictim);
- DWORD m_dwFlyTargetID;
- std::vector<DWORD> m_vec_dwFlyTargets;
- TDamageMap m_map_kDamage;
- DWORD m_dwKillerPID;
- int m_iAlignment;
- int m_iRealAlignment;
- int m_iKillerModePulse;
- BYTE m_bPKMode;
- DWORD m_dwLastVictimSetTime;
- int m_iMaxAggro;
- public:
- void SetStone(LPCHARACTER pkChrStone);
- void ClearStone();
- void DetermineDropMetinStone();
- DWORD GetDropMetinStoneVnum() const
- {
- return m_dwDropMetinStone;
- }
- BYTE GetDropMetinStonePct() const
- {
- return m_bDropMetinStonePct;
- }
- protected:
- LPCHARACTER m_pkChrStone;
- CHARACTER_SET m_set_pkChrSpawnedBy;
- DWORD m_dwDropMetinStone;
- BYTE m_bDropMetinStonePct;
- public:
- void SkillLevelPacket();
- #ifdef ENABLE_678TH_SKILL
- bool SkillCanUp(DWORD dwVnum);
- #endif
- void SkillLevelUp(DWORD dwVnum, BYTE bMethod = SKILL_UP_BY_POINT);
- bool SkillLevelDown(DWORD dwVnum);
- bool UseSkill(DWORD dwVnum, LPCHARACTER pkVictim, bool bUseGrandMaster = true);
- void ResetSkill();
- void SetSkillLevel(DWORD dwVnum, BYTE bLev);
- int GetUsedSkillMasterType(DWORD dwVnum);
- #ifdef SKILL_COOLTIME_UPDATE
- void ResetSkillCoolTimes();
- #endif
- bool IsLearnableSkill(DWORD dwSkillVnum) const;
- bool CheckSkillHitCount(const BYTE SkillID, const VID &dwTargetVID);
- bool CanUseSkill(DWORD dwSkillVnum) const;
- bool IsUsableSkillMotion(DWORD dwMotionIndex) const;
- int GetSkillLevel(DWORD dwVnum) const;
- int GetSkillMasterType(DWORD dwVnum) const;
- int GetSkillPower(DWORD dwVnum, BYTE bLevel = 0) const;
- time_t GetSkillNextReadTime(DWORD dwVnum) const;
- void SetSkillNextReadTime(DWORD dwVnum, time_t time);
- void SkillLearnWaitMoreTimeMessage(DWORD dwVnum);
- void ComputePassiveSkill(DWORD dwVnum);
- int ComputeSkill(DWORD dwVnum, LPCHARACTER pkVictim, BYTE bSkillLevel = 0);
- int ComputeSkillParty(DWORD dwVnum, LPCHARACTER pkVictim, BYTE bSkillLevel = 0);
- int ComputeSkillAtPosition(DWORD dwVnum, const PIXEL_POSITION &posTarget, BYTE bSkillLevel = 0);
- void ComputeSkillPoints();
- void SetSkillGroup(BYTE bSkillGroup);
- #if defined(ENABLE_FAKE_PC) || defined(ENABLE_FAKE_BUFF)
- BYTE GetSkillGroup() const
- {
- return FakePC_Check() ? FakePC_GetOwner()->m_points.skill_group : m_points.skill_group;
- }
- #else
- BYTE GetSkillGroup() const
- {
- return m_points.skill_group;
- }
- #endif
- int ComputeCooltime(int time);
- void GiveRandomSkillBook();
- void DisableCooltime();
- bool LearnSkillByBook(DWORD dwSkillVnum, BYTE bProb = 0);
- bool LearnGrandMasterSkill(DWORD dwSkillVnum);
- #ifdef ENABLE_SKILLS_LEVEL_OVER_P
- bool LearnLegendaryMasterSkill(DWORD dwSkillVnum);
- #endif
- private:
- bool m_bDisableCooltime;
- DWORD m_dwLastSkillTime;
- public:
- bool HasMobSkill() const;
- size_t CountMobSkill() const;
- const TMobSkillInfo* GetMobSkill(unsigned int idx) const;
- bool CanUseMobSkill(unsigned int idx) const;
- bool UseMobSkill(unsigned int idx);
- void ResetMobSkillCooltime();
- protected:
- DWORD m_adwMobSkillCooltime[MOB_SKILL_MAX_NUM];
- public:
- void StartMuyeongEvent();
- void StopMuyeongEvent();
- private:
- LPEVENT m_pkMuyeongEvent;
- public:
- int GetChainLightningIndex() const
- {
- return m_iChainLightingIndex;
- }
- void IncChainLightningIndex()
- {
- ++m_iChainLightingIndex;
- }
- void AddChainLightningExcept(LPCHARACTER ch)
- {
- m_setExceptChainLighting.insert(ch);
- }
- void ResetChainLightningIndex()
- {
- m_iChainLightingIndex = 0;
- m_setExceptChainLighting.clear();
- }
- int GetChainLightningMaxCount() const;
- const CHARACTER_SET &GetChainLightingExcept() const
- {
- return m_setExceptChainLighting;
- }
- private:
- int m_iChainLightingIndex;
- CHARACTER_SET m_setExceptChainLighting;
- public:
- void SetAffectedEunhyung();
- void ClearAffectedEunhyung()
- {
- m_dwAffectedEunhyungLevel = 0;
- }
- bool GetAffectedEunhyung() const
- {
- return m_dwAffectedEunhyungLevel != 0;
- }
- private:
- DWORD m_dwAffectedEunhyungLevel;
- #ifdef __ADMIN_MANAGER__
- public:
- const TPlayerSkill* GetPlayerSkills() const { return m_pSkillLevels; }
- #endif
- protected:
- TPlayerSkill* m_pSkillLevels;
- std::unordered_map<BYTE, int> m_SkillDamageBonus;
- std::map<int, TSkillUseInfo> m_SkillUseInfo;
- public:
- void AssignTriggers(const TMobTable* table);
- LPCHARACTER GetVictim() const;
- void SetVictim(LPCHARACTER pkVictim);
- #ifdef ENABLE_FAKE_PC
- bool IsNoVictimChangeMode() { return !m_bCanChangeVictim; }
- bool m_bCanChangeVictim;
- #endif
- LPCHARACTER GetNearestVictim(LPCHARACTER pkChr);
- LPCHARACTER GetProtege() const;
- bool Follow(LPCHARACTER pkChr, float fMinimumDistance = 150.0f);
- bool Return(bool bCreatePosition = false);
- bool IsGuardNPC() const;
- bool IsChangeAttackPosition(LPCHARACTER target) const;
- void ResetChangeAttackPositionTime()
- {
- m_dwLastChangeAttackPositionTime = get_dword_time() - AI_CHANGE_ATTACK_POISITION_TIME_NEAR;
- }
- void SetChangeAttackPositionTime()
- {
- m_dwLastChangeAttackPositionTime = get_dword_time();
- }
- bool OnIdle();
- void OnAttack(LPCHARACTER pkChrAttacker);
- void OnClick(LPCHARACTER pkChrCauser);
- VID m_kVIDVictim;
- protected:
- DWORD m_dwLastChangeAttackPositionTime;
- CTrigger m_triggerOnClick;
- protected:
- LPCHARACTER m_pkChrTarget;
- CHARACTER_SET m_set_pkChrTargetedBy;
- #ifdef ENABLE_FAKE_PC
- public:
- void SetComboSequence(BYTE seq);
- BYTE GetComboSequence() const;
- void SetLastComboTime(DWORD time);
- DWORD GetLastComboTime() const;
- int GetValidComboInterval() const;
- void SetValidComboInterval(int interval);
- protected:
- BYTE m_bComboSequence;
- DWORD m_dwLastComboTime;
- int m_iValidComboInterval;
- #endif
- public:
- void SetTarget(LPCHARACTER pkChrTarget);
- void BroadcastTargetPacket();
- void ClearTarget();
- void CheckTarget();
- LPCHARACTER GetTarget() const
- {
- return m_pkChrTarget;
- }
- public:
- int GetSafeboxSize() const;
- void QuerySafeboxSize();
- void SetSafeboxSize(int size);
- CSafebox* GetSafebox() const;
- void LoadSafebox(int iSize, DWORD dwGold, int iItemCount, TPlayerItem* pItems);
- void ChangeSafeboxSize(BYTE bSize);
- void CloseSafebox();
- void ReqSafeboxLoad(const char* pszPassword);
- void CancelSafeboxLoad(void)
- {
- m_bOpeningSafebox = false;
- }
- void SetMallLoadTime(int t)
- {
- m_iMallLoadTime = t;
- }
- int GetMallLoadTime() const
- {
- return m_iMallLoadTime;
- }
- CSafebox* GetMall() const;
- void LoadMall(int iItemCount, TPlayerItem* pItems);
- void CloseMall();
- void SetSafeboxOpenPosition();
- float GetDistanceFromSafeboxOpen() const;
- protected:
- CSafebox* m_pkSafebox;
- int m_iSafeboxSize;
- int m_iSafeboxLoadTime;
- bool m_bOpeningSafebox;
- CSafebox* m_pkMall;
- int m_iMallLoadTime;
- PIXEL_POSITION m_posSafeboxOpen;
- public:
- void MountVnum(DWORD vnum);
- #ifdef ENABLE_FAKE_PC
- DWORD GetMountVnum() const
- {
- return FakePC_Check() ? FakePC_GetOwner()->m_dwMountVnum : m_dwMountVnum;
- }
- #else
- DWORD GetMountVnum() const
- {
- return m_dwMountVnum;
- }
- #endif
- DWORD GetLastMountTime() const
- {
- return m_dwMountTime;
- }
- bool CanUseHorseSkill();
- virtual void SetHorseLevel(int iLevel);
- virtual bool StartRiding();
- virtual bool StopRiding();
- virtual DWORD GetMyHorseVnum() const;
- virtual void HorseDie();
- virtual bool ReviveHorse();
- virtual void SendHorseInfo();
- virtual void ClearHorseInfo();
- void HorseSummon(bool bSummon, bool bFromFar = false, DWORD dwVnum = 0, const char* name = 0);
- LPCHARACTER GetHorse() const
- {
- return m_chHorse;
- }
- LPCHARACTER GetRider() const;
- void SetRider(LPCHARACTER ch);
- bool IsRiding() const;
- public:
- CPetSystem* GetPetSystem()
- {
- return m_petSystem;
- }
- protected:
- CPetSystem* m_petSystem;
- #ifdef ENABLE_NEW_PET_SYSTEM
- public:
- CNewPetSystem* GetNewPetSystem()
- {
- return m_newpetSystem;
- }
- protected:
- CNewPetSystem* m_newpetSystem;
- #endif
- protected:
- LPCHARACTER m_chHorse;
- LPCHARACTER m_chRider;
- DWORD m_dwMountVnum;
- DWORD m_dwMountTime;
- BYTE m_bSendHorseLevel;
- BYTE m_bSendHorseHealthGrade;
- BYTE m_bSendHorseStaminaGrade;
- #ifdef ENABLE_AFK_MODE_SYSTEM
- bool m_isAway;
- #endif
- public:
- void DetailLog()
- {
- m_bDetailLog = !m_bDetailLog;
- }
- void ToggleMonsterLog();
- void MonsterLog(const char* format, ...);
- private:
- bool m_bDetailLog;
- bool m_bMonsterLog;
- public:
- void SetEmpire(BYTE bEmpire);
- BYTE GetEmpire() const
- {
- return m_bEmpire;
- }
- protected:
- BYTE m_bEmpire;
- public:
- void SetRegen(LPREGEN pkRegen);
- protected:
- PIXEL_POSITION m_posRegen;
- float m_fRegenAngle;
- LPREGEN m_pkRegen;
- size_t regen_id_;
- public:
- bool CannotMoveByAffect() const;
- bool IsImmune(DWORD dwImmuneFlag);
- void SetImmuneFlag(DWORD dw)
- {
- m_pointsInstant.dwImmuneFlag = dw;
- }
- protected:
- void ApplyMobAttribute(const TMobTable* table);
- public:
- void SetQuestNPCID(DWORD vid);
- DWORD GetQuestNPCID() const
- {
- return m_dwQuestNPCVID;
- }
- LPCHARACTER GetQuestNPC() const;
- void SetQuestItemPtr(LPITEM item);
- void ClearQuestItemPtr();
- LPITEM GetQuestItemPtr() const;
- void SetQuestBy(DWORD dwQuestVnum)
- {
- m_dwQuestByVnum = dwQuestVnum;
- }
- DWORD GetQuestBy() const
- {
- return m_dwQuestByVnum;
- }
- int GetQuestFlag(const std::string &flag) const;
- void SetQuestFlag(const std::string &flag, int value);
- void ConfirmWithMsg(const char* szMsg, int iTimeout, DWORD dwRequestPID);
- private:
- DWORD m_dwQuestNPCVID;
- DWORD m_dwQuestByVnum;
- LPITEM m_pQuestItem;
- public:
- bool StartStateMachine(int iPulse = 1);
- void StopStateMachine();
- void UpdateStateMachine(DWORD dwPulse);
- void SetNextStatePulse(int iPulseNext);
- void UpdateCharacter(DWORD dwPulse);
- protected:
- DWORD m_dwNextStatePulse;
- public:
- LPCHARACTER GetMarryPartner() const;
- void SetMarryPartner(LPCHARACTER ch);
- int GetMarriageBonus(DWORD dwItemVnum, bool bSum = true);
- void SetWeddingMap(WeddingMap* pMap);
- WeddingMap* GetWeddingMap() const
- {
- return m_pWeddingMap;
- }
- private:
- WeddingMap* m_pWeddingMap;
- LPCHARACTER m_pkChrMarried;
- public:
- void StartWarpNPCEvent();
- public:
- void StartSaveEvent();
- void StartRecoveryEvent();
- void StartDestroyWhenIdleEvent();
- LPEVENT m_pkDeadEvent;
- LPEVENT m_pkStunEvent;
- LPEVENT m_pkSaveEvent;
- LPEVENT m_pkRecoveryEvent;
- LPEVENT m_pkTimedEvent;
- LPEVENT m_pkFishingEvent;
- LPEVENT m_pkAffectEvent;
- LPEVENT m_pkPoisonEvent;
- LPEVENT m_pkChangeChannelEvent;
- #ifdef ENABLE_WOLFMAN
- LPEVENT m_pkBleedEvent;
- #endif
- LPEVENT m_pkFireEvent;
- LPEVENT m_pkDecayEvent;
- LPEVENT m_pkWarpNPCEvent;
- LPEVENT m_pkMiningEvent;
- LPEVENT m_pkWarpEvent;
- LPEVENT m_pkDestroyWhenIdleEvent;
- LPEVENT m_pkPetSystemUpdateEvent;
- #ifdef ENABLE_NEW_PET_SYSTEM
- LPEVENT m_pkNewPetSystemUpdateEvent;
- LPEVENT m_pkNewPetSystemExpireEvent;
- #endif
- LPEVENT m_pkChannelChangeEvent;
- #ifdef ENABLE_AFK_MODE_SYSTEM
- LPEVENT m_pkUpdateCharacter;
- #endif
- #ifdef ENABLE_BOSS_TRACKING
- LPEVENT m_pkUpdateBossTracking;
- #endif
- bool IsWarping() const
- {
- return m_pkWarpEvent ? true : false;
- }
- bool m_bHasPoisoned;
- #ifdef ENABLE_WOLFMAN
- bool m_bHasBleeded;
- #endif
- const CMob* m_pkMobData;
- CMobInstance* m_pkMobInst;
- bool _canRegenHP;
- std::map<int, LPEVENT> m_mapMobSkillEvent;
- friend struct FuncSplashDamage;
- friend struct FuncSplashAffect;
- friend class CFuncShoot;
- public:
- bool CanRegenHP()
- {
- return _canRegenHP;
- }
- void CanRegenHP(bool value)
- {
- _canRegenHP = value;
- }
- int GetPremiumRemainSeconds(BYTE bType) const;
- private:
- int m_aiPremiumTimes[PREMIUM_MAX_NUM];
- public:
- bool ItemProcess_Hair(LPITEM item, int iDestCell);
- public:
- void ClearSkill();
- void ClearSubSkill();
- bool ResetOneSkill(DWORD dwVnum);
- #ifdef ENABLE_RUNE_SYSTEM
- public:
- void SendDamagePacket(LPCHARACTER pAttacker, int Damage, BYTE DamageFlag);
- #else
- private:
- void SendDamagePacket(LPCHARACTER pAttacker, int Damage, BYTE DamageFlag);
- #endif
- private:
- CArena* m_pArena;
- bool m_ArenaObserver;
- int m_nPotionLimit;
- public:
- void SetArena(CArena* pArena)
- {
- m_pArena = pArena;
- }
- void SetArenaObserverMode(bool flag)
- {
- m_ArenaObserver = flag;
- }
- CArena* GetArena() const
- {
- return m_pArena;
- }
- bool GetArenaObserverMode() const
- {
- return m_ArenaObserver;
- }
- void SetPotionLimit(int count)
- {
- m_nPotionLimit = count;
- }
- int GetPotionLimit() const
- {
- return m_nPotionLimit;
- }
- public:
- bool IsOpenSafebox() const
- {
- return m_isOpenSafebox ? true : false;
- }
- void SetOpenSafebox(bool b)
- {
- m_isOpenSafebox = b;
- }
- int GetSafeboxLoadTime() const
- {
- return m_iSafeboxLoadTime;
- }
- void SetSafeboxLoadTime()
- {
- m_iSafeboxLoadTime = thecore_pulse();
- }
- private:
- bool m_isOpenSafebox;
- public:
- int GetSkillPowerByLevel(int level, bool bMob = false) const;
- int GetRefineTime() const
- {
- return m_iRefineTime;
- }
- void SetRefineTime()
- {
- m_iRefineTime = thecore_pulse();
- }
- int m_iRefineTime;
- int GetUseSeedOrMoonBottleTime() const
- {
- return m_iSeedTime;
- }
- void SetUseSeedOrMoonBottleTime()
- {
- m_iSeedTime = thecore_pulse();
- }
- int m_iSeedTime;
- int GetExchangeTime() const
- {
- return m_iExchangeTime;
- }
- void SetExchangeTime()
- {
- m_iExchangeTime = thecore_pulse();
- }
- int m_iExchangeTime;
- int m_iMyShopTime;
- int GetMyShopTime() const
- {
- return m_iMyShopTime;
- }
- void SetMyShopTime()
- {
- m_iMyShopTime = thecore_pulse();
- }
- bool IsHack(bool bSendMsg = true, bool bCheckShopOwner = true, int limittime = g_nPortalLimitTime);
- void Say(const std::string & s);
- void ChangeChannel(DWORD channelId);
- public:
- bool ItemProcess_Polymorph(LPITEM item);
- LPITEM* GetCubeItem()
- {
- return m_pointsInstant.pCubeItems;
- }
- bool IsCubeOpen() const
- {
- return (m_pointsInstant.pCubeNpc ? true : false);
- }
- void SetCubeNpc(LPCHARACTER npc)
- {
- m_pointsInstant.pCubeNpc = npc;
- }
- bool CanDoCube() const;
- private:
- int m_deposit_pulse;
- public:
- void UpdateDepositPulse();
- bool CanDeposit() const;
- private:
- void OpenPrivateShop();
- public:
- struct AttackedLog
- {
- DWORD dwPID;
- DWORD dwAttackedTime;
- AttackedLog()
- : dwPID(0)
- , dwAttackedTime(0)
- {
- }
- };
- AttackLog m_kAttackLog;
- AttackedLog m_AttackedLog;
- private:
- std::string m_strNewName;
- public:
- const std::string GetNewName() const
- {
- return this->m_strNewName;
- }
- void SetNewName(const std::string &name)
- {
- this->m_strNewName = name;
- }
- public:
- void GoHome();
- private:
- std::set<DWORD> m_known_guild;
- public:
- void SendGuildName(CGuild* pGuild);
- void SendGuildName(DWORD dwGuildID);
- private:
- DWORD m_dwLogOffInterval;
- DWORD m_dwLastPlay;
- public:
- DWORD GetLogOffInterval() const
- {
- return m_dwLogOffInterval;
- }
- DWORD GetLastPlay() const
- {
- return m_dwLastPlay;
- }
- public:
- bool UnEquipSpecialRideUniqueItem();
- bool CanWarp() const;
- bool IsInSafezone() const;
- private:
- DWORD m_dwLastGoldDropTime;
- public:
- void AutoRecoveryItemProcess(const EAffectTypes);
- public:
- void BuffOnAttr_AddBuffsFromItem(LPITEM pItem);
- void BuffOnAttr_RemoveBuffsFromItem(LPITEM pItem);
- private:
- void BuffOnAttr_ValueChange(BYTE bType, BYTE bOldValue, BYTE bNewValue);
- void BuffOnAttr_ClearAll();
- typedef std::map <BYTE, CBuffOnAttributes*> TMapBuffOnAttrs;
- TMapBuffOnAttrs m_map_buff_on_attrs;
- public:
- void SetInvincible()
- {
- cannot_dead = true;
- }
- void ResetInvincible()
- {
- cannot_dead = false;
- }
- private:
- bool cannot_dead;
- private:
- bool m_bIsPet;
- public:
- void SetPet()
- {
- m_bIsPet = true;
- }
- #ifdef ENABLE_FAKE_PC
- bool IsPet() const
- {
- return m_bIsPet ? true : false;
- }
- #else
- bool IsPet()
- {
- return m_bIsPet;
- }
- #endif
- private:
- float m_fAttMul;
- float m_fDamMul;
- public:
- float GetAttMul()
- {
- return this->m_fAttMul;
- }
- void SetAttMul(float newAttMul)
- {
- this->m_fAttMul = newAttMul;
- }
- float GetDamMul()
- {
- return this->m_fDamMul;
- }
- void SetDamMul(float newDamMul)
- {
- this->m_fDamMul = newDamMul;
- }
- private:
- bool IsValidItemPosition(const TItemPos &Pos) const;
- public:
- void DragonSoul_Initialize();
- bool DragonSoul_IsQualified() const;
- void DragonSoul_GiveQualification();
- int DragonSoul_GetActiveDeck() const;
- bool DragonSoul_IsDeckActivated() const;
- bool DragonSoul_ActivateDeck(int deck_idx);
- void DragonSoul_DeactivateAll();
- void DragonSoul_CleanUp();
- public:
- bool DragonSoul_RefineWindow_Open(LPENTITY pEntity);
- bool DragonSoul_RefineWindow_Close();
- LPENTITY DragonSoul_RefineWindow_GetOpener()
- {
- return m_pointsInstant.m_pDragonSoulRefineWindowOpener;
- }
- bool DragonSoul_RefineWindow_CanRefine();
- private:
- unsigned int itemAward_vnum;
- char itemAward_cmd[20];
- public:
- unsigned int GetItemAward_vnum()
- {
- return itemAward_vnum;
- }
- char* GetItemAward_cmd()
- {
- return itemAward_cmd;
- }
- void SetItemAward_vnum(unsigned int vnum)
- {
- itemAward_vnum = vnum;
- }
- void SetItemAward_cmd(char* cmd)
- {
- strcpy(itemAward_cmd, cmd);
- }
- private:
- timeval m_tvLastSyncTime;
- public:
- void SetLastSyncTime(const timeval &tv)
- {
- memcpy(&m_tvLastSyncTime, &tv, sizeof(timeval));
- }
- const timeval &GetLastSyncTime()
- {
- return m_tvLastSyncTime;
- }
- public:
- spActivityHandler GetActivityHandler()
- {
- return m_activityHandler;
- }
- int GetActivity() const;
- void LoadActivity(TActivityTable* data);
- private:
- spActivityHandler m_activityHandler;
- public:
- void ApplyOnDuels(std::function<void(CPVP*)> f);
- public:
- CEntity::ENTITY_MAP GetViewMap() const
- {
- return m_map_view;
- }
- private:
- std::shared_ptr<CInventory> m_inventory;
- public:
- std::shared_ptr<CInventory> GetInventory()
- {
- return m_inventory;
- };
- #ifdef ENABLE_NEW_PET_SYSTEM
- private:
- bool m_bIsNewPet;
- int m_eggvid;
- public:
- void SetNewPet()
- {
- m_bIsNewPet = true;
- }
- bool IsNewPet() const
- {
- return m_bIsNewPet ? true : false;
- }
- void SetEggVid (int vid)
- {
- m_eggvid = vid;
- }
- int GetEggVid()
- {
- return m_eggvid;
- }
- #endif
- #ifdef ENABLE_NEW_ICEDAMAGE_SYSTEM
- private:
- DWORD m_dwNDRFlag;
- std::set<DWORD> m_setNDAFlag;
- public:
- const DWORD GetNoDamageRaceFlag();
- void SetNoDamageRaceFlag (DWORD dwRaceFlag);
- void UnsetNoDamageRaceFlag (DWORD dwRaceFlag);
- void ResetNoDamageRaceFlag();
- const std::set<DWORD> & GetNoDamageAffectFlag();
- void SetNoDamageAffectFlag (DWORD dwAffectFlag);
- void UnsetNoDamageAffectFlag (DWORD dwAffectFlag);
- void ResetNoDamageAffectFlag();
- #endif
- #ifdef ENABLE_BATTLE_PASS
- public:
- void LoadBattlePass(DWORD dwCount, TPlayerBattlePassMission * data);
- DWORD GetMissionProgress(DWORD dwMissionID, DWORD dwBattlePassID);
- void UpdateMissionProgress(DWORD dwMissionID, DWORD dwBattlePassID, DWORD dwUpdateValue, DWORD dwTotalValue, bool isOverride = false);
- bool IsCompletedMission(BYTE bMissionType);
- bool IsLoadedBattlePass() const { return m_bIsLoadedBattlePass; }
- BYTE GetBattlePassId();
- private:
- bool m_bIsLoadedBattlePass;
- std::list<TPlayerBattlePassMission *> m_listBattlePass;
- #endif
- #ifdef ENABLE_SHOULDER_SASH_SYSTEM
- protected:
- bool m_bSashCombination, m_bSashAbsorption;
- public:
- bool isSashOpened (bool bCombination)
- {
- return bCombination ? m_bSashCombination : m_bSashAbsorption;
- }
- void OpenSash (bool bCombination);
- void CloseSash();
- void ClearSashMaterials();
- bool CleanSashAttr (LPITEM pkItem, LPITEM pkTarget);
- LPITEM* GetSashMaterials()
- {
- return m_pointsInstant.pSashMaterials;
- }
- bool SashIsSameGrade (long lGrade);
- DWORD GetSashCombinePrice (long lGrade);
- void GetSashCombineResult (DWORD & dwItemVnum, DWORD & dwMinAbs, DWORD & dwMaxAbs);
- BYTE CheckEmptyMaterialSlot();
- void AddSashMaterial (TItemPos tPos, BYTE bPos);
- void RemoveSashMaterial (BYTE bPos);
- BYTE CanRefineSashMaterials();
- void RefineSashMaterials();
- bool IsUpgradingSash()
- {
- return m_bSashCombination || m_bSashAbsorption;
- }
- #endif
- #ifdef ENABLE_GAYA_SYSTEM
- public:
- struct Gaya_Shop_Values
- {
- int value_1;
- int value_2;
- int value_3;
- int value_4;
- int value_5;
- int value_6;
- bool operator == (const Gaya_Shop_Values& b)
- {
- return (this->value_1 == b.value_1) && (this->value_2 == b.value_2) &&
- (this->value_3 == b.value_3) && (this->value_4 == b.value_4) &&
- (this->value_5 == b.value_5) && (this->value_6 == b.value_6);
- }
- };
- struct Gaya_Load_Values
- {
- DWORD items;
- DWORD gaya;
- DWORD count;
- DWORD glimmerstone;
- DWORD gaya_expansion;
- DWORD gaya_refresh;
- DWORD glimmerstone_count;
- DWORD gaya_expansion_count;
- DWORD gaya_refresh_count;
- DWORD grade_stone;
- DWORD give_gaya;
- DWORD prob_gaya;
- DWORD cost_gaya_yang;
- };
- bool CheckItemsFull();
- void UpdateItemsGayaMarker0();
- void UpdateItemsGayaMarker();
- void InfoGayaMarker();
- void ClearGayaMarket();
- bool CheckSlotGayaMarket(int slot);
- void UpdateSlotGayaMarket(int slot);
- void BuyItemsGayaMarket(int slot);
- void RefreshItemsGayaMarket();
- void CraftGayaItems(int slot);
- void MarketGayaItems(int slot);
- void RefreshGayaItems();
- void LOAD_GAYA();
- int GetGayaState(const std::string& state) const;
- void SetGayaState(const std::string& state, int szValue);
- void StartCheckTimeMarket();
- void StartCheckTimeMarketLogin();
- private:
- std::vector<Gaya_Shop_Values> info_items;
- std::vector<Gaya_Shop_Values> info_slots;
- std::vector<Gaya_Load_Values> load_gaya_items;
- Gaya_Load_Values load_gaya_values;
- LPEVENT GayaUpdateTime;
- #endif
- #ifdef ENABLE_HIDE_COSTUME_PART
- public:
- void UpdateCostumeVisibilityStatus();
- #endif
- public:
- DWORD GetMotionModeBySubType(BYTE bSubType) const;
- #if defined(ENABLE_FAKE_PC) || defined(ENABLE_FAKE_BUFF)
- private:
- DWORD m_dwLastSkillVnum;
- public:
- const DWORD* GetUsableSkillList() const;
- #endif
- #ifdef ENABLE_FAKE_BUFF
- public:
- LPCHARACTER GetFollowing() const { return m_pkFollowOwner; }
- void RemoveFollower(LPCHARACTER pkChr) { m_set_Follower.erase(pkChr); }
- private:
- LPCHARACTER m_pkFollowOwner;
- std::set<LPCHARACTER> m_set_Follower;
- #endif
- #ifdef ENABLE_FAKE_PC
- public:
- // init & destroy
- void FakePC_Load(LPCHARACTER pkOwner, LPITEM pkSpawnItem = NULL);
- void FakePC_Destroy();
- DWORD GetImmuneFlag() const
- {
- return m_pointsInstant.dwImmuneFlag;
- }
- // set & get
- LPCHARACTER FakePC_GetOwner()
- {
- return m_pkFakePCOwner;
- }
- const LPCHARACTER FakePC_GetOwner() const
- {
- return m_pkFakePCOwner;
- }
- LPITEM FakePC_GetOwnerItem()
- {
- return m_pkFakePCSpawnItem;
- }
- bool FakePC_Check() const
- {
- return m_pkFakePCOwner != NULL;
- }
- bool FakePC_IsSupporter() const
- {
- return FakePC_Check();
- }
- float FakePC_GetDamageFactor()
- {
- return m_fFakePCDamageFactor;
- }
- const char* FakePC_Owner_GetName() const
- {
- return m_stFakePCName.c_str();
- }
- void FakePC_Owner_ResetAfkEvent();
- void FakePC_Owner_ClearAfkEvent();
- bool FakePC_CanAddAffect(CAffect* pkAff);
- void FakePC_AddAffect(CAffect* pkAff);
- void FakePC_RemoveAffect(CAffect* pkAff);
- void FakePC_Owner_AddSpawned(LPCHARACTER pkFakePC, LPITEM pkSpawnItem = NULL);
- bool FakePC_Owner_RemoveSpawned(LPCHARACTER pkFakePC);
- bool FakePC_Owner_RemoveSpawned(LPITEM pkSpawnItem);
- LPCHARACTER FakePC_Owner_GetSupporter();
- LPCHARACTER FakePC_Owner_GetSupporterByItem(LPITEM pkItem);
- DWORD FakePC_Owner_CountSummonedByItem();
- void FakePC_Owner_AddAffect(CAffect* pkAff);
- void FakePC_Owner_RemoveAffect(CAffect* pkAff);
- // compute bonus/values/damage
- void FakePC_Owner_ApplyPoint(BYTE bType, int lValue);
- void FakePC_Owner_ItemPoints(LPITEM pkItem, bool bAdd);
- void FakePC_ComputeDamageFactor();
- // spawn
- LPCHARACTER FakePC_Owner_Spawn(int lX, int lY, LPITEM pkItem = NULL, bool bIsEnemy = false, bool bIsRedPotionEnabled = true);
- void FakePC_Owner_DespawnAll();
- bool FakePC_Owner_DespawnAllSupporter();
- bool FakePC_Owner_DespawnByItem(LPITEM pkItem);
- // attack
- void FakePC_Owner_ForceFocus(LPCHARACTER pkVictim);
- BYTE FakePC_ComputeComboIndex();
- void FakePC_SetNoAttack()
- {
- m_bIsNoAttackFakePC = true;
- }
- bool FakePC_CanAttack() const
- {
- return !m_bIsNoAttackFakePC;
- }
- //todebug
- template <class ...Ditto>
- void FakePC_ChatPacket(Ditto... args)
- {
- if (FakePC_GetOwner())
- {
- FakePC_GetOwner()->ChatPacket(CHAT_TYPE_INFO, args...);
- }
- }
- // skills
- bool FakePC_IsSkillNeeded(CSkillProto* pkSkill);
- bool FakePC_IsBuffSkill(DWORD dwVnum);
- bool FakePC_UseSkill(LPCHARACTER pkTarget = NULL);
- void FakePC_SendSkillPacket(CSkillProto* pkSkill);
- // exec func for all fake pcs
- void FakePC_Owner_ExecFunc(void(CHARACTER::* func)());
- private:
- std::string m_stFakePCName;
- LPEVENT m_pkFakePCAfkEvent;
- LPCHARACTER m_pkFakePCOwner;
- std::set<LPCHARACTER> m_set_pkFakePCSpawns;
- LPITEM m_pkFakePCSpawnItem;
- std::map<LPITEM, LPCHARACTER> m_map_pkFakePCSpawnItems;
- std::map<CAffect*, CAffect*> m_map_pkFakePCAffects;
- float m_fFakePCDamageFactor;
- bool m_bIsNoAttackFakePC;
- public:
- bool CanUseHPPotion() const;
- bool IsNoDamage() const;
- void StopAutoRecovery(const EAffectTypes type);
- void DisableHealPotions() { m_bDisabledHealPotion = true; StopAutoRecovery(AFFECT_AUTO_HP_RECOVERY); }
- bool IsHealPotionDisabled() const { return m_bDisabledHealPotion; }
- private:
- bool m_bDisabledHealPotion;
- #endif
- #ifdef ENABLE_FAKE_BUFF
- public:
- // init & destroy
- void FakeBuff_Load(LPCHARACTER pkOwner, LPITEM pkSpawnItem);
- void FakeBuff_Destroy();
- // set & get
- bool FakeBuff_Check() const
- {
- return m_pkFakeBuffOwner != NULL;
- }
- LPCHARACTER FakeBuff_GetOwner()
- {
- return m_pkFakeBuffOwner;
- }
- const LPCHARACTER FakeBuff_GetOwner() const
- {
- return m_pkFakeBuffOwner;
- }
- LPITEM FakeBuff_GetItem()
- {
- return m_pkFakeBuffItem;
- }
- LPCHARACTER FakeBuff_Owner_GetSpawn()
- {
- return m_pkFakeBuffSpawn;
- }
- const char* FakeBuff_Owner_GetName() const
- {
- return m_stFakeBuffName.c_str();
- }
- void FakeBuff_SetItem(LPITEM pkItem)
- {
- m_pkFakeBuffItem = pkItem;
- }
- void FakeBuff_Owner_SetSpawn(LPCHARACTER pkChr)
- {
- m_pkFakeBuffSpawn = pkChr;
- }
- DWORD FakeBuff_GetPart(BYTE bPart) const;
- // spawn
- LPCHARACTER FakeBuff_Owner_Spawn(int lX, int lY, LPITEM pkItem);
- bool FakeBuff_Owner_Despawn();
- // skills
- bool FakeBuff_IsSkillNeeded(CSkillProto* pkSkill);
- bool FakeBuff_UseSkill(LPCHARACTER pkTarget = NULL);
- void FakeBuff_SendSkillPacket(CSkillProto* pkSkill);
- private:
- std::string m_stFakeBuffName;
- LPCHARACTER m_pkFakeBuffOwner;
- LPCHARACTER m_pkFakeBuffSpawn;
- LPITEM m_pkFakeBuffItem;
- #endif
- #ifdef ENABLE_ZODIAC_TEMPLE
- public:
- void BeadTime();
- void CzCheckBox();
- void SetAnimasfer(int amount);
- int GetAnimasfer();
- void SetYellowmark(int amount);
- void ClearYellowMark();
- int GetYellowmark();
- void SetGreenmark(int amount);
- void ClearGreenMark();
- int GetGreenmark();
- void SetYellowreward(int amount);
- int GetYellowreward();
- void SetGreenreward(int amount);
- int GetGreenreward();
- void SetGoldreward(int amount);
- int GetGoldreward();
- void IsZodiacEffectMob();
- void IsZodiacEffectPC(DWORD Monster);
- void ZodiacFloorMessage(BYTE Floor);
- void SetLastZodiacAttackTime(DWORD time) { m_dwLastZodiacAttackTime = time; }
- DWORD GetLastZodiacAttackTime() const { return m_dwLastZodiacAttackTime; }
- void IncDeadCount() { m_dwDeadCount++; }
- void SetDeadCount(DWORD dead) { m_dwDeadCount = dead; }
- DWORD GetDeadCount() const { return m_dwDeadCount; }
- void EffectZodiacPacket(long X, long Y, int enumEffectType, int enumEffectType2 = 0);
- bool IsZodiacBoss();
- bool IsZodiacSubays();
- bool IsZodiacStone();
- uint16_t GetStoneNum() const;
- LPEVENT m_pkZodiacSkill1;
- LPEVENT m_pkZodiacSkill2;
- LPEVENT m_pkZodiacSkill3;
- LPEVENT m_pkZodiacSkill4;
- LPEVENT m_pkZodiacSkill5;
- LPEVENT m_pkZodiacSkill6;
- LPEVENT m_pkZodiacSkill7;
- LPEVENT m_pkZodiacSkill8;
- LPEVENT m_pkZodiacSkill9;
- LPEVENT m_pkZodiacSkill10;
- LPEVENT m_pkZodiacSkill11;
- void ZodiacDamage(BYTE Type, LPCHARACTER Victim = NULL);
- int ZodiacSkillAttack(LPCHARACTER Victim, DWORD dwVnum, BYTE bSkillLevel);
- DWORD CountZodiacItems(DWORD Vnum);
- void SetZodiacItems(DWORD Vnum, int Count);
- DWORD PurchaseCountZodiacItems(DWORD Vnum);
- void SetPurchaseZodiacItems(DWORD Vnum, int Count);
- void KanoneDamage();
- void SpawnZodiacGroup(LPZODIAC pZodiac);
- void SpawnZodiacStone(LPZODIAC pZodiac);
- private:
- DWORD m_dwLastZodiacAttackTime;
- DWORD m_dwDeadCount;
- #endif
- #ifdef ENABLE_TELEPORT_TO_A_FRIEND
- public:
- void SetLastWarpRequestTimeNew(CHRONO_steady_clock_point last_warp)
- {
- m_iLastWarpRequestTime = last_warp;
- }
- CHRONO_steady_clock_point GetLastWarpRequestTimeNew()
- {
- return m_iLastWarpRequestTime;
- }
- protected:
- CHRONO_steady_clock_point m_iLastWarpRequestTime;
- #endif
- #ifdef ENABLE_BOSS_TRACKING
- public:
- LPREGEN GetRegen()
- {
- return m_pkRegen;
- }
- void StartBossTrackingDataEvent();
- void StopBossTrackingDataEvent();
- bool IsBossTrackingWindow;
- DWORD BossTrackingMobVnum;
- #endif
- #ifdef ENABLE_COSTUME_MOUNT_SYSTEM
- public:
- void SetMountingM(bool bValue) { bMounting = bValue; }
- bool GetMountVnumM() { return bMounting; }
- uint32_t GetMountingVnumM() const { return bMountVnumM; }
- void SetMountVnumM(uint32_t bVnum) { bMountVnumM = bVnum; }
- CMountSystem* GetMountSystem() { return m_MountSystem; }
- LPEVENT m_pkMountSystemUpdateEvent;
- void SetMount() { m_bIsMountSystem = true; }
- #ifdef ENABLE_FAKE_PC
- bool IsMountSystem() const
- {
- return m_bIsMountSystem ? true : false;
- }
- #else
- bool IsMountSystem()
- {
- return m_bIsMountSystem;
- }
- #endif
- private:
- bool bMounting;
- uint32_t bMountVnumM;
- CMountSystem* m_MountSystem;
- bool m_bIsMountSystem;
- public:
- void CheckWears();
- #endif
- #ifdef __ADMIN_MANAGER__
- public:
- void SetChatBanCount(DWORD dwChatBanCount) { m_dwChatBanCount = dwChatBanCount; Save(); }
- DWORD GetChatBanCount() const { return m_dwChatBanCount; }
- DWORD GetAccountBanCount() const;
- private:
- DWORD m_dwChatBanCount;
- #endif
- /*** From Lysium ***/
- public:
- bool IsImmortaller() {return bImmortality;}
- void SetImmortality(bool bInfo) { bInfo = bImmortality;}
- void SetDamageLimitPercent(int limit);
- int GetDamageLimit() { return m_damageHPLimit; }
- private:
- bool bImmortality;
- int m_damageHPLimit;
- /*** End ***/
- #ifdef ENABLE_SHOW_MAP_BOSS_AND_STONE
- public:
- bool IsBoss();
- #endif
- #ifdef ENABLE_ANTI_PACKET_FLOOD
- public:
- int analyze_protect;
- int analyze_protect_count;
- #endif
- #ifdef ENABLE_COSTUME_AURA_SYSTEM
- private:
- BYTE m_bAuraRefineWindowType;
- bool m_bAuraRefineWindowOpen;
- TItemPos m_pAuraRefineWindowItemSlot[AURA_SLOT_MAX];
- TAuraRefineInfo m_bAuraRefineInfo[AURA_REFINE_INFO_SLOT_MAX];
- protected:
- BYTE __GetAuraAbsorptionRate(BYTE bLevel, BYTE bBoostIndex) const;
- TAuraRefineInfo __GetAuraRefineInfo(TItemPos Cell);
- TAuraRefineInfo __CalcAuraRefineInfo(TItemPos Cell, TItemPos MaterialCell);
- TAuraRefineInfo __GetAuraEvolvedRefineInfo(TItemPos Cell);
- public:
- void OpenAuraRefineWindow(LPENTITY pOpener, EAuraWindowType type);
- bool IsAuraRefineWindowOpen() const { return m_bAuraRefineWindowOpen; }
- BYTE GetAuraRefineWindowType() const { return m_bAuraRefineWindowType; }
- LPENTITY GetAuraRefineWindowOpener() { return m_pointsInstant.m_pAuraRefineWindowOpener; }
- bool IsAuraRefineWindowCanRefine();
- void AuraRefineWindowCheckIn(BYTE bAuraRefineWindowType, TItemPos AuraCell, TItemPos ItemCell);
- void AuraRefineWindowCheckOut(BYTE bAuraRefineWindowType, TItemPos AuraCell);
- void AuraRefineWindowAccept(BYTE bAuraRefineWindowType);
- void AuraRefineWindowClose();
- #endif
- #ifdef ENABLE_CHECK_PICKUP_HACK
- private:
- DWORD m_dwLastPickupTime;
- public:
- void SetLastPickupTime() { m_dwLastPickupTime = get_dword_time(); }
- DWORD GetLastPickupTime() { return m_dwLastPickupTime; }
- #endif
- #ifdef ENABLE_CHECK_GHOSTMODE
- private:
- DWORD m_dwCountGhostmodePoint;
- public:
- DWORD GetGhostmodeCount() { return m_dwCountGhostmodePoint; }
- void AddGhostmodeCount() { m_dwCountGhostmodePoint += 1; }
- void ResetGhostmodeCount() { m_dwCountGhostmodePoint = 0; }
- #endif
- #ifdef ENABLE_CHECK_WALLHACK
- private:
- DWORD m_dwCountWallhackPoint;
- public:
- DWORD GetWallhackCount() { return m_dwCountWallhackPoint; }
- void AddWallhackCount() { m_dwCountWallhackPoint += 1; }
- void ResetWallhackCount() { m_dwCountWallhackPoint = 0; }
- #endif
- #ifdef ENABLE_NEW_PET_SYSTEM
- public:
- void SetSummonPetLastTime(CHRONO_steady_clock_point last_use) { m_iSummonPetLastTime = last_use; }
- CHRONO_steady_clock_point GetSummonPetLastTime() { return m_iSummonPetLastTime; }
- void SetUnsummonPetLastTime(CHRONO_steady_clock_point last_use) { m_iUnsummonPetLastTime = last_use; }
- CHRONO_steady_clock_point GetUnsummonPetLastTime() { return m_iUnsummonPetLastTime; }
- protected:
- CHRONO_steady_clock_point m_iSummonPetLastTime;
- CHRONO_steady_clock_point m_iUnsummonPetLastTime;
- #endif
- #ifdef ENABLE_BIOLOG_SYSTEM
- protected:
- BYTE m_BiologActualMission;
- WORD m_BiologCollectedItems;
- BYTE m_BiologCooldownReminder;
- long m_BiologCooldown;
- public:
- CBiologSystem* GetBiologManager() const { return m_pkBiologManager; }
- BYTE GetBiologMissions() const { return m_BiologActualMission; }
- WORD GetBiologCollectedItems() const { return m_BiologCollectedItems; }
- BYTE GetBiologCooldownReminder() const { return m_BiologCooldownReminder; }
- long GetBiologCooldown() const { return m_BiologCooldown; }
- void SetBiologMissions(BYTE value) { m_BiologActualMission = value; }
- void SetBiologCollectedItems(WORD value) { m_BiologCollectedItems = value; }
- void SetBiologCooldownReminder(BYTE value) { m_BiologCooldownReminder = value; }
- void SetBiologCooldown(long value) { m_BiologCooldown = value; }
- private:
- CBiologSystem* m_pkBiologManager;
- #endif
- #ifdef ENABLE_CHAT_COLOR_SYSTEM
- public:
- void SetChatColor(BYTE color) { m_points.color = color; }
- BYTE GetChatColor() const { return m_points.color; }
- #endif
- };
- ESex GET_SEX(LPCHARACTER ch);
- extern bool RaceToJob(unsigned race, unsigned* ret_job);
- extern bool IS_SUMMONABLE_ZONE(int map_index);
- bool CAN_ENTER_ZONE(const LPCHARACTER &ch, int map_index);
- extern bool IS_MOUNTABLE_ZONE(int map_index, bool isHorse);
- extern bool IS_BLOCKED_PET_SUMMON_MAP(int map_index, bool isHorse);
- extern BYTE gm_get_level(const char* name, const char* host, const char* account);
- extern DWORD GetHairPartByJob(DWORD hair, BYTE job);
- void ConvertEmpireText(DWORD dwEmpireID, char* szText, size_t len, int iPct);
Bitte melden Sie sich an, um diesen Anhang zu sehen.
Danke im Voraus.