This commit is contained in:
KimLS
2017-08-09 10:42:07 -07:00
43 changed files with 1620 additions and 175 deletions
+39 -1
View File
@@ -45,6 +45,8 @@ class EQApplicationPacket;
class Group;
class NPC;
class Raid;
class Aura;
struct AuraRecord;
struct NewSpawn_Struct;
struct PlayerPositionUpdateServer_Struct;
@@ -85,6 +87,23 @@ public:
int params[MAX_SPECIAL_ATTACK_PARAMS];
};
struct AuraInfo {
char name[64];
int spawn_id;
int icon;
Aura *aura;
AuraInfo() : spawn_id(0), icon(0), aura(nullptr)
{
memset(name, 0, 64);
}
};
struct AuraMgr {
int count; // active auras
AuraInfo auras[AURA_HARDCAP];
AuraMgr() : count(0) { }
};
Mob(const char* in_name,
const char* in_lastname,
int32 in_cur_hp,
@@ -308,6 +327,7 @@ public:
void BuffProcess();
virtual void DoBuffTic(const Buffs_Struct &buff, int slot, Mob* caster = nullptr);
void BuffFadeBySpellID(uint16 spell_id);
void BuffFadeBySpellIDAndCaster(uint16 spell_id, uint16 caster_id);
void BuffFadeByEffect(int effectid, int skipslot = -1);
void BuffFadeAll();
void BuffFadeNonPersistDeath();
@@ -315,6 +335,7 @@ public:
void BuffFadeBySlot(int slot, bool iRecalcBonuses = true);
void BuffFadeDetrimentalByCaster(Mob *caster);
void BuffFadeBySitModifier();
bool IsAffectedByBuff(uint16 spell_id);
void BuffModifyDurationBySpellID(uint16 spell_id, int32 newDuration);
int AddBuff(Mob *caster, const uint16 spell_id, int duration = 0, int32 level_override = -1);
int CanBuffStack(uint16 spellid, uint8 caster_level, bool iFailIfOverwrite = false);
@@ -528,6 +549,7 @@ public:
void SendPosition();
void SetSpawned() { spawned = true; };
bool Spawned() { return spawned; };
virtual bool ShouldISpawnFor(Client *c) { return true; }
void SetFlyMode(uint8 flymode);
inline void Teleport(glm::vec3 NewPosition) { m_Position.x = NewPosition.x; m_Position.y = NewPosition.y;
m_Position.z = NewPosition.z; };
@@ -604,6 +626,19 @@ public:
bool PlotPositionAroundTarget(Mob* target, float &x_dest, float &y_dest, float &z_dest,
bool lookForAftArc = true);
// aura functions
void MakeAura(uint16 spell_id);
inline int GetAuraSlots() { return 1 + aabonuses.aura_slots + itembonuses.aura_slots + spellbonuses.aura_slots; }
inline int GetTrapSlots() { return 1 + aabonuses.trap_slots + itembonuses.trap_slots + spellbonuses.trap_slots; }
inline bool HasFreeAuraSlots() { return aura_mgr.count < GetAuraSlots(); }
inline bool HasFreeTrapSlots() { return trap_mgr.count < GetTrapSlots(); }
void AddAura(Aura *aura, AuraRecord &record);
void AddTrap(Aura *aura, AuraRecord &record);
bool CanSpawnAura(bool trap);
void RemoveAura(int spawn_id, bool skip_strip = false, bool expired = false);
void RemoveAllAuras();
inline AuraMgr &GetAuraMgr() { return aura_mgr; } // mainly used for zone db loading/saving
//Procs
void TriggerDefensiveProcs(Mob *on, uint16 hand = EQEmu::inventory::slotPrimary, bool FromSkillProc = false, int damage = 0);
bool AddRangedProc(uint16 spell_id, uint16 iChance = 3, uint16 base_spell_id = SPELL_UNKNOWN);
@@ -1090,7 +1125,7 @@ protected:
int _GetWalkSpeed() const;
int _GetRunSpeed() const;
int _GetFearSpeed() const;
virtual bool MakeNewPositionAndSendUpdate(float x, float y, float z, int speed, bool checkZ);
virtual bool MakeNewPositionAndSendUpdate(float x, float y, float z, int speed);
virtual bool AI_EngagedCastCheck() { return(false); }
virtual bool AI_PursueCastCheck() { return(false); }
@@ -1455,6 +1490,9 @@ protected:
bool IsHorse;
AuraMgr aura_mgr;
AuraMgr trap_mgr;
private:
void _StopSong(); //this is not what you think it is
Mob* target;