converted spell id's to integers and made the internal representation 322-bit

This commit is contained in:
dannuic
2026-04-26 23:53:57 -06:00
parent 05cb1921e8
commit 5de441fa20
134 changed files with 1644 additions and 1645 deletions
+13 -13
View File
@@ -47,7 +47,7 @@ constexpr int MAXMERCS = 11;
const int MercAISpellRange = 100; // TODO: Write a method that calcs what the merc's spell range is based on spell, equipment, AA, whatever and replace this
struct MercSpell {
uint16 spellid; // <= 0 = no spell
int32 spellid; // <= 0 = no spell
uint32 type; // 0 = never, must be one (and only one) of the defined values
int16 stance; // 0 = all, + = only this stance, - = all except this stance
int16 slot;
@@ -58,7 +58,7 @@ struct MercSpell {
struct MercTimer {
uint16 timerid; // EndurTimerIndex
uint8 timertype; // 1 = spell, 2 = disc
uint16 spellid; // <= 0 = no spell
int32 spellid; // <= 0 = no spell
uint32 time_cancast; // when we can cast this spell next
};
@@ -68,8 +68,8 @@ public:
virtual ~Merc();
//abstract virtual function implementations requird by base abstract class
virtual bool Death(Mob* killer_mob, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, uint8 killed_by = 0, bool is_buff_tic = false);
virtual void Damage(Mob* from, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None);
virtual bool Death(Mob* killer_mob, int64 damage, int32 spell_id, EQ::skills::SkillType attack_skill, uint8 killed_by = 0, bool is_buff_tic = false);
virtual void Damage(Mob* from, int64 damage, int32 spell_id, EQ::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None);
virtual bool Attack(Mob* other, int Hand = EQ::invslot::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false,
bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr);
virtual bool HasRaid() { return false; }
@@ -84,7 +84,7 @@ public:
//virtual bool AICastSpell(Mob* tar, int8 iChance, uint32 iSpellTypes);
virtual bool AICastSpell(int8 iChance, uint32 iSpellTypes);
virtual bool AIDoSpellCast(uint16 spellid, Mob* tar, int32 mana_cost, uint32* oDontDoAgainBefore = 0);
virtual bool AIDoSpellCast(int32 spellid, Mob* tar, int32 mana_cost, uint32* oDontDoAgainBefore = 0);
virtual bool AI_EngagedCastCheck();
//virtual bool AI_PursueCastCheck();
virtual bool AI_IdleCastCheck();
@@ -100,20 +100,20 @@ public:
// Merc Spell Casting Methods
int8 GetChanceToCastBySpellType(uint32 spellType);
void SetSpellRecastTimer(uint16 timer_id, uint16 spellid, uint32 recast_delay);
void SetDisciplineRecastTimer(uint16 timer_id, uint16 spellid, uint32 recast_delay);
void SetSpellTimeCanCast(uint16 spellid, uint32 recast_delay);
void SetSpellRecastTimer(uint16 timer_id, int32 spellid, uint32 recast_delay);
void SetDisciplineRecastTimer(uint16 timer_id, int32 spellid, uint32 recast_delay);
void SetSpellTimeCanCast(int32 spellid, uint32 recast_delay);
static int32 GetSpellRecastTimer(Merc *caster, uint16 timer_id);
static bool CheckSpellRecastTimers(Merc *caster, uint16 spellid);
static bool CheckSpellRecastTimers(Merc *caster, int32 spellid);
static int32 GetDisciplineRecastTimer(Merc *caster, uint16 timer_id);
static bool CheckDisciplineRecastTimers(Merc *caster, uint16 spell_id, uint16 timer_id);
static bool CheckDisciplineRecastTimers(Merc *caster, int32 spell_id, uint16 timer_id);
static int32 GetDisciplineRemainingTime(Merc *caster, uint16 timer_id);
static std::list<MercSpell> GetMercSpellsForSpellEffect(Merc* caster, int spellEffect);
static std::list<MercSpell> GetMercSpellsForSpellEffectAndTargetType(Merc* caster, int spellEffect, SpellTargetType targetType);
static std::list<MercSpell> GetMercSpellsBySpellType(Merc* caster, uint32 spellType);
static MercSpell GetFirstMercSpellBySpellType(Merc* caster, uint32 spellType);
static MercSpell GetFirstMercSpellForSingleTargetHeal(Merc* caster);
static MercSpell GetMercSpellBySpellID(Merc* caster, uint16 spellid);
static MercSpell GetMercSpellBySpellID(Merc* caster, int32 spellid);
static MercSpell GetBestMercSpellForVeryFastHeal(Merc* caster);
static MercSpell GetBestMercSpellForFastHeal(Merc* caster);
static MercSpell GetBestMercSpellForHealOverTime(Merc* caster);
@@ -133,7 +133,7 @@ public:
static MercSpell GetBestMercSpellForAERainNuke(Merc* caster, Mob* target);
static MercSpell GetBestMercSpellForNuke(Merc* caster);
static MercSpell GetBestMercSpellForNukeByTargetResists(Merc* caster, Mob* target);
static bool CheckAENuke(Merc* caster, Mob* tar, uint16 spell_id, uint8 &numTargets);
static bool CheckAENuke(Merc* caster, Mob* tar, int32 spell_id, uint8 &numTargets);
static bool GetNeedsCured(Mob *tar);
bool HasOrMayGetAggro();
bool UseDiscipline(int32 spell_id, int32 target);
@@ -287,7 +287,7 @@ public:
bool FindTarget();
protected:
int64 GetFocusEffect(focusType type, uint16 spell_id, bool from_buff_tic = false);
int64 GetFocusEffect(focusType type, int32 spell_id, bool from_buff_tic = false);
std::vector<MercSpell> merc_spells;
std::map<uint32,MercTimer> timers;