2021-03-13 20:22:29 +00:00
|
|
|
#pragma once
|
|
|
|
|
2022-07-24 01:37:42 +00:00
|
|
|
#include "core/Core.hpp"
|
|
|
|
|
2022-07-16 23:19:40 +00:00
|
|
|
#include "Entities.hpp"
|
2022-07-20 16:15:01 +00:00
|
|
|
#include "Player.hpp"
|
2022-07-16 23:19:40 +00:00
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <vector>
|
2021-03-13 20:22:29 +00:00
|
|
|
|
2022-07-24 01:37:42 +00:00
|
|
|
constexpr size_t MAX_SKILLRESULT_SIZE = sizeof(sSkillResult_BatteryDrain);
|
|
|
|
|
2023-07-12 21:04:09 +00:00
|
|
|
enum class SkillType {
|
|
|
|
DAMAGE = 1,
|
|
|
|
HEAL_HP = 2,
|
|
|
|
KNOCKDOWN = 3,
|
|
|
|
SLEEP = 4,
|
|
|
|
SNARE = 5,
|
|
|
|
HEAL_STAMINA = 6,
|
|
|
|
STAMINA_SELF = 7,
|
|
|
|
STUN = 8,
|
|
|
|
WEAPONSLOW = 9,
|
|
|
|
JUMP = 10,
|
|
|
|
RUN = 11,
|
|
|
|
STEALTH = 12,
|
|
|
|
SWIM = 13,
|
|
|
|
MINIMAPENEMY = 14,
|
|
|
|
MINIMAPTRESURE = 15,
|
|
|
|
PHOENIX = 16,
|
|
|
|
PROTECTBATTERY = 17,
|
|
|
|
PROTECTINFECTION = 18,
|
|
|
|
REWARDBLOB = 19,
|
|
|
|
REWARDCASH = 20,
|
|
|
|
BATTERYDRAIN = 21,
|
|
|
|
CORRUPTIONATTACK = 22,
|
|
|
|
INFECTIONDAMAGE = 23,
|
|
|
|
KNOCKBACK = 24,
|
|
|
|
FREEDOM = 25,
|
|
|
|
PHOENIX_GROUP = 26,
|
|
|
|
RECALL = 27,
|
|
|
|
RECALL_GROUP = 28,
|
|
|
|
RETROROCKET_SELF = 29,
|
|
|
|
BLOODSUCKING = 30,
|
|
|
|
BOUNDINGBALL = 31,
|
|
|
|
INVULNERABLE = 32,
|
|
|
|
NANOSTIMPAK = 33,
|
|
|
|
RETURNHOMEHEAL = 34,
|
|
|
|
BUFFHEAL = 35,
|
|
|
|
EXTRABANK = 36,
|
|
|
|
CORRUPTIONATTACKWIN = 38,
|
|
|
|
CORRUPTIONATTACKLOSE = 39,
|
|
|
|
};
|
|
|
|
|
2022-05-17 00:28:27 +00:00
|
|
|
enum class SkillEffectTarget {
|
|
|
|
POINT = 1,
|
|
|
|
SELF = 2,
|
|
|
|
CONE = 3,
|
|
|
|
WEAPON = 4,
|
|
|
|
AREA_SELF = 5,
|
|
|
|
AREA_TARGET = 6
|
|
|
|
};
|
|
|
|
|
|
|
|
enum class SkillTargetType {
|
|
|
|
MOBS = 1,
|
2023-07-11 21:42:08 +00:00
|
|
|
PLAYERS = 2,
|
2022-05-18 14:04:28 +00:00
|
|
|
GROUP = 3
|
2022-05-17 00:28:27 +00:00
|
|
|
};
|
|
|
|
|
2022-05-19 01:30:53 +00:00
|
|
|
enum class SkillDrainType {
|
|
|
|
ACTIVE = 1,
|
|
|
|
PASSIVE = 2
|
|
|
|
};
|
|
|
|
|
2022-07-24 01:37:42 +00:00
|
|
|
struct SkillResult {
|
|
|
|
size_t size;
|
2022-07-26 06:01:20 +00:00
|
|
|
uint8_t payload[MAX_SKILLRESULT_SIZE];
|
2022-07-24 01:37:42 +00:00
|
|
|
SkillResult(size_t len, void* dat) {
|
|
|
|
size = len;
|
|
|
|
memcpy(payload, dat, len);
|
|
|
|
}
|
2022-07-26 06:01:20 +00:00
|
|
|
SkillResult() {
|
|
|
|
size = 0;
|
|
|
|
}
|
2022-07-24 01:37:42 +00:00
|
|
|
};
|
|
|
|
|
2021-03-13 20:22:29 +00:00
|
|
|
struct SkillData {
|
2023-07-12 21:04:09 +00:00
|
|
|
SkillType skillType; // eST
|
2022-05-17 00:28:27 +00:00
|
|
|
SkillEffectTarget effectTarget;
|
|
|
|
int effectType; // always 1?
|
|
|
|
SkillTargetType targetType;
|
2022-05-19 01:30:53 +00:00
|
|
|
SkillDrainType drainType;
|
2021-03-13 20:22:29 +00:00
|
|
|
int effectArea;
|
2022-05-16 20:47:30 +00:00
|
|
|
|
2021-03-13 20:22:29 +00:00
|
|
|
int batteryUse[4];
|
|
|
|
int durationTime[4];
|
2022-05-16 20:47:30 +00:00
|
|
|
|
|
|
|
int valueTypes[3];
|
|
|
|
int values[3][4];
|
2021-03-13 20:22:29 +00:00
|
|
|
};
|
|
|
|
|
2021-06-20 15:02:16 +00:00
|
|
|
namespace Abilities {
|
2021-03-13 20:22:29 +00:00
|
|
|
extern std::map<int32_t, SkillData> SkillTable;
|
2022-05-16 20:47:30 +00:00
|
|
|
|
2022-11-27 22:36:47 +00:00
|
|
|
void useNanoSkill(CNSocket*, SkillData*, sNano&, std::vector<ICombatant*>);
|
2022-07-30 20:47:27 +00:00
|
|
|
void useNPCSkill(EntityRef, int skillID, std::vector<ICombatant*>);
|
|
|
|
|
2023-07-11 21:42:08 +00:00
|
|
|
std::vector<ICombatant*> matchTargets(ICombatant*, SkillData*, int, int32_t*);
|
2023-07-12 21:04:09 +00:00
|
|
|
int getCSTBFromST(SkillType skillType);
|
2021-03-13 20:22:29 +00:00
|
|
|
}
|