mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-05 19:46:35 +00:00
[Cleanup] Cleanup Special Ability Code (#4365)
* [Cleanup] Cleanup Special Ability-based Code * Update emu_constants.cpp * Update emu_constants.cpp * Update emu_constants.cpp * Update special_ability.cpp * Cleanup * Update emu_constants.cpp
This commit is contained in:
+10
-12
@@ -41,8 +41,6 @@
|
||||
|
||||
char* strn0cpy(char* dest, const char* source, uint32 size);
|
||||
|
||||
#define MAX_SPECIAL_ATTACK_PARAMS 9
|
||||
|
||||
class Client;
|
||||
class EQApplicationPacket;
|
||||
class Group;
|
||||
@@ -102,22 +100,22 @@ public:
|
||||
CLIENT_KICKED, DISCONNECTED, CLIENT_ERROR, CLIENT_CONNECTINGALL };
|
||||
enum eStandingPetOrder { SPO_Follow, SPO_Sit, SPO_Guard, SPO_FeignDeath };
|
||||
|
||||
struct SpecialAbility {
|
||||
SpecialAbility() {
|
||||
struct MobSpecialAbility {
|
||||
MobSpecialAbility() {
|
||||
level = 0;
|
||||
timer = nullptr;
|
||||
for(int i = 0; i < MAX_SPECIAL_ATTACK_PARAMS; ++i) {
|
||||
for (int i = 0; i < SpecialAbility::MaxParameters; ++i) {
|
||||
params[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
~SpecialAbility() {
|
||||
~MobSpecialAbility() {
|
||||
safe_delete(timer);
|
||||
}
|
||||
|
||||
int level;
|
||||
Timer *timer;
|
||||
int params[MAX_SPECIAL_ATTACK_PARAMS];
|
||||
int params[SpecialAbility::MaxParameters];
|
||||
};
|
||||
|
||||
struct AuraInfo {
|
||||
@@ -1026,15 +1024,15 @@ public:
|
||||
int16 GetModVulnerability(const uint8 resist);
|
||||
|
||||
void SetAllowBeneficial(bool value) { m_AllowBeneficial = value; }
|
||||
bool GetAllowBeneficial() { if (m_AllowBeneficial || GetSpecialAbility(ALLOW_BENEFICIAL)){return true;} return false; }
|
||||
bool GetAllowBeneficial() { if (m_AllowBeneficial || GetSpecialAbility(SpecialAbility::AllowBeneficial)){return true;} return false; }
|
||||
void SetDisableMelee(bool value) { m_DisableMelee = value; }
|
||||
bool IsMeleeDisabled() { if (m_DisableMelee || GetSpecialAbility(DISABLE_MELEE)){return true;} return false; }
|
||||
bool IsMeleeDisabled() { if (m_DisableMelee || GetSpecialAbility(SpecialAbility::DisableMelee)){return true;} return false; }
|
||||
|
||||
bool IsOffHandAtk() const { return offhand; }
|
||||
inline void OffHandAtk(bool val) { offhand = val; }
|
||||
|
||||
void SetFlurryChance(uint8 value) { SetSpecialAbilityParam(SPECATK_FLURRY, 0, value); }
|
||||
uint8 GetFlurryChance() { return GetSpecialAbilityParam(SPECATK_FLURRY, 0); }
|
||||
void SetFlurryChance(uint8 value) { SetSpecialAbilityParam(SpecialAbility::Flurry, 0, value); }
|
||||
uint8 GetFlurryChance() { return GetSpecialAbilityParam(SpecialAbility::Flurry, 0); }
|
||||
|
||||
static uint32 GetAppearanceValue(EmuAppearance in_appearance);
|
||||
void SendAppearancePacket(uint32 type, uint32 value, bool whole_zone = true, bool ignore_self = false, Client* target = nullptr);
|
||||
@@ -1870,7 +1868,7 @@ protected:
|
||||
void InsertQuestGlobal(int charid, int npcid, int zoneid, const char *name, const char *value, int expdate);
|
||||
uint32 emoteid;
|
||||
|
||||
SpecialAbility SpecialAbilities[MAX_SPECIAL_ATTACK];
|
||||
MobSpecialAbility SpecialAbilities[SpecialAbility::Max];
|
||||
bool bEnraged;
|
||||
bool destructibleobject;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user