Moved buff definitions into 'spells' lookup

This commit is contained in:
Uleat 2019-01-20 20:04:07 -05:00
parent 585c6322bf
commit f690c64f9e
19 changed files with 219 additions and 218 deletions

View File

@ -203,14 +203,6 @@ namespace EQEmu
const size_t SAY_LINK_CLOSER_SIZE = 1; const size_t SAY_LINK_CLOSER_SIZE = 1;
const size_t SAY_LINK_MAXIMUM_SIZE = (SAY_LINK_OPENER_SIZE + SAY_LINK_BODY_SIZE + SAY_LINK_TEXT_SIZE + SAY_LINK_CLOSER_SIZE); const size_t SAY_LINK_MAXIMUM_SIZE = (SAY_LINK_OPENER_SIZE + SAY_LINK_BODY_SIZE + SAY_LINK_TEXT_SIZE + SAY_LINK_CLOSER_SIZE);
const int LongBuffs = RoF2::constants::LongBuffs;
const int ShortBuffs = RoF2::constants::ShortBuffs;
const int DiscBuffs = RoF2::constants::DiscBuffs;
const int TotalBuffs = RoF2::constants::TotalBuffs;
const int NPCBuffs = RoF2::constants::NPCBuffs;
const int PetBuffs = RoF2::constants::PetBuffs;
const int MercBuffs = RoF2::constants::MercBuffs;
} /*constants*/ } /*constants*/
namespace profile { namespace profile {
@ -254,6 +246,14 @@ namespace EQEmu
using SoD::spells::SPELLBOOK_SIZE; using SoD::spells::SPELLBOOK_SIZE;
using UF::spells::SPELL_GEM_COUNT; // RoF+ clients define more than UF client..but, they are not valid beyond UF using UF::spells::SPELL_GEM_COUNT; // RoF+ clients define more than UF client..but, they are not valid beyond UF
using RoF2::spells::LONG_BUFFS;
using RoF2::spells::SHORT_BUFFS;
using RoF2::spells::DISC_BUFFS;
using RoF2::spells::TOTAL_BUFFS;
using RoF2::spells::NPC_BUFFS;
using RoF2::spells::PET_BUFFS;
using RoF2::spells::MERC_BUFFS;
} // namespace spells } // namespace spells
namespace bug { namespace bug {

View File

@ -47,13 +47,6 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu
ClientUnknown::INULL, ClientUnknown::INULL,
ClientUnknown::INULL, ClientUnknown::INULL,
ClientUnknown::INULL, ClientUnknown::INULL,
ClientUnknown::INULL,
ClientUnknown::INULL,
ClientUnknown::INULL,
ClientUnknown::INULL,
ClientUnknown::INULL,
ClientUnknown::INULL,
ClientUnknown::INULL,
ClientUnknown::INULL ClientUnknown::INULL
), ),
/*[ClientVersion::Client62] =*/ /*[ClientVersion::Client62] =*/
@ -62,13 +55,6 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu
Client62::INULL, Client62::INULL,
Client62::INULL, Client62::INULL,
Client62::INULL, Client62::INULL,
Client62::INULL,
Client62::INULL,
Client62::INULL,
Client62::INULL,
Client62::INULL,
Client62::INULL,
Client62::INULL,
Client62::INULL Client62::INULL
), ),
/*[ClientVersion::Titanium] =*/ /*[ClientVersion::Titanium] =*/
@ -77,14 +63,7 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu
Titanium::constants::EXPANSION_BIT, Titanium::constants::EXPANSION_BIT,
Titanium::constants::EXPANSIONS_MASK, Titanium::constants::EXPANSIONS_MASK,
Titanium::constants::CHARACTER_CREATION_LIMIT, Titanium::constants::CHARACTER_CREATION_LIMIT,
Titanium::constants::SAY_LINK_BODY_SIZE, Titanium::constants::SAY_LINK_BODY_SIZE
Titanium::constants::LongBuffs,
Titanium::constants::ShortBuffs,
Titanium::constants::DiscBuffs,
Titanium::constants::TotalBuffs,
Titanium::constants::NPCBuffs,
Titanium::constants::PetBuffs,
Titanium::constants::MercBuffs
), ),
/*[ClientVersion::SoF] =*/ /*[ClientVersion::SoF] =*/
EQEmu::constants::LookupEntry( EQEmu::constants::LookupEntry(
@ -92,14 +71,7 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu
SoF::constants::EXPANSION_BIT, SoF::constants::EXPANSION_BIT,
SoF::constants::EXPANSIONS_MASK, SoF::constants::EXPANSIONS_MASK,
SoF::constants::CHARACTER_CREATION_LIMIT, SoF::constants::CHARACTER_CREATION_LIMIT,
SoF::constants::SAY_LINK_BODY_SIZE, SoF::constants::SAY_LINK_BODY_SIZE
SoF::constants::LongBuffs,
SoF::constants::ShortBuffs,
SoF::constants::DiscBuffs,
SoF::constants::TotalBuffs,
SoF::constants::NPCBuffs,
SoF::constants::PetBuffs,
SoF::constants::MercBuffs
), ),
/*[ClientVersion::SoD] =*/ /*[ClientVersion::SoD] =*/
EQEmu::constants::LookupEntry( EQEmu::constants::LookupEntry(
@ -107,14 +79,7 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu
SoD::constants::EXPANSION_BIT, SoD::constants::EXPANSION_BIT,
SoD::constants::EXPANSIONS_MASK, SoD::constants::EXPANSIONS_MASK,
SoD::constants::CHARACTER_CREATION_LIMIT, SoD::constants::CHARACTER_CREATION_LIMIT,
SoD::constants::SAY_LINK_BODY_SIZE, SoD::constants::SAY_LINK_BODY_SIZE
SoD::constants::LongBuffs,
SoD::constants::ShortBuffs,
SoD::constants::DiscBuffs,
SoD::constants::TotalBuffs,
SoD::constants::NPCBuffs,
SoD::constants::PetBuffs,
SoD::constants::MercBuffs
), ),
/*[ClientVersion::UF] =*/ /*[ClientVersion::UF] =*/
EQEmu::constants::LookupEntry( EQEmu::constants::LookupEntry(
@ -122,14 +87,7 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu
UF::constants::EXPANSION_BIT, UF::constants::EXPANSION_BIT,
UF::constants::EXPANSIONS_MASK, UF::constants::EXPANSIONS_MASK,
UF::constants::CHARACTER_CREATION_LIMIT, UF::constants::CHARACTER_CREATION_LIMIT,
UF::constants::SAY_LINK_BODY_SIZE, UF::constants::SAY_LINK_BODY_SIZE
UF::constants::LongBuffs,
UF::constants::ShortBuffs,
UF::constants::DiscBuffs,
UF::constants::TotalBuffs,
UF::constants::NPCBuffs,
UF::constants::PetBuffs,
UF::constants::MercBuffs
), ),
/*[ClientVersion::RoF] =*/ /*[ClientVersion::RoF] =*/
EQEmu::constants::LookupEntry( EQEmu::constants::LookupEntry(
@ -137,14 +95,7 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu
RoF::constants::EXPANSION_BIT, RoF::constants::EXPANSION_BIT,
RoF::constants::EXPANSIONS_MASK, RoF::constants::EXPANSIONS_MASK,
RoF::constants::CHARACTER_CREATION_LIMIT, RoF::constants::CHARACTER_CREATION_LIMIT,
RoF::constants::SAY_LINK_BODY_SIZE, RoF::constants::SAY_LINK_BODY_SIZE
RoF::constants::LongBuffs,
RoF::constants::ShortBuffs,
RoF::constants::DiscBuffs,
RoF::constants::TotalBuffs,
RoF::constants::NPCBuffs,
RoF::constants::PetBuffs,
RoF::constants::MercBuffs
), ),
/*[ClientVersion::RoF2] =*/ /*[ClientVersion::RoF2] =*/
EQEmu::constants::LookupEntry( EQEmu::constants::LookupEntry(
@ -152,14 +103,7 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu
RoF2::constants::EXPANSION_BIT, RoF2::constants::EXPANSION_BIT,
RoF2::constants::EXPANSIONS_MASK, RoF2::constants::EXPANSIONS_MASK,
RoF2::constants::CHARACTER_CREATION_LIMIT, RoF2::constants::CHARACTER_CREATION_LIMIT,
RoF2::constants::SAY_LINK_BODY_SIZE, RoF2::constants::SAY_LINK_BODY_SIZE
RoF2::constants::LongBuffs,
RoF2::constants::ShortBuffs,
RoF2::constants::DiscBuffs,
RoF2::constants::TotalBuffs,
RoF2::constants::NPCBuffs,
RoF2::constants::PetBuffs,
RoF2::constants::MercBuffs
) )
}; };
@ -1133,12 +1077,26 @@ static const EQEmu::spells::LookupEntry spells_static_lookup_entries[EQEmu::vers
{ {
/*[ClientVersion::Unknown] =*/ /*[ClientVersion::Unknown] =*/
EQEmu::spells::LookupEntry( EQEmu::spells::LookupEntry(
ClientUnknown::INULL,
ClientUnknown::INULL,
ClientUnknown::INULL,
ClientUnknown::INULL,
ClientUnknown::INULL,
ClientUnknown::INULL,
ClientUnknown::INULL,
ClientUnknown::INULL, ClientUnknown::INULL,
ClientUnknown::INULL, ClientUnknown::INULL,
ClientUnknown::INULL ClientUnknown::INULL
), ),
/*[ClientVersion::Client62] =*/ /*[ClientVersion::Client62] =*/
EQEmu::spells::LookupEntry( EQEmu::spells::LookupEntry(
Client62::INULL,
Client62::INULL,
Client62::INULL,
Client62::INULL,
Client62::INULL,
Client62::INULL,
Client62::INULL,
Client62::INULL, Client62::INULL,
Client62::INULL, Client62::INULL,
Client62::INULL Client62::INULL
@ -1147,37 +1105,79 @@ static const EQEmu::spells::LookupEntry spells_static_lookup_entries[EQEmu::vers
EQEmu::spells::LookupEntry( EQEmu::spells::LookupEntry(
Titanium::spells::SPELL_ID_MAX, Titanium::spells::SPELL_ID_MAX,
Titanium::spells::SPELLBOOK_SIZE, Titanium::spells::SPELLBOOK_SIZE,
Titanium::spells::SPELL_GEM_COUNT Titanium::spells::SPELL_GEM_COUNT,
Titanium::spells::LONG_BUFFS,
Titanium::spells::SHORT_BUFFS,
Titanium::spells::DISC_BUFFS,
Titanium::spells::TOTAL_BUFFS,
Titanium::spells::NPC_BUFFS,
Titanium::spells::PET_BUFFS,
Titanium::spells::MERC_BUFFS
), ),
/*[ClientVersion::SoF] =*/ /*[ClientVersion::SoF] =*/
EQEmu::spells::LookupEntry( EQEmu::spells::LookupEntry(
SoF::spells::SPELL_ID_MAX, SoF::spells::SPELL_ID_MAX,
SoF::spells::SPELLBOOK_SIZE, SoF::spells::SPELLBOOK_SIZE,
SoF::spells::SPELL_GEM_COUNT SoF::spells::SPELL_GEM_COUNT,
SoF::spells::LONG_BUFFS,
SoF::spells::SHORT_BUFFS,
SoF::spells::DISC_BUFFS,
SoF::spells::TOTAL_BUFFS,
SoF::spells::NPC_BUFFS,
SoF::spells::PET_BUFFS,
SoF::spells::MERC_BUFFS
), ),
/*[ClientVersion::SoD] =*/ /*[ClientVersion::SoD] =*/
EQEmu::spells::LookupEntry( EQEmu::spells::LookupEntry(
SoD::spells::SPELL_ID_MAX, SoD::spells::SPELL_ID_MAX,
SoD::spells::SPELLBOOK_SIZE, SoD::spells::SPELLBOOK_SIZE,
SoD::spells::SPELL_GEM_COUNT SoD::spells::SPELL_GEM_COUNT,
SoD::spells::LONG_BUFFS,
SoD::spells::SHORT_BUFFS,
SoD::spells::DISC_BUFFS,
SoD::spells::TOTAL_BUFFS,
SoD::spells::NPC_BUFFS,
SoD::spells::PET_BUFFS,
SoD::spells::MERC_BUFFS
), ),
/*[ClientVersion::UF] =*/ /*[ClientVersion::UF] =*/
EQEmu::spells::LookupEntry( EQEmu::spells::LookupEntry(
UF::spells::SPELL_ID_MAX, UF::spells::SPELL_ID_MAX,
SoD::spells::SPELLBOOK_SIZE, SoD::spells::SPELLBOOK_SIZE,
UF::spells::SPELL_GEM_COUNT UF::spells::SPELL_GEM_COUNT,
UF::spells::LONG_BUFFS,
UF::spells::SHORT_BUFFS,
UF::spells::DISC_BUFFS,
UF::spells::TOTAL_BUFFS,
UF::spells::NPC_BUFFS,
UF::spells::PET_BUFFS,
UF::spells::MERC_BUFFS
), ),
/*[ClientVersion::RoF] =*/ /*[ClientVersion::RoF] =*/
EQEmu::spells::LookupEntry( EQEmu::spells::LookupEntry(
RoF::spells::SPELL_ID_MAX, RoF::spells::SPELL_ID_MAX,
SoD::spells::SPELLBOOK_SIZE, SoD::spells::SPELLBOOK_SIZE,
UF::spells::SPELL_GEM_COUNT // client translators are setup to allow the max value a client supports..however, the top 4 indices are not valid in this case UF::spells::SPELL_GEM_COUNT, // client translators are setup to allow the max value a client supports..however, the top 4 indices are not valid in this case
RoF::spells::LONG_BUFFS,
RoF::spells::SHORT_BUFFS,
RoF::spells::DISC_BUFFS,
RoF::spells::TOTAL_BUFFS,
RoF::spells::NPC_BUFFS,
RoF::spells::PET_BUFFS,
RoF::spells::MERC_BUFFS
), ),
/*[ClientVersion::RoF2] =*/ /*[ClientVersion::RoF2] =*/
EQEmu::spells::LookupEntry( EQEmu::spells::LookupEntry(
RoF2::spells::SPELL_ID_MAX, RoF2::spells::SPELL_ID_MAX,
SoD::spells::SPELLBOOK_SIZE, SoD::spells::SPELLBOOK_SIZE,
UF::spells::SPELL_GEM_COUNT // client translators are setup to allow the max value a client supports..however, the top 4 indices are not valid in this case UF::spells::SPELL_GEM_COUNT, // client translators are setup to allow the max value a client supports..however, the top 4 indices are not valid in this case
RoF2::spells::LONG_BUFFS,
RoF2::spells::SHORT_BUFFS,
RoF2::spells::DISC_BUFFS,
RoF2::spells::TOTAL_BUFFS,
RoF2::spells::NPC_BUFFS,
RoF2::spells::PET_BUFFS,
RoF2::spells::MERC_BUFFS
) )
}; };

View File

@ -42,41 +42,20 @@ namespace EQEmu
uint32 ExpansionsMask; uint32 ExpansionsMask;
int16 CharacterCreationLimit; int16 CharacterCreationLimit;
size_t SayLinkBodySize; size_t SayLinkBodySize;
int LongBuffs;
int ShortBuffs;
int DiscBuffs;
int TotalBuffs;
int NPCBuffs;
int PetBuffs;
int MercBuffs;
LookupEntry(const LookupEntry *lookup_entry) { } LookupEntry(const LookupEntry *lookup_entry) { }
LookupEntry( LookupEntry(
EQEmu::expansions::Expansion Expansion, EQEmu::expansions::Expansion Expansion,
uint32 ExpansionBit, uint32 ExpansionBit,
uint32 ExpansionsMask, uint32 ExpansionsMask,
int16 CharacterCreationLimit, int16 CharacterCreationLimit,
size_t SayLinkBodySize, size_t SayLinkBodySize
int LongBuffs,
int ShortBuffs,
int DiscBuffs,
int TotalBuffs,
int NPCBuffs,
int PetBuffs,
int MercBuffs
) : ) :
Expansion(Expansion), Expansion(Expansion),
ExpansionBit(ExpansionBit), ExpansionBit(ExpansionBit),
ExpansionsMask(ExpansionsMask), ExpansionsMask(ExpansionsMask),
CharacterCreationLimit(CharacterCreationLimit), CharacterCreationLimit(CharacterCreationLimit),
SayLinkBodySize(SayLinkBodySize), SayLinkBodySize(SayLinkBodySize)
LongBuffs(LongBuffs),
ShortBuffs(ShortBuffs),
DiscBuffs(DiscBuffs),
TotalBuffs(TotalBuffs),
NPCBuffs(NPCBuffs),
PetBuffs(PetBuffs),
MercBuffs(MercBuffs)
{ } { }
}; };
@ -210,16 +189,38 @@ namespace EQEmu
int SpellIdMax; int SpellIdMax;
int SpellbookSize; int SpellbookSize;
int SpellGemCount; int SpellGemCount;
int LongBuffs;
int ShortBuffs;
int DiscBuffs;
int TotalBuffs;
int NPCBuffs;
int PetBuffs;
int MercBuffs;
LookupEntry(const LookupEntry *lookup_entry) { } LookupEntry(const LookupEntry *lookup_entry) { }
LookupEntry( LookupEntry(
int SpellIdMax, int SpellIdMax,
int SpellbookSize, int SpellbookSize,
int SpellGemCount int SpellGemCount,
int LongBuffs,
int ShortBuffs,
int DiscBuffs,
int TotalBuffs,
int NPCBuffs,
int PetBuffs,
int MercBuffs
) : ) :
SpellIdMax(SpellIdMax), SpellIdMax(SpellIdMax),
SpellbookSize(SpellbookSize), SpellbookSize(SpellbookSize),
SpellGemCount(SpellGemCount) SpellGemCount(SpellGemCount),
LongBuffs(LongBuffs),
ShortBuffs(ShortBuffs),
DiscBuffs(DiscBuffs),
TotalBuffs(TotalBuffs),
NPCBuffs(NPCBuffs),
PetBuffs(PetBuffs),
MercBuffs(MercBuffs)
{ } { }
}; };

