eqemu-server/zone/doors.h
Mitch Freeman f21cc170df
[Feature] Evolving Item Support for RoF2 (#4496)
* basic evolving items framework created

* Implement evolving tab in the inventory window

* Implement experience and number of kills

* Move zone evolving map to a evolvingitemsmanager class

* rework gm commands

* rework GetInventory

* wip

* wip loot testing

* Fix Duplicate Message

* reworked evolving item looting, swapping, etc

* reworked const functions for evolving methods

* Functioning Player Trade of evolving items test item_id is 89550

* First pass of Final Result link working

* First pass of item upgrading when reaching 100%

* Add strings and logic for displaying the evolving item xp transfer window in Corathus

* Prototype of xp transfer window sending items

* WIP for evolve xp transfer

* WIP for evolve xp transfer.  First tests passed

* XP Transfer Cleanup

* XP Transfer Cleanup

* Add Rule for evolving items equip timer/  default is 30 secs

* Add logging and player events

Add logging and player events

* Formatting

* Database updates

* Updates for linux build

* Perl/Cleanup

* Command cleanup

* Lua

* Added a crash condition check if final item id is blank or not found.

* Review Changes

Updates to resolve review comments and a rebase.

* migrate to content_db for items_evolving_details

migrate to content_db for items_evolving_details

* Simplify, don't hit database unless evolving

* Update 2025_01_19_items_evolving_details.sql

* Update client.cpp

* Update manifest with items_evolving_details

* character_id vs char_id

* Remove _Struct from structs

* Remove license header in evolving.cpp

* Move evolving constants from eq_constants.h to evolving.h since it is more specific

* Update database_schema.h

* General cleanup

* Be more specific with `evolving_items` vs `evolving`

---------

Co-authored-by: Kinglykrab <kinglykrab@gmail.com>
Co-authored-by: Akkadius <akkadius1@gmail.com>
2025-01-19 18:10:19 -06:00

116 lines
3.7 KiB
C++

#ifndef DOORS_H
#define DOORS_H
#include "mob.h"
#include "../common/repositories/doors_repository.h"
class Client;
class Mob;
class NPC;
struct Door;
class Doors : public Entity
{
public:
~Doors();
Doors(const char *model, const glm::vec4& position, uint8 open_type = 58, uint16 size = 100);
Doors(const DoorsRepository::Doors& door);
bool GetDisableTimer() { return m_disable_timer; }
bool IsDoor() const { return true; }
bool IsDoorOpen() { return m_is_open; }
bool Process();
bool triggered;
char *GetDoorName() { return m_door_name; }
const glm::vec4 &GetPosition() const { return m_position; }
int GetDzSwitchID() const { return m_dz_switch_id; }
int GetIncline() { return m_incline; }
int GetInvertState() { return m_invert_state; }
uint8 GetDoorID() { return m_door_id; }
uint8 GetNoKeyring() { return m_no_key_ring; }
uint8 GetOpenType() { return m_open_type; }
uint8 GetTriggerDoorID() { return m_trigger_door; }
uint8 GetTriggerType() { return m_trigger_type; }
uint8 IsLDoNDoor() { return m_is_ldon_door; }
uint16 GetLockpick() { return m_lockpick; }
uint16 GetSize() { return m_size; }
uint32 GetClientVersionMask() { return m_client_version_mask; }
uint32 GetDoorDBID() { return m_database_id; }
int32 GetDoorParam() { return m_door_param; }
uint32 GetEntityID() { return m_entity_id; }
uint32 GetGuildID() { return m_guild_id; }
uint32 GetKeyItem() { return m_key_item_id; }
void CreateDatabaseEntry();
void ForceClose(Mob *sender, bool alt_mode = false);
void ForceOpen(Mob *sender, bool alt_mode = false);
void HandleClick(Client *sender, uint8 trigger);
void Open(Mob *sender, bool alt_mode = false);
void SetDisableTimer(bool flag);
void SetDoorName(const char *name);
void SetEntityID(uint32 entity) { m_entity_id = entity; }
void SetIncline(int in);
void SetInvertState(int in);
void SetKeyItem(uint32 in) { m_key_item_id = in; }
void SetLocation(float x, float y, float z);
void SetLockpick(uint16 in) { m_lockpick = in; }
void SetNoKeyring(uint8 in) { m_no_key_ring = in; }
void SetOpenState(bool st) { m_is_open = st; }
void SetOpenType(uint8 in);
void SetPosition(const glm::vec4 &position);
void SetSize(uint16 size);
void ToggleState(Mob *sender);
inline std::string GetDestinationZoneName() { return m_destination_zone_name; }
inline int GetDestinationInstanceID() { return m_destination_instance_id; }
inline float GetDestinationX() { return m_destination.x; }
inline float GetDestinationY() { return m_destination.y; }
inline float GetDestinationZ() { return m_destination.z; }
inline float GetDestinationHeading() { return m_destination.w; }
float GetX();
float GetY();
float GetZ();
float GetHeading();
bool HasDestinationZone() const;
bool IsDestinationZoneSame() const;
bool IsDoorBlacklisted();
const char* GetDoorZone() const { return m_zone_name; }
private:
bool GetIsDoorBlacklisted();
bool m_has_destination_zone = false;
bool m_same_destination_zone = false;
uint32 m_database_id;
uint8 m_door_id;
char m_zone_name[32];
char m_door_name[32];
glm::vec4 m_position;
int m_incline;
uint8 m_open_type;
uint32 m_guild_id;
uint16 m_lockpick;
uint32 m_key_item_id;
uint8 m_no_key_ring;
uint8 m_trigger_door;
uint8 m_trigger_type;
int32 m_door_param;
uint16 m_size;
int m_invert_state;
uint32 m_entity_id;
bool m_disable_timer;
bool m_is_open;
Timer m_close_timer;
char m_destination_zone_name[16];
int m_destination_instance_id;
glm::vec4 m_destination;
uint8 m_is_ldon_door;
int m_dz_switch_id = 0;
uint32 m_client_version_mask;
bool m_is_blacklisted_to_open = false; // is door blacklisted to open by npcs
};
#endif