2020-08-25 18:42:52 +00:00
|
|
|
#pragma once
|
|
|
|
|
2021-03-17 19:07:40 +00:00
|
|
|
#include "core/Core.hpp"
|
2022-07-16 23:19:40 +00:00
|
|
|
|
2021-03-21 01:42:45 +00:00
|
|
|
#include "Entities.hpp"
|
2022-04-23 01:13:00 +00:00
|
|
|
#include "Groups.hpp"
|
2020-08-18 20:42:30 +00:00
|
|
|
|
2022-07-16 23:19:40 +00:00
|
|
|
#include <vector>
|
|
|
|
|
2022-07-17 06:33:57 +00:00
|
|
|
/* forward declaration(s) */
|
|
|
|
class Buff;
|
|
|
|
struct BuffStack;
|
|
|
|
|
2020-09-10 16:40:38 +00:00
|
|
|
#define ACTIVE_MISSION_COUNT 6
|
|
|
|
|
2020-09-15 14:46:52 +00:00
|
|
|
#define PC_MAXHEALTH(level) (925 + 75 * (level))
|
|
|
|
|
2022-04-11 14:26:57 +00:00
|
|
|
struct Player : public Entity, public ICombatant {
|
2021-03-21 18:29:17 +00:00
|
|
|
int accountId = 0;
|
|
|
|
int accountLevel = 0; // permission level (see CN_ACCOUNT_LEVEL enums)
|
|
|
|
int32_t iID = 0;
|
|
|
|
|
|
|
|
int level = 0;
|
|
|
|
int HP = 0;
|
|
|
|
int slot = 0; // player slot, not nano slot
|
|
|
|
int16_t mentor = 0;
|
|
|
|
int32_t money = 0;
|
|
|
|
int32_t fusionmatter = 0;
|
|
|
|
int32_t batteryW = 0;
|
|
|
|
int32_t batteryN = 0;
|
|
|
|
sPCStyle PCStyle = {};
|
|
|
|
sPCStyle2 PCStyle2 = {};
|
|
|
|
sNano Nanos[NANO_COUNT] = {}; // acquired nanos
|
|
|
|
int equippedNanos[3] = {};
|
|
|
|
int activeNano = 0; // active nano (index into Nanos)
|
|
|
|
int8_t iPCState = 0;
|
|
|
|
int32_t iWarpLocationFlag = 0;
|
|
|
|
int64_t aSkywayLocationFlag[2] = {};
|
|
|
|
int8_t iSpecialState = 0;
|
2022-07-17 06:33:57 +00:00
|
|
|
std::unordered_map<int, Buff*> buffs = {};
|
2021-03-21 18:29:17 +00:00
|
|
|
|
|
|
|
int angle = 0;
|
|
|
|
int lastX = 0, lastY = 0, lastZ = 0, lastAngle = 0;
|
|
|
|
int recallX = 0, recallY = 0, recallZ = 0, recallInstance = 0; // also Lair entrances
|
|
|
|
sItemBase Equip[AEQUIP_COUNT] = {};
|
|
|
|
sItemBase Inven[AINVEN_COUNT] = {};
|
|
|
|
sItemBase Bank[ABANK_COUNT] = {};
|
|
|
|
sItemTrade Trade[12] = {};
|
|
|
|
int32_t moneyInTrade = 0;
|
|
|
|
bool isTrading = false;
|
|
|
|
bool isTradeConfirm = false;
|
|
|
|
|
|
|
|
bool inCombat = false;
|
|
|
|
bool onMonkey = false;
|
|
|
|
int healCooldown = 0;
|
|
|
|
|
|
|
|
int pointDamage = 0;
|
|
|
|
int groupDamage = 0;
|
|
|
|
int fireRate = 0;
|
|
|
|
int defense = 0;
|
|
|
|
|
|
|
|
int64_t aQuestFlag[16] = {};
|
|
|
|
int tasks[ACTIVE_MISSION_COUNT] = {};
|
|
|
|
int RemainingNPCCount[ACTIVE_MISSION_COUNT][3] = {};
|
|
|
|
sItemBase QInven[AQINVEN_COUNT] = {};
|
|
|
|
int32_t CurrentMissionID = 0;
|
|
|
|
|
|
|
|
sTimeLimitItemDeleteInfo2CL toRemoveVehicle = {};
|
|
|
|
|
2022-04-23 01:13:00 +00:00
|
|
|
Group* group = nullptr;
|
2021-03-21 18:29:17 +00:00
|
|
|
|
|
|
|
bool notify = false;
|
|
|
|
bool hidden = false;
|
|
|
|
bool unwarpable = false;
|
|
|
|
|
|
|
|
bool buddiesSynced = false;
|
|
|
|
int64_t buddyIDs[50] = {};
|
|
|
|
bool isBuddyBlocked[50] = {};
|
|
|
|
|
|
|
|
uint64_t iFirstUseFlag[2] = {};
|
|
|
|
time_t lastHeartbeat = 0;
|
|
|
|
|
|
|
|
int suspicionRating = 0;
|
|
|
|
time_t lastShot = 0;
|
|
|
|
std::vector<sItemBase> buyback = {};
|
2021-03-21 01:42:45 +00:00
|
|
|
|
2022-04-13 19:09:43 +00:00
|
|
|
Player() { kind = EntityKind::PLAYER; }
|
2021-03-21 02:54:24 +00:00
|
|
|
|
2021-03-21 01:42:45 +00:00
|
|
|
virtual void enterIntoViewOf(CNSocket *sock) override;
|
|
|
|
virtual void disappearFromViewOf(CNSocket *sock) override;
|
2021-06-20 18:37:37 +00:00
|
|
|
|
2022-07-17 06:33:57 +00:00
|
|
|
virtual bool addBuff(int buffId, BuffCallback<int, BuffStack*> onUpdate, BuffCallback<time_t> onTick, BuffStack* stack) override;
|
|
|
|
virtual Buff* getBuff(int buffId) override;
|
|
|
|
virtual void removeBuff(int buffId) override;
|
2023-07-25 17:49:40 +00:00
|
|
|
virtual void removeBuff(int buffId, BuffClass buffClass) override;
|
2022-11-27 22:36:47 +00:00
|
|
|
virtual void clearBuffs(bool force) override;
|
2022-07-17 06:33:57 +00:00
|
|
|
virtual bool hasBuff(int buffId) override;
|
|
|
|
virtual int getCompositeCondition() override;
|
2022-04-11 14:26:57 +00:00
|
|
|
virtual int takeDamage(EntityRef src, int amt) override;
|
2022-07-17 06:33:57 +00:00
|
|
|
virtual int heal(EntityRef src, int amt) override;
|
2022-04-11 14:26:57 +00:00
|
|
|
virtual bool isAlive() override;
|
|
|
|
virtual int getCurrentHP() override;
|
2022-07-17 06:33:57 +00:00
|
|
|
virtual int getMaxHP() override;
|
|
|
|
virtual int getLevel() override;
|
|
|
|
virtual std::vector<EntityRef> getGroupMembers() override;
|
|
|
|
virtual int32_t getCharType() override;
|
2022-04-11 14:26:57 +00:00
|
|
|
virtual int32_t getID() override;
|
2022-07-17 06:33:57 +00:00
|
|
|
virtual EntityRef getRef() override;
|
2022-04-11 14:26:57 +00:00
|
|
|
|
|
|
|
virtual void step(time_t currTime) override;
|
|
|
|
|
2022-07-17 06:33:57 +00:00
|
|
|
sNano* getActiveNano();
|
2021-06-20 18:37:37 +00:00
|
|
|
sPCAppearanceData getAppearanceData();
|
2020-08-18 20:42:30 +00:00
|
|
|
};
|