View File

@ -6169,12 +6169,12 @@ namespace RoF
static inline int ServerToRoFBuffSlot(int index) static inline int ServerToRoFBuffSlot(int index)
{ {
// we're a disc // we're a disc
if (index >= EQEmu::constants::LongBuffs + EQEmu::constants::ShortBuffs) if (index >= EQEmu::spells::LONG_BUFFS + EQEmu::spells::SHORT_BUFFS)
return index - EQEmu::constants::LongBuffs - EQEmu::constants::ShortBuffs + return index - EQEmu::spells::LONG_BUFFS - EQEmu::spells::SHORT_BUFFS +
constants::LongBuffs + constants::ShortBuffs; spells::LONG_BUFFS + spells::SHORT_BUFFS;
// we're a song // we're a song
if (index >= EQEmu::constants::LongBuffs) if (index >= EQEmu::spells::LONG_BUFFS)
return index - EQEmu::constants::LongBuffs + constants::LongBuffs; return index - EQEmu::spells::LONG_BUFFS + spells::LONG_BUFFS;
// we're a normal buff // we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine return index; // as long as we guard against bad slots server side, we should be fine
} }
@ -6182,12 +6182,12 @@ namespace RoF
static inline int RoFToServerBuffSlot(int index) static inline int RoFToServerBuffSlot(int index)
{ {
// we're a disc // we're a disc
if (index >= constants::LongBuffs + constants::ShortBuffs) if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS)
return index - constants::LongBuffs - constants::ShortBuffs + EQEmu::constants::LongBuffs + return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQEmu::spells::LONG_BUFFS +
EQEmu::constants::ShortBuffs; EQEmu::spells::SHORT_BUFFS;
// we're a song // we're a song
if (index >= constants::LongBuffs) if (index >= spells::LONG_BUFFS)
return index - constants::LongBuffs + EQEmu::constants::LongBuffs; return index - spells::LONG_BUFFS + EQEmu::spells::LONG_BUFFS;
// we're a normal buff // we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine return index; // as long as we guard against bad slots server side, we should be fine
} }

