2021-11-27 00:53:57 +01:00
|
|
|
#pragma once
|
2018-01-09 23:50:54 +01:00
|
|
|
|
2018-03-06 22:22:19 +01:00
|
|
|
#include <Common.h>
|
2018-01-09 23:50:54 +01:00
|
|
|
|
2018-09-09 23:56:22 +02:00
|
|
|
#include "ForwardsZone.h"
|
2018-01-09 23:50:54 +01:00
|
|
|
|
2018-11-29 16:55:48 +01:00
|
|
|
namespace Sapphire::Event
|
2018-01-09 23:50:54 +01:00
|
|
|
{
|
2018-01-28 13:49:51 +01:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
/*!
|
|
|
|
\class Director
|
|
|
|
\brief Base class for all Directors implements sequence and variables
|
2018-01-28 13:49:51 +01:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
*/
|
2018-02-06 00:01:23 +01:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
class Director
|
|
|
|
{
|
2018-02-06 00:01:23 +01:00
|
|
|
|
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,
|
2019-04-18 20:57:47 +10:00
|
|
|
TreasureHunt = 0x8009,
|
2018-10-28 21:53:21 +01:00
|
|
|
GoldSaucer = 0x800A,
|
2019-04-18 20:57:47 +10:00
|
|
|
CompanyCraftDirector = 0x800B,
|
2018-10-28 21:53:21 +01:00
|
|
|
DpsChallange = 0x800D,
|
|
|
|
Fate = 0x801A
|
2019-03-31 01:39:49 +01:00
|
|
|
};
|
2018-02-07 00:00:48 +01:00
|
|
|
|
2021-11-27 00:53:57 +01:00
|
|
|
enum DirectorSetupFlags : uint8_t
|
|
|
|
{
|
|
|
|
ClearTodo = 0x01,
|
|
|
|
Unknown02 = 0x02,
|
|
|
|
Unknown04 = 0x04,
|
|
|
|
Unknown08 = 0x08,
|
|
|
|
Unknown10 = 0x10,
|
|
|
|
Unknown20 = 0x20, //Do some chat msg
|
|
|
|
Unknown40 = 0x40,
|
|
|
|
Unknown80 = 0x80,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum DirectorSceneId : uint8_t
|
|
|
|
{
|
|
|
|
Opening = 0x01,
|
|
|
|
Enter = 0x02,
|
|
|
|
Reset = 0x03,
|
|
|
|
Cutscene = 0x04,
|
|
|
|
Failed = 0x05,
|
|
|
|
Complete = 0x06
|
|
|
|
};
|
|
|
|
|
2019-03-31 01:39:49 +01:00
|
|
|
enum DirectorState
|
|
|
|
{
|
|
|
|
Created,
|
|
|
|
DutyReset,
|
|
|
|
DutyInProgress,
|
2019-04-04 23:29:52 +02:00
|
|
|
DutyFinished,
|
|
|
|
DutyFailed
|
2018-10-28 21:53:21 +01:00
|
|
|
};
|
2018-02-07 00:00:48 +01:00
|
|
|
|
2021-11-27 00:53:57 +01:00
|
|
|
Director( DirectorType type, uint16_t contentId );
|
2018-02-07 00:00:48 +01:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
uint32_t getDirectorId() const;
|
2018-02-07 00:00:48 +01:00
|
|
|
|
2021-11-27 00:53:57 +01:00
|
|
|
uint16_t getContextId() const;
|
2021-08-16 17:18:29 +09:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
DirectorType getType() const;
|
2018-02-07 00:00:48 +01:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
uint8_t getSequence() const;
|
2018-02-07 00:00:48 +01:00
|
|
|
|
2021-11-27 00:53:57 +01:00
|
|
|
uint8_t getFlags() const;
|
2018-02-07 00:00:48 +01:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
void sendDirectorInit( Entity::Player& player ) const;
|
2018-02-07 00:00:48 +01:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
void sendDirectorClear( Entity::Player& player ) const;
|
2018-02-07 00:00:48 +01:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
void sendDirectorVars( Entity::Player& player ) const;
|
2018-02-07 00:00:48 +01:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
void setDirectorSequence( uint8_t value );
|
2018-08-29 21:40:59 +02:00
|
|
|
|
2021-11-27 00:53:57 +01:00
|
|
|
void setDirectorFlags( uint8_t value );
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* @brief Sets a value of a director var
|
|
|
|
* @param index of var to set
|
|
|
|
* @param value to set
|
|
|
|
*/
|
|
|
|
void setDirectorVar( uint8_t index, uint8_t value );
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* @brief Sets a value of a director var
|
|
|
|
* @param index of var to set
|
|
|
|
* @param value to set left shifted. Just first 4 bits. Discards last bits
|
|
|
|
* @param value to set right shifted. Just first 4 bits. Discards last bits
|
|
|
|
*/
|
|
|
|
void setDirectorVar( uint8_t index, uint8_t valueLeft, uint8_t valueRight );
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* @brief Gets a value of a director var
|
|
|
|
* @param index of var to get
|
|
|
|
* @return 8 bits of selected index
|
|
|
|
*/
|
|
|
|
uint8_t getDirectorVar( uint8_t index );
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* @brief Gets a value of a director var in 4 bits
|
|
|
|
* @param index of var to get
|
|
|
|
* @param shiftLeft if true, last 4 bits otherwise first 4 bits
|
|
|
|
* @return 4 bits of selected index
|
|
|
|
*/
|
|
|
|
uint8_t getDirectorVar( uint8_t index, bool shiftLeft );
|
2018-10-28 21:53:21 +01:00
|
|
|
private:
|
|
|
|
/*! Id of the content of the director */
|
2021-11-27 00:53:57 +01:00
|
|
|
uint16_t m_contextId;
|
2018-08-29 21:40:59 +02:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
/*! DirectorType | ContentId */
|
|
|
|
uint32_t m_directorId;
|
2018-08-29 21:40:59 +02:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
/*! currect sequence */
|
|
|
|
uint8_t m_sequence;
|
2018-08-29 21:40:59 +02:00
|
|
|
|
2021-11-27 00:53:57 +01:00
|
|
|
/*! current flags */
|
|
|
|
uint8_t m_flags;
|
2018-02-07 00:00:48 +01:00
|
|
|
|
2021-11-27 00:53:57 +01:00
|
|
|
uint8_t m_vars[ 10 ];
|
2018-10-28 21:53:21 +01:00
|
|
|
|
|
|
|
/*! type of the director */
|
|
|
|
DirectorType m_type;
|
|
|
|
};
|
2018-01-09 23:50:54 +01:00
|
|
|
|
2021-11-27 00:53:57 +01:00
|
|
|
}
|