2017-04-08 05:59:21 +00:00
|
|
|
#ifndef OPENMW_BASESTRUCTS_HPP
|
|
|
|
#define OPENMW_BASESTRUCTS_HPP
|
|
|
|
|
2018-05-21 04:14:08 +00:00
|
|
|
#include <string>
|
|
|
|
|
2018-09-08 02:29:49 +00:00
|
|
|
#include <components/esm/loadcell.hpp>
|
2017-04-30 15:44:59 +00:00
|
|
|
#include <components/esm/statstate.hpp>
|
|
|
|
|
2017-04-17 12:12:11 +00:00
|
|
|
#include <RakNetTypes.h>
|
|
|
|
|
2017-04-08 05:59:21 +00:00
|
|
|
namespace mwmp
|
|
|
|
{
|
2018-07-22 15:38:05 +00:00
|
|
|
enum PACKET_ORIGIN
|
|
|
|
{
|
2018-07-22 19:43:40 +00:00
|
|
|
CLIENT_GAMEPLAY = 0,
|
|
|
|
CLIENT_CONSOLE = 1,
|
|
|
|
CLIENT_DIALOGUE = 2,
|
|
|
|
CLIENT_SCRIPT_LOCAL = 3,
|
|
|
|
CLIENT_SCRIPT_GLOBAL = 4,
|
|
|
|
SERVER_SCRIPT = 5
|
2018-07-22 15:38:05 +00:00
|
|
|
};
|
|
|
|
|
2020-01-04 07:56:37 +00:00
|
|
|
enum VARIABLE_TYPE
|
|
|
|
{
|
2020-02-17 16:19:03 +00:00
|
|
|
SHORT,
|
|
|
|
LONG,
|
2020-01-04 07:56:37 +00:00
|
|
|
FLOAT
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ClientVariable
|
|
|
|
{
|
|
|
|
std::string id;
|
2020-06-06 11:58:51 +00:00
|
|
|
int internalIndex;
|
2020-01-04 07:56:37 +00:00
|
|
|
|
|
|
|
char variableType;
|
|
|
|
|
|
|
|
int intValue;
|
|
|
|
float floatValue;
|
|
|
|
};
|
|
|
|
|
2018-07-26 01:36:12 +00:00
|
|
|
struct Time
|
|
|
|
{
|
|
|
|
float hour;
|
|
|
|
int day;
|
|
|
|
int month;
|
|
|
|
int year;
|
|
|
|
|
|
|
|
int daysPassed;
|
|
|
|
float timeScale;
|
|
|
|
};
|
|
|
|
|
2017-05-26 01:37:49 +00:00
|
|
|
struct Item
|
|
|
|
{
|
|
|
|
std::string refId;
|
|
|
|
int count;
|
|
|
|
int charge;
|
2018-07-22 11:20:20 +00:00
|
|
|
float enchantmentCharge;
|
2018-07-26 19:37:04 +00:00
|
|
|
std::string soul;
|
2017-05-26 01:37:49 +00:00
|
|
|
|
|
|
|
inline bool operator==(const Item& rhs)
|
|
|
|
{
|
2018-07-26 19:37:04 +00:00
|
|
|
return refId == rhs.refId && count == rhs.count && charge == rhs.charge &&
|
|
|
|
enchantmentCharge == rhs.enchantmentCharge && soul == rhs.soul;
|
2017-05-26 01:37:49 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2017-04-17 15:31:39 +00:00
|
|
|
struct Target
|
|
|
|
{
|
2018-04-05 09:48:53 +00:00
|
|
|
bool isPlayer;
|
|
|
|
|
2017-04-17 15:31:39 +00:00
|
|
|
std::string refId;
|
2019-09-19 05:44:33 +00:00
|
|
|
unsigned int refNum;
|
|
|
|
unsigned int mpNum;
|
2017-04-17 15:31:39 +00:00
|
|
|
|
2018-07-05 16:40:28 +00:00
|
|
|
std::string name; // Remove this once the server can get names corresponding to different refIds
|
|
|
|
|
2017-04-17 15:31:39 +00:00
|
|
|
RakNet::RakNetGUID guid;
|
|
|
|
};
|
|
|
|
|
2017-04-17 12:12:11 +00:00
|
|
|
class Attack
|
|
|
|
{
|
|
|
|
public:
|
2017-04-17 15:31:39 +00:00
|
|
|
|
|
|
|
Target target;
|
2017-04-17 14:24:11 +00:00
|
|
|
|
2017-04-17 12:12:11 +00:00
|
|
|
enum TYPE
|
|
|
|
{
|
|
|
|
MELEE = 0,
|
2019-08-25 06:35:23 +00:00
|
|
|
RANGED
|
2017-04-17 12:12:11 +00:00
|
|
|
};
|
2017-04-17 14:24:11 +00:00
|
|
|
|
2019-11-29 08:39:57 +00:00
|
|
|
char type;
|
|
|
|
std::string attackAnimation;
|
|
|
|
|
2018-09-22 23:30:31 +00:00
|
|
|
std::string rangedWeaponId;
|
|
|
|
std::string rangedAmmoId;
|
|
|
|
|
2018-09-08 02:29:49 +00:00
|
|
|
ESM::Position hitPosition;
|
|
|
|
|
2019-12-19 11:51:10 +00:00
|
|
|
float damage = 0;
|
|
|
|
float attackStrength = 0;
|
2017-04-19 13:43:58 +00:00
|
|
|
|
2019-12-19 11:38:05 +00:00
|
|
|
bool isHit = false;
|
|
|
|
bool success = false;
|
|
|
|
bool block = false;
|
2017-04-19 13:43:58 +00:00
|
|
|
|
2019-12-19 11:38:05 +00:00
|
|
|
bool pressed = false;
|
|
|
|
bool instant = false;
|
|
|
|
bool knockdown = false;
|
|
|
|
bool applyWeaponEnchantment = false;
|
|
|
|
bool applyAmmoEnchantment = false;
|
2017-04-19 13:43:58 +00:00
|
|
|
|
2019-12-19 11:38:05 +00:00
|
|
|
bool shouldSend = false;
|
2017-04-17 12:12:11 +00:00
|
|
|
};
|
|
|
|
|
2019-08-25 06:35:23 +00:00
|
|
|
class Cast
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
Target target;
|
|
|
|
|
|
|
|
char type; // 0 - regular magic, 1 - item magic
|
|
|
|
enum TYPE
|
|
|
|
{
|
|
|
|
REGULAR = 0,
|
|
|
|
ITEM
|
|
|
|
};
|
|
|
|
|
|
|
|
std::string spellId; // id of spell (e.g. "fireball")
|
|
|
|
std::string itemId;
|
|
|
|
|
|
|
|
ESM::Position hitPosition;
|
|
|
|
|
|
|
|
bool isHit;
|
|
|
|
bool success;
|
|
|
|
bool pressed;
|
|
|
|
bool instant;
|
|
|
|
|
|
|
|
bool shouldSend;
|
|
|
|
};
|
|
|
|
|
2017-04-08 05:59:21 +00:00
|
|
|
struct Animation
|
|
|
|
{
|
|
|
|
std::string groupname;
|
|
|
|
int mode;
|
|
|
|
int count;
|
|
|
|
bool persist;
|
|
|
|
};
|
2017-04-30 15:44:59 +00:00
|
|
|
|
|
|
|
struct SimpleCreatureStats
|
|
|
|
{
|
|
|
|
ESM::StatState<float> mDynamic[3];
|
2017-05-08 23:47:29 +00:00
|
|
|
bool mDead;
|
2019-12-06 18:59:43 +00:00
|
|
|
bool mDeathAnimationFinished;
|
2017-04-30 15:44:59 +00:00
|
|
|
};
|
2017-04-08 05:59:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif //OPENMW_BASESTRUCTS_HPP
|