View File

@ -6424,12 +6424,12 @@ namespace RoF2
static inline int ServerToRoF2BuffSlot(int index) static inline int ServerToRoF2BuffSlot(int index)
{ {
// we're a disc // we're a disc
if (index >= EQEmu::constants::LongBuffs + EQEmu::constants::ShortBuffs) if (index >= EQEmu::spells::LONG_BUFFS + EQEmu::spells::SHORT_BUFFS)
return index - EQEmu::constants::LongBuffs - EQEmu::constants::ShortBuffs + return index - EQEmu::spells::LONG_BUFFS - EQEmu::spells::SHORT_BUFFS +
constants::LongBuffs + constants::ShortBuffs; spells::LONG_BUFFS + spells::SHORT_BUFFS;
// we're a song // we're a song
if (index >= EQEmu::constants::LongBuffs) if (index >= EQEmu::spells::LONG_BUFFS)
return index - EQEmu::constants::LongBuffs + constants::LongBuffs; return index - EQEmu::spells::LONG_BUFFS + spells::LONG_BUFFS;
// we're a normal buff // we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine return index; // as long as we guard against bad slots server side, we should be fine
} }
@ -6437,12 +6437,12 @@ namespace RoF2
static inline int RoF2ToServerBuffSlot(int index) static inline int RoF2ToServerBuffSlot(int index)
{ {
// we're a disc // we're a disc
if (index >= constants::LongBuffs + constants::ShortBuffs) if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS)
return index - constants::LongBuffs - constants::ShortBuffs + EQEmu::constants::LongBuffs + return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQEmu::spells::LONG_BUFFS +
EQEmu::constants::ShortBuffs; EQEmu::spells::SHORT_BUFFS;
// we're a song // we're a song
if (index >= constants::LongBuffs) if (index >= spells::LONG_BUFFS)
return index - constants::LongBuffs + EQEmu::constants::LongBuffs; return index - spells::LONG_BUFFS + EQEmu::spells::LONG_BUFFS;
// we're a normal buff // we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine return index; // as long as we guard against bad slots server side, we should be fine
} }

