Use created character data and DB start items/spells

This commit is contained in:
Kelsi 2026-02-05 14:35:12 -08:00
parent 2db690a866
commit c89fccdfeb
4 changed files with 509 additions and 102 deletions

View file

@ -112,6 +112,10 @@ public:
* @param characterGuid GUID of character to log in with
*/
void selectCharacter(uint64_t characterGuid);
void setActiveCharacterGuid(uint64_t guid) { activeCharacterGuid_ = guid; }
uint64_t getActiveCharacterGuid() const { return activeCharacterGuid_; }
const Character* getActiveCharacter() const;
const Character* getFirstCharacter() const;
/**
* Get current player movement info
@ -167,6 +171,9 @@ public:
// Money (copper)
uint64_t getMoneyCopper() const { return playerMoneyCopper_; }
// Single-player: mark character list ready for selection UI
void setSinglePlayerCharListReady();
// Inventory
Inventory& getInventory() { return inventory; }
const Inventory& getInventory() const { return inventory; }
@ -216,6 +223,7 @@ public:
void setSinglePlayerMode(bool sp) { singlePlayerMode_ = sp; }
bool isSinglePlayerMode() const { return singlePlayerMode_; }
void simulateMotd(const std::vector<std::string>& lines);
void applySinglePlayerStartData(Race race, Class cls);
// NPC death callback (single-player)
using NpcDeathCallback = std::function<void(uint64_t guid)>;
@ -296,6 +304,16 @@ public:
*/
void update(float deltaTime);
struct SinglePlayerCreateInfo {
uint32_t mapId = 0;
uint32_t zoneId = 0;
float x = 0.0f;
float y = 0.0f;
float z = 0.0f;
float orientation = 0.0f;
};
bool getSinglePlayerCreateInfo(Race race, Class cls, SinglePlayerCreateInfo& out) const;
private:
/**
* Handle incoming packet from world server
@ -503,6 +521,8 @@ private:
bool pendingGroupInvite = false;
std::string pendingInviterName;
uint64_t activeCharacterGuid_ = 0;
// ---- Phase 5: Loot ----
bool lootWindowOpen = false;
LootResponseData currentLoot;