1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-10 20:47:46 +00:00
sapphire/src/world/Event/Director.h

186 lines
3.6 KiB
C
Raw Normal View History

2018-01-09 23:50:54 +01:00
#ifndef SAPPHIRE_DIRECTOR_H
#define SAPPHIRE_DIRECTOR_H
2018-03-06 22:22:19 +01:00
#include <Common.h>
2018-01-09 23:50:54 +01:00
#include "ForwardsZone.h"
2018-01-09 23:50:54 +01:00
namespace Sapphire::Event
2018-01-09 23:50:54 +01:00
{
2018-10-28 21:53:21 +01:00
/*!
\class Director
\brief Base class for all Directors implements sequence and variables
2018-10-28 21:53:21 +01:00
*/
2018-10-28 21:53:21 +01:00
class Director
{
2018-10-28 21:53:21 +01:00
public:
enum DirectorType
{
BattleLeve = 0x8001,
GatheringLeve = 0x8002,
InstanceContent = 0x8003, // used for dungeons/raids
PublicContent = 0x8004,
QuestBattle = 0x8006,
CompanyLeve = 0x8007,
GoldSaucer = 0x800A,
DpsChallange = 0x800D,
Fate = 0x801A
2019-03-31 01:39:49 +01:00
};
2019-03-31 01:39:49 +01:00
enum DirectorState
{
Created,
DutyReset,
DutyInProgress,
DutyFinished
2018-10-28 21:53:21 +01:00
};
2018-10-28 21:53:21 +01:00
Director( DirectorType type, uint16_t contentId );
2018-10-28 21:53:21 +01:00
uint32_t getDirectorId() const;
2018-10-28 21:53:21 +01:00
uint16_t getContentId() const;
2018-10-28 21:53:21 +01:00
DirectorType getType() const;
2018-10-28 21:53:21 +01:00
uint8_t getSequence() const;
2018-10-28 21:53:21 +01:00
uint8_t getBranch() const;
2018-10-28 21:53:21 +01:00
void sendDirectorInit( Entity::Player& player ) const;
2018-10-28 21:53:21 +01:00
void sendDirectorClear( Entity::Player& player ) const;
2018-10-28 21:53:21 +01:00
void sendDirectorVars( Entity::Player& player ) const;
2018-10-28 21:53:21 +01:00
void setDirectorUI8AL( uint8_t value );
2018-10-28 21:53:21 +01:00
void setDirectorUI8AH( uint8_t value );
2018-10-28 21:53:21 +01:00
void setDirectorUI8BL( uint8_t value );
2018-10-28 21:53:21 +01:00
void setDirectorUI8BH( uint8_t value );
2018-10-28 21:53:21 +01:00
void setDirectorUI8CL( uint8_t value );
2018-10-28 21:53:21 +01:00
void setDirectorUI8CH( uint8_t value );
2018-10-28 21:53:21 +01:00
void setDirectorUI8DL( uint8_t value );
2018-10-28 21:53:21 +01:00
void setDirectorUI8DH( uint8_t value );
2018-10-28 21:53:21 +01:00
void setDirectorUI8EL( uint8_t value );
2018-10-28 21:53:21 +01:00
void setDirectorUI8EH( uint8_t value );
2018-10-28 21:53:21 +01:00
void setDirectorUI8FL( uint8_t value );
2018-10-28 21:53:21 +01:00
void setDirectorUI8FH( uint8_t value );
2018-10-28 21:53:21 +01:00
void setDirectorUI8GL( uint8_t value );
2018-10-28 21:53:21 +01:00
void setDirectorUI8GH( uint8_t value );
2018-10-28 21:53:21 +01:00
void setDirectorUI8HL( uint8_t value );
2018-10-28 21:53:21 +01:00
void setDirectorUI8HH( uint8_t value );
2018-10-28 21:53:21 +01:00
void setDirectorUI8IL( uint8_t value );
2018-10-28 21:53:21 +01:00
void setDirectorUI8IH( uint8_t value );
2018-10-28 21:53:21 +01:00
void setDirectorUI8JL( uint8_t value );
2018-10-28 21:53:21 +01:00
void setDirectorUI8JH( uint8_t value );
2018-10-28 21:53:21 +01:00
void setDirectorSequence( uint8_t value );
2018-10-28 21:53:21 +01:00
void setDirectorBranch( uint8_t value );
2018-10-28 21:53:21 +01:00
private:
/*! Id of the content of the director */
uint16_t m_contentId;
2018-10-28 21:53:21 +01:00
/*! DirectorType | ContentId */
uint32_t m_directorId;
2018-10-28 21:53:21 +01:00
/*! currect sequence */
uint8_t m_sequence;
2018-10-28 21:53:21 +01:00
/*! current branch */
uint8_t m_branch;
2018-10-28 21:53:21 +01:00
union
{
struct UI8LH
{
uint8_t UI8AL : 4;
uint8_t UI8AH : 4;
uint8_t UI8BL : 4;
uint8_t UI8BH : 4;
uint8_t UI8CL : 4;
uint8_t UI8CH : 4;
uint8_t UI8DL : 4;
uint8_t UI8DH : 4;
uint8_t UI8EL : 4;
uint8_t UI8EH : 4;
uint8_t UI8FL : 4;
uint8_t UI8FH : 4;
uint8_t UI8GL : 4;
uint8_t UI8GH : 4;
uint8_t UI8HL : 4;
uint8_t UI8HH : 4;
uint8_t UI8IL : 4;
uint8_t UI8IH : 4;
uint8_t UI8JL : 4;
uint8_t UI8JH : 4;
} ui8lh;
struct UI8
{
uint8_t UI8A;
uint8_t UI8B;
uint8_t UI8C;
uint8_t UI8D;
uint8_t UI8E;
uint8_t UI8F;
uint8_t UI8G;
uint8_t UI8H;
uint8_t UI8I;
uint8_t UI8J;
} ui8;
struct FLAGS
{
uint8_t flags80;
uint8_t flags72;
uint8_t flags64;
uint8_t flags56;
uint8_t flags48;
uint8_t flags40;
uint8_t flags32;
uint8_t flags24;
uint8_t flags16;
uint8_t flags8;
} flags;
/*! raw storage for flags/vars */
uint8_t arrData[10];
} m_unionData;
/*! type of the director */
DirectorType m_type;
uint32_t m_elapsedTime;
2018-01-09 23:50:54 +01:00
2018-10-28 21:53:21 +01:00
};
2018-01-09 23:50:54 +01:00
}
#endif //SAPPHIRE_DIRECTOR_H