View File

@ -271,14 +271,6 @@ namespace RoF2
const size_t SAY_LINK_BODY_SIZE = 56; const size_t SAY_LINK_BODY_SIZE = 56;
const int LongBuffs = 42;
const int ShortBuffs = 20;
const int DiscBuffs = 1;
const int TotalBuffs = LongBuffs + ShortBuffs + DiscBuffs;
const int NPCBuffs = 97;
const int PetBuffs = NPCBuffs;
const int MercBuffs = LongBuffs;
} /*constants*/ } /*constants*/
namespace behavior { namespace behavior {
@ -321,6 +313,14 @@ namespace RoF2
const int SPELLBOOK_SIZE = 720; const int SPELLBOOK_SIZE = 720;
const int SPELL_GEM_COUNT = static_cast<uint32>(CastingSlot::MaxGems); const int SPELL_GEM_COUNT = static_cast<uint32>(CastingSlot::MaxGems);
const int LONG_BUFFS = 42;
const int SHORT_BUFFS = 20;
const int DISC_BUFFS = 1;
const int TOTAL_BUFFS = LONG_BUFFS + SHORT_BUFFS + DISC_BUFFS;
const int NPC_BUFFS = 97;
const int PET_BUFFS = NPC_BUFFS;
const int MERC_BUFFS = LONG_BUFFS;
} /*spells*/ } /*spells*/
}; /*RoF2*/ }; /*RoF2*/

View File

@ -262,14 +262,6 @@ namespace RoF
const size_t SAY_LINK_BODY_SIZE = 55; const size_t SAY_LINK_BODY_SIZE = 55;
const int LongBuffs = 42;
const int ShortBuffs = 20;
const int DiscBuffs = 1;
const int TotalBuffs = LongBuffs + ShortBuffs + DiscBuffs;
const int NPCBuffs = 97;
const int PetBuffs = NPCBuffs;
const int MercBuffs = LongBuffs;
} /*constants*/ } /*constants*/
namespace behavior { namespace behavior {
@ -312,6 +304,14 @@ namespace RoF
const int SPELLBOOK_SIZE = 720; const int SPELLBOOK_SIZE = 720;
const int SPELL_GEM_COUNT = static_cast<uint32>(CastingSlot::MaxGems); const int SPELL_GEM_COUNT = static_cast<uint32>(CastingSlot::MaxGems);
const int LONG_BUFFS = 42;
const int SHORT_BUFFS = 20;
const int DISC_BUFFS = 1;
const int TOTAL_BUFFS = LONG_BUFFS + SHORT_BUFFS + DISC_BUFFS;
const int NPC_BUFFS = 97;
const int PET_BUFFS = NPC_BUFFS;
const int MERC_BUFFS = LONG_BUFFS;
} /*spells*/ } /*spells*/
}; /*RoF*/ }; /*RoF*/

View File

@ -4093,12 +4093,12 @@ namespace SoD
static inline int ServerToSoDBuffSlot(int index) static inline int ServerToSoDBuffSlot(int index)
{ {
// we're a disc // we're a disc
if (index >= EQEmu::constants::LongBuffs + EQEmu::constants::ShortBuffs) if (index >= EQEmu::spells::LONG_BUFFS + EQEmu::spells::SHORT_BUFFS)
return index - EQEmu::constants::LongBuffs - EQEmu::constants::ShortBuffs + return index - EQEmu::spells::LONG_BUFFS - EQEmu::spells::SHORT_BUFFS +
constants::LongBuffs + constants::ShortBuffs; spells::LONG_BUFFS + spells::SHORT_BUFFS;
// we're a song // we're a song
if (index >= EQEmu::constants::LongBuffs) if (index >= EQEmu::spells::LONG_BUFFS)
return index - EQEmu::constants::LongBuffs + constants::LongBuffs; return index - EQEmu::spells::LONG_BUFFS + spells::LONG_BUFFS;
// we're a normal buff // we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine return index; // as long as we guard against bad slots server side, we should be fine
} }
@ -4106,12 +4106,12 @@ namespace SoD
static inline int SoDToServerBuffSlot(int index) static inline int SoDToServerBuffSlot(int index)
{ {
// we're a disc // we're a disc
if (index >= constants::LongBuffs + constants::ShortBuffs) if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS)
return index - constants::LongBuffs - constants::ShortBuffs + EQEmu::constants::LongBuffs + return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQEmu::spells::LONG_BUFFS +
EQEmu::constants::ShortBuffs; EQEmu::spells::SHORT_BUFFS;
// we're a song // we're a song
if (index >= constants::LongBuffs) if (index >= spells::LONG_BUFFS)
return index - constants::LongBuffs + EQEmu::constants::LongBuffs; return index - spells::LONG_BUFFS + EQEmu::spells::LONG_BUFFS;
// we're a normal buff // we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine return index; // as long as we guard against bad slots server side, we should be fine
} }

View File

@ -289,14 +289,6 @@ namespace SoD
const size_t SAY_LINK_BODY_SIZE = 50; const size_t SAY_LINK_BODY_SIZE = 50;
const int LongBuffs = 25;
const int ShortBuffs = 15;
const int DiscBuffs = 1;
const int TotalBuffs = LongBuffs + ShortBuffs + DiscBuffs;
const int NPCBuffs = 85;
const int PetBuffs = NPCBuffs;
const int MercBuffs = LongBuffs;
} /*constants*/ } /*constants*/
namespace behavior { namespace behavior {
@ -337,6 +329,14 @@ namespace SoD
const int SPELLBOOK_SIZE = 480; const int SPELLBOOK_SIZE = 480;
const int SPELL_GEM_COUNT = static_cast<uint32>(CastingSlot::MaxGems); const int SPELL_GEM_COUNT = static_cast<uint32>(CastingSlot::MaxGems);
const int LONG_BUFFS = 25;
const int SHORT_BUFFS = 15;
const int DISC_BUFFS = 1;
const int TOTAL_BUFFS = LONG_BUFFS + SHORT_BUFFS + DISC_BUFFS;
const int NPC_BUFFS = 85;
const int PET_BUFFS = NPC_BUFFS;
const int MERC_BUFFS = LONG_BUFFS;
} /*spells*/ } /*spells*/
}; /*SoD*/ }; /*SoD*/

View File

@ -3491,12 +3491,12 @@ namespace SoF
static inline int ServerToSoFBuffSlot(int index) { static inline int ServerToSoFBuffSlot(int index) {
// we're a disc // we're a disc
if (index >= EQEmu::constants::LongBuffs + EQEmu::constants::ShortBuffs) if (index >= EQEmu::spells::LONG_BUFFS + EQEmu::spells::SHORT_BUFFS)
return index - EQEmu::constants::LongBuffs - EQEmu::constants::ShortBuffs + return index - EQEmu::spells::LONG_BUFFS - EQEmu::spells::SHORT_BUFFS +
constants::LongBuffs + constants::ShortBuffs; spells::LONG_BUFFS + spells::SHORT_BUFFS;
// we're a song // we're a song
if (index >= EQEmu::constants::LongBuffs) if (index >= EQEmu::spells::LONG_BUFFS)
return index - EQEmu::constants::LongBuffs + constants::LongBuffs; return index - EQEmu::spells::LONG_BUFFS + spells::LONG_BUFFS;
// we're a normal buff // we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine return index; // as long as we guard against bad slots server side, we should be fine
} }
@ -3504,12 +3504,12 @@ namespace SoF
static inline int SoFToServerBuffSlot(int index) static inline int SoFToServerBuffSlot(int index)
{ {
// we're a disc // we're a disc
if (index >= constants::LongBuffs + constants::ShortBuffs) if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS)
return index - constants::LongBuffs - constants::ShortBuffs + EQEmu::constants::LongBuffs + return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQEmu::spells::LONG_BUFFS +
EQEmu::constants::ShortBuffs; EQEmu::spells::SHORT_BUFFS;
// we're a song // we're a song
if (index >= constants::LongBuffs) if (index >= spells::LONG_BUFFS)
return index - constants::LongBuffs + EQEmu::constants::LongBuffs; return index - spells::LONG_BUFFS + EQEmu::spells::LONG_BUFFS;
// we're a normal buff // we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine return index; // as long as we guard against bad slots server side, we should be fine
} }

View File

@ -289,14 +289,6 @@ namespace SoF
const size_t SAY_LINK_BODY_SIZE = 50; const size_t SAY_LINK_BODY_SIZE = 50;
const int LongBuffs = 25;
const int ShortBuffs = 15;
const int DiscBuffs = 1;
const int TotalBuffs = LongBuffs + ShortBuffs + DiscBuffs;
const int NPCBuffs = 60;
const int PetBuffs = 30;
const int MercBuffs = 0;
} /*constants*/ } /*constants*/
namespace behavior { namespace behavior {
@ -338,6 +330,14 @@ namespace SoF
const int SPELLBOOK_SIZE = 480; const int SPELLBOOK_SIZE = 480;
const int SPELL_GEM_COUNT = static_cast<uint32>(CastingSlot::MaxGems); const int SPELL_GEM_COUNT = static_cast<uint32>(CastingSlot::MaxGems);
const int LONG_BUFFS = 25;
const int SHORT_BUFFS = 15;
const int DISC_BUFFS = 1;
const int TOTAL_BUFFS = LONG_BUFFS + SHORT_BUFFS + DISC_BUFFS;
const int NPC_BUFFS = 60;
const int PET_BUFFS = 30;
const int MERC_BUFFS = 0;
} /*spells*/ } /*spells*/
}; /*SoF*/ }; /*SoF*/

View File

@ -2794,12 +2794,12 @@ namespace Titanium
static inline int ServerToTitaniumBuffSlot(int index) static inline int ServerToTitaniumBuffSlot(int index)
{ {
// we're a disc // we're a disc
if (index >= EQEmu::constants::LongBuffs + EQEmu::constants::ShortBuffs) if (index >= EQEmu::spells::LONG_BUFFS + EQEmu::spells::SHORT_BUFFS)
return index - EQEmu::constants::LongBuffs - EQEmu::constants::ShortBuffs + return index - EQEmu::spells::LONG_BUFFS - EQEmu::spells::SHORT_BUFFS +
constants::LongBuffs + constants::ShortBuffs; spells::LONG_BUFFS + spells::SHORT_BUFFS;
// we're a song // we're a song
if (index >= EQEmu::constants::LongBuffs) if (index >= EQEmu::spells::LONG_BUFFS)
return index - EQEmu::constants::LongBuffs + constants::LongBuffs; return index - EQEmu::spells::LONG_BUFFS + spells::LONG_BUFFS;
// we're a normal buff // we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine return index; // as long as we guard against bad slots server side, we should be fine
} }
@ -2807,12 +2807,12 @@ namespace Titanium
static inline int TitaniumToServerBuffSlot(int index) static inline int TitaniumToServerBuffSlot(int index)
{ {
// we're a disc // we're a disc
if (index >= constants::LongBuffs + constants::ShortBuffs) if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS)
return index - constants::LongBuffs - constants::ShortBuffs + EQEmu::constants::LongBuffs + return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQEmu::spells::LONG_BUFFS +
EQEmu::constants::ShortBuffs; EQEmu::spells::SHORT_BUFFS;
// we're a song // we're a song
if (index >= constants::LongBuffs) if (index >= spells::LONG_BUFFS)
return index - constants::LongBuffs + EQEmu::constants::LongBuffs; return index - spells::LONG_BUFFS + EQEmu::spells::LONG_BUFFS;
// we're a normal buff // we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine return index; // as long as we guard against bad slots server side, we should be fine
} }

View File

@ -288,14 +288,6 @@ namespace Titanium
const size_t SAY_LINK_BODY_SIZE = 45; const size_t SAY_LINK_BODY_SIZE = 45;
const int LongBuffs = 25;
const int ShortBuffs = 12;
const int DiscBuffs = 1;
const int TotalBuffs = LongBuffs + ShortBuffs + DiscBuffs;
const int NPCBuffs = 60;
const int PetBuffs = 30;
const int MercBuffs = 0;
} /*constants*/ } /*constants*/
namespace behavior { namespace behavior {
@ -337,6 +329,14 @@ namespace Titanium
const int SPELLBOOK_SIZE = 400; const int SPELLBOOK_SIZE = 400;
const int SPELL_GEM_COUNT = static_cast<uint32>(CastingSlot::MaxGems); const int SPELL_GEM_COUNT = static_cast<uint32>(CastingSlot::MaxGems);
const int LONG_BUFFS = 25;
const int SHORT_BUFFS = 12;
const int DISC_BUFFS = 1;
const int TOTAL_BUFFS = LONG_BUFFS + SHORT_BUFFS + DISC_BUFFS;
const int NPC_BUFFS = 60;
const int PET_BUFFS = 30;
const int MERC_BUFFS = 0;
} /*spells*/ } /*spells*/
}; /*Titanium*/ }; /*Titanium*/

View File

@ -4460,12 +4460,12 @@ namespace UF
static inline int ServerToUFBuffSlot(int index) static inline int ServerToUFBuffSlot(int index)
{ {
// we're a disc // we're a disc
if (index >= EQEmu::constants::LongBuffs + EQEmu::constants::ShortBuffs) if (index >= EQEmu::spells::LONG_BUFFS + EQEmu::spells::SHORT_BUFFS)
return index - EQEmu::constants::LongBuffs - EQEmu::constants::ShortBuffs + return index - EQEmu::spells::LONG_BUFFS - EQEmu::spells::SHORT_BUFFS +
constants::LongBuffs + constants::ShortBuffs; spells::LONG_BUFFS + spells::SHORT_BUFFS;
// we're a song // we're a song
if (index >= EQEmu::constants::LongBuffs) if (index >= EQEmu::spells::LONG_BUFFS)
return index - EQEmu::constants::LongBuffs + constants::LongBuffs; return index - EQEmu::spells::LONG_BUFFS + spells::LONG_BUFFS;
// we're a normal buff // we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine return index; // as long as we guard against bad slots server side, we should be fine
} }
@ -4473,12 +4473,12 @@ namespace UF
static inline int UFToServerBuffSlot(int index) static inline int UFToServerBuffSlot(int index)
{ {
// we're a disc // we're a disc
if (index >= constants::LongBuffs + constants::ShortBuffs) if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS)
return index - constants::LongBuffs - constants::ShortBuffs + EQEmu::constants::LongBuffs + return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQEmu::spells::LONG_BUFFS +
EQEmu::constants::ShortBuffs; EQEmu::spells::SHORT_BUFFS;
// we're a song // we're a song
if (index >= constants::LongBuffs) if (index >= spells::LONG_BUFFS)
return index - constants::LongBuffs + EQEmu::constants::LongBuffs; return index - spells::LONG_BUFFS + EQEmu::spells::LONG_BUFFS;
// we're a normal buff // we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine return index; // as long as we guard against bad slots server side, we should be fine
} }

View File

@ -290,14 +290,6 @@ namespace UF
const size_t SAY_LINK_BODY_SIZE = 50; const size_t SAY_LINK_BODY_SIZE = 50;
const int LongBuffs = 30;
const int ShortBuffs = 20;
const int DiscBuffs = 1;
const int TotalBuffs = LongBuffs + ShortBuffs + DiscBuffs;
const int NPCBuffs = 85;
const int PetBuffs = NPCBuffs;
const int MercBuffs = LongBuffs;
} /*constants*/ } /*constants*/
namespace behavior { namespace behavior {
@ -340,6 +332,14 @@ namespace UF
const int SPELLBOOK_SIZE = 720; const int SPELLBOOK_SIZE = 720;
const int SPELL_GEM_COUNT = static_cast<uint32>(CastingSlot::MaxGems); const int SPELL_GEM_COUNT = static_cast<uint32>(CastingSlot::MaxGems);
const int LONG_BUFFS = 30;
const int SHORT_BUFFS = 20;
const int DISC_BUFFS = 1;
const int TOTAL_BUFFS = LONG_BUFFS + SHORT_BUFFS + DISC_BUFFS;
const int NPC_BUFFS = 85;
const int PET_BUFFS = NPC_BUFFS;
const int MERC_BUFFS = LONG_BUFFS;
} /*spells*/ } /*spells*/
}; /*UF*/ }; /*UF*/

View File

@ -557,10 +557,10 @@ public:
virtual int GetCurrentBuffSlots() const; virtual int GetCurrentBuffSlots() const;
virtual int GetCurrentSongSlots() const; virtual int GetCurrentSongSlots() const;
virtual int GetCurrentDiscSlots() const { return 1; } virtual int GetCurrentDiscSlots() const { return 1; }
virtual int GetMaxBuffSlots() const { return EQEmu::constants::LongBuffs; } virtual int GetMaxBuffSlots() const { return EQEmu::spells::LONG_BUFFS; }
virtual int GetMaxSongSlots() const { return EQEmu::constants::ShortBuffs; } virtual int GetMaxSongSlots() const { return EQEmu::spells::SHORT_BUFFS; }
virtual int GetMaxDiscSlots() const { return EQEmu::constants::DiscBuffs; } virtual int GetMaxDiscSlots() const { return EQEmu::spells::DISC_BUFFS; }
virtual int GetMaxTotalSlots() const { return EQEmu::constants::TotalBuffs; } virtual int GetMaxTotalSlots() const { return EQEmu::spells::TOTAL_BUFFS; }
virtual uint32 GetFirstBuffSlot(bool disc, bool song); virtual uint32 GetFirstBuffSlot(bool disc, bool song);
virtual uint32 GetLastBuffSlot(bool disc, bool song); virtual uint32 GetLastBuffSlot(bool disc, bool song);
virtual void InitializeBuffSlots(); virtual void InitializeBuffSlots();

View File

@ -1538,7 +1538,7 @@ protected:
glm::vec3 m_TargetRing; glm::vec3 m_TargetRing;
// we might want to do this differently, we gotta do max NPC buffs ... which is 97 // we might want to do this differently, we gotta do max NPC buffs ... which is 97
uint32 m_spellHitsLeft[EQEmu::constants::TotalBuffs]; // Used to track which spells will have their numhits incremented when spell finishes casting uint32 m_spellHitsLeft[EQEmu::spells::TOTAL_BUFFS]; // Used to track which spells will have their numhits incremented when spell finishes casting
GravityBehavior flymode; GravityBehavior flymode;
bool m_targetable; bool m_targetable;
int QGVarDuration(const char *fmt); int QGVarDuration(const char *fmt);

View File

@ -5619,12 +5619,12 @@ int Client::GetCurrentBuffSlots() const
numbuffs++; numbuffs++;
if (GetLevel() > 74) if (GetLevel() > 74)
numbuffs++; numbuffs++;
return EQEmu::ClampUpper(numbuffs, EQEmu::constants::StaticLookup(m_ClientVersion)->LongBuffs); return EQEmu::ClampUpper(numbuffs, EQEmu::spells::StaticLookup(m_ClientVersion)->LongBuffs);
} }
int Client::GetCurrentSongSlots() const int Client::GetCurrentSongSlots() const
{ {
return EQEmu::constants::StaticLookup(m_ClientVersion)->ShortBuffs; // AAs dont affect this return EQEmu::spells::StaticLookup(m_ClientVersion)->ShortBuffs; // AAs dont affect this
} }
void Client::InitializeBuffSlots() void Client::InitializeBuffSlots()

View File

@ -3646,7 +3646,7 @@ void ZoneDatabase::LoadBuffs(Client *client)
} }
// We load up to the most our client supports // We load up to the most our client supports
max_slots = EQEmu::constants::StaticLookup(client->ClientVersion())->LongBuffs; max_slots = EQEmu::spells::StaticLookup(client->ClientVersion())->LongBuffs;
for (int index = 0; index < max_slots; ++index) { for (int index = 0; index < max_slots; ++index) {
if (!IsValidSpell(buffs[index].spellid)) if (!IsValidSpell(buffs[index].spellid))
continue; continue;