From f690c64f9e9916a65057b8e19bdb4fdb386a5d94 Mon Sep 17 00:00:00 2001 From: Uleat Date: Sun, 20 Jan 2019 20:04:07 -0500 Subject: [PATCH] Moved buff definitions into 'spells' lookup --- common/emu_constants.h | 16 ++-- common/eq_limits.cpp | 136 +++++++++++++++---------------- common/eq_limits.h | 53 ++++++------ common/patches/rof.cpp | 20 ++--- common/patches/rof2.cpp | 20 ++--- common/patches/rof2_limits.h | 16 ++-- common/patches/rof_limits.h | 16 ++-- common/patches/sod.cpp | 20 ++--- common/patches/sod_limits.h | 16 ++-- common/patches/sof.cpp | 20 ++--- common/patches/sof_limits.h | 16 ++-- common/patches/titanium.cpp | 20 ++--- common/patches/titanium_limits.h | 16 ++-- common/patches/uf.cpp | 20 ++--- common/patches/uf_limits.h | 16 ++-- zone/client.h | 8 +- zone/mob.h | 2 +- zone/spells.cpp | 4 +- zone/zonedb.cpp | 2 +- 19 files changed, 219 insertions(+), 218 deletions(-) diff --git a/common/emu_constants.h b/common/emu_constants.h index 9e265753a..6fe6f8ec6 100644 --- a/common/emu_constants.h +++ b/common/emu_constants.h @@ -203,14 +203,6 @@ namespace EQEmu 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 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*/ namespace profile { @@ -254,6 +246,14 @@ namespace EQEmu 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 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 bug { diff --git a/common/eq_limits.cpp b/common/eq_limits.cpp index 09ba6712a..8727ba24b 100644 --- a/common/eq_limits.cpp +++ b/common/eq_limits.cpp @@ -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 ), /*[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 ), /*[ClientVersion::Titanium] =*/ @@ -77,14 +63,7 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu Titanium::constants::EXPANSION_BIT, Titanium::constants::EXPANSIONS_MASK, Titanium::constants::CHARACTER_CREATION_LIMIT, - 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 + Titanium::constants::SAY_LINK_BODY_SIZE ), /*[ClientVersion::SoF] =*/ EQEmu::constants::LookupEntry( @@ -92,14 +71,7 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu SoF::constants::EXPANSION_BIT, SoF::constants::EXPANSIONS_MASK, SoF::constants::CHARACTER_CREATION_LIMIT, - 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 + SoF::constants::SAY_LINK_BODY_SIZE ), /*[ClientVersion::SoD] =*/ EQEmu::constants::LookupEntry( @@ -107,14 +79,7 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu SoD::constants::EXPANSION_BIT, SoD::constants::EXPANSIONS_MASK, SoD::constants::CHARACTER_CREATION_LIMIT, - 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 + SoD::constants::SAY_LINK_BODY_SIZE ), /*[ClientVersion::UF] =*/ EQEmu::constants::LookupEntry( @@ -122,14 +87,7 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu UF::constants::EXPANSION_BIT, UF::constants::EXPANSIONS_MASK, UF::constants::CHARACTER_CREATION_LIMIT, - 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 + UF::constants::SAY_LINK_BODY_SIZE ), /*[ClientVersion::RoF] =*/ EQEmu::constants::LookupEntry( @@ -137,14 +95,7 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu RoF::constants::EXPANSION_BIT, RoF::constants::EXPANSIONS_MASK, RoF::constants::CHARACTER_CREATION_LIMIT, - 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 + RoF::constants::SAY_LINK_BODY_SIZE ), /*[ClientVersion::RoF2] =*/ EQEmu::constants::LookupEntry( @@ -152,14 +103,7 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu RoF2::constants::EXPANSION_BIT, RoF2::constants::EXPANSIONS_MASK, RoF2::constants::CHARACTER_CREATION_LIMIT, - 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 + RoF2::constants::SAY_LINK_BODY_SIZE ) }; @@ -1133,12 +1077,26 @@ static const EQEmu::spells::LookupEntry spells_static_lookup_entries[EQEmu::vers { /*[ClientVersion::Unknown] =*/ EQEmu::spells::LookupEntry( + ClientUnknown::INULL, + ClientUnknown::INULL, + ClientUnknown::INULL, + ClientUnknown::INULL, + ClientUnknown::INULL, + ClientUnknown::INULL, + ClientUnknown::INULL, ClientUnknown::INULL, ClientUnknown::INULL, ClientUnknown::INULL ), /*[ClientVersion::Client62] =*/ EQEmu::spells::LookupEntry( + 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( Titanium::spells::SPELL_ID_MAX, 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] =*/ EQEmu::spells::LookupEntry( SoF::spells::SPELL_ID_MAX, 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] =*/ EQEmu::spells::LookupEntry( SoD::spells::SPELL_ID_MAX, 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] =*/ EQEmu::spells::LookupEntry( UF::spells::SPELL_ID_MAX, 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] =*/ EQEmu::spells::LookupEntry( RoF::spells::SPELL_ID_MAX, 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] =*/ EQEmu::spells::LookupEntry( RoF2::spells::SPELL_ID_MAX, 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 ) }; diff --git a/common/eq_limits.h b/common/eq_limits.h index c27bc1eb8..0c862fe38 100644 --- a/common/eq_limits.h +++ b/common/eq_limits.h @@ -42,41 +42,20 @@ namespace EQEmu uint32 ExpansionsMask; int16 CharacterCreationLimit; size_t SayLinkBodySize; - int LongBuffs; - int ShortBuffs; - int DiscBuffs; - int TotalBuffs; - int NPCBuffs; - int PetBuffs; - int MercBuffs; - + LookupEntry(const LookupEntry *lookup_entry) { } LookupEntry( EQEmu::expansions::Expansion Expansion, uint32 ExpansionBit, uint32 ExpansionsMask, int16 CharacterCreationLimit, - size_t SayLinkBodySize, - int LongBuffs, - int ShortBuffs, - int DiscBuffs, - int TotalBuffs, - int NPCBuffs, - int PetBuffs, - int MercBuffs + size_t SayLinkBodySize ) : Expansion(Expansion), ExpansionBit(ExpansionBit), ExpansionsMask(ExpansionsMask), CharacterCreationLimit(CharacterCreationLimit), - SayLinkBodySize(SayLinkBodySize), - LongBuffs(LongBuffs), - ShortBuffs(ShortBuffs), - DiscBuffs(DiscBuffs), - TotalBuffs(TotalBuffs), - NPCBuffs(NPCBuffs), - PetBuffs(PetBuffs), - MercBuffs(MercBuffs) + SayLinkBodySize(SayLinkBodySize) { } }; @@ -210,16 +189,38 @@ namespace EQEmu int SpellIdMax; int SpellbookSize; int SpellGemCount; + + int LongBuffs; + int ShortBuffs; + int DiscBuffs; + int TotalBuffs; + int NPCBuffs; + int PetBuffs; + int MercBuffs; LookupEntry(const LookupEntry *lookup_entry) { } LookupEntry( int SpellIdMax, int SpellbookSize, - int SpellGemCount + int SpellGemCount, + int LongBuffs, + int ShortBuffs, + int DiscBuffs, + int TotalBuffs, + int NPCBuffs, + int PetBuffs, + int MercBuffs ) : SpellIdMax(SpellIdMax), SpellbookSize(SpellbookSize), - SpellGemCount(SpellGemCount) + SpellGemCount(SpellGemCount), + LongBuffs(LongBuffs), + ShortBuffs(ShortBuffs), + DiscBuffs(DiscBuffs), + TotalBuffs(TotalBuffs), + NPCBuffs(NPCBuffs), + PetBuffs(PetBuffs), + MercBuffs(MercBuffs) { } }; diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index a539282bf..5a87748a4 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -6169,12 +6169,12 @@ namespace RoF static inline int ServerToRoFBuffSlot(int index) { // we're a disc - if (index >= EQEmu::constants::LongBuffs + EQEmu::constants::ShortBuffs) - return index - EQEmu::constants::LongBuffs - EQEmu::constants::ShortBuffs + - constants::LongBuffs + constants::ShortBuffs; + if (index >= EQEmu::spells::LONG_BUFFS + EQEmu::spells::SHORT_BUFFS) + return index - EQEmu::spells::LONG_BUFFS - EQEmu::spells::SHORT_BUFFS + + spells::LONG_BUFFS + spells::SHORT_BUFFS; // we're a song - if (index >= EQEmu::constants::LongBuffs) - return index - EQEmu::constants::LongBuffs + constants::LongBuffs; + if (index >= EQEmu::spells::LONG_BUFFS) + return index - EQEmu::spells::LONG_BUFFS + spells::LONG_BUFFS; // we're a normal buff 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) { // we're a disc - if (index >= constants::LongBuffs + constants::ShortBuffs) - return index - constants::LongBuffs - constants::ShortBuffs + EQEmu::constants::LongBuffs + - EQEmu::constants::ShortBuffs; + if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS) + return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQEmu::spells::LONG_BUFFS + + EQEmu::spells::SHORT_BUFFS; // we're a song - if (index >= constants::LongBuffs) - return index - constants::LongBuffs + EQEmu::constants::LongBuffs; + if (index >= spells::LONG_BUFFS) + return index - spells::LONG_BUFFS + EQEmu::spells::LONG_BUFFS; // we're a normal buff return index; // as long as we guard against bad slots server side, we should be fine } diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index 7aa1411b6..74453f1ff 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -6424,12 +6424,12 @@ namespace RoF2 static inline int ServerToRoF2BuffSlot(int index) { // we're a disc - if (index >= EQEmu::constants::LongBuffs + EQEmu::constants::ShortBuffs) - return index - EQEmu::constants::LongBuffs - EQEmu::constants::ShortBuffs + - constants::LongBuffs + constants::ShortBuffs; + if (index >= EQEmu::spells::LONG_BUFFS + EQEmu::spells::SHORT_BUFFS) + return index - EQEmu::spells::LONG_BUFFS - EQEmu::spells::SHORT_BUFFS + + spells::LONG_BUFFS + spells::SHORT_BUFFS; // we're a song - if (index >= EQEmu::constants::LongBuffs) - return index - EQEmu::constants::LongBuffs + constants::LongBuffs; + if (index >= EQEmu::spells::LONG_BUFFS) + return index - EQEmu::spells::LONG_BUFFS + spells::LONG_BUFFS; // we're a normal buff 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) { // we're a disc - if (index >= constants::LongBuffs + constants::ShortBuffs) - return index - constants::LongBuffs - constants::ShortBuffs + EQEmu::constants::LongBuffs + - EQEmu::constants::ShortBuffs; + if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS) + return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQEmu::spells::LONG_BUFFS + + EQEmu::spells::SHORT_BUFFS; // we're a song - if (index >= constants::LongBuffs) - return index - constants::LongBuffs + EQEmu::constants::LongBuffs; + if (index >= spells::LONG_BUFFS) + return index - spells::LONG_BUFFS + EQEmu::spells::LONG_BUFFS; // we're a normal buff return index; // as long as we guard against bad slots server side, we should be fine } diff --git a/common/patches/rof2_limits.h b/common/patches/rof2_limits.h index 6f741a9bc..b3a1a4962 100644 --- a/common/patches/rof2_limits.h +++ b/common/patches/rof2_limits.h @@ -271,14 +271,6 @@ namespace RoF2 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*/ namespace behavior { @@ -321,6 +313,14 @@ namespace RoF2 const int SPELLBOOK_SIZE = 720; const int SPELL_GEM_COUNT = static_cast(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*/ }; /*RoF2*/ diff --git a/common/patches/rof_limits.h b/common/patches/rof_limits.h index 739c19898..460ebfddb 100644 --- a/common/patches/rof_limits.h +++ b/common/patches/rof_limits.h @@ -262,14 +262,6 @@ namespace RoF 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*/ namespace behavior { @@ -312,6 +304,14 @@ namespace RoF const int SPELLBOOK_SIZE = 720; const int SPELL_GEM_COUNT = static_cast(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*/ }; /*RoF*/ diff --git a/common/patches/sod.cpp b/common/patches/sod.cpp index 34e724960..e64510d06 100644 --- a/common/patches/sod.cpp +++ b/common/patches/sod.cpp @@ -4093,12 +4093,12 @@ namespace SoD static inline int ServerToSoDBuffSlot(int index) { // we're a disc - if (index >= EQEmu::constants::LongBuffs + EQEmu::constants::ShortBuffs) - return index - EQEmu::constants::LongBuffs - EQEmu::constants::ShortBuffs + - constants::LongBuffs + constants::ShortBuffs; + if (index >= EQEmu::spells::LONG_BUFFS + EQEmu::spells::SHORT_BUFFS) + return index - EQEmu::spells::LONG_BUFFS - EQEmu::spells::SHORT_BUFFS + + spells::LONG_BUFFS + spells::SHORT_BUFFS; // we're a song - if (index >= EQEmu::constants::LongBuffs) - return index - EQEmu::constants::LongBuffs + constants::LongBuffs; + if (index >= EQEmu::spells::LONG_BUFFS) + return index - EQEmu::spells::LONG_BUFFS + spells::LONG_BUFFS; // we're a normal buff 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) { // we're a disc - if (index >= constants::LongBuffs + constants::ShortBuffs) - return index - constants::LongBuffs - constants::ShortBuffs + EQEmu::constants::LongBuffs + - EQEmu::constants::ShortBuffs; + if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS) + return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQEmu::spells::LONG_BUFFS + + EQEmu::spells::SHORT_BUFFS; // we're a song - if (index >= constants::LongBuffs) - return index - constants::LongBuffs + EQEmu::constants::LongBuffs; + if (index >= spells::LONG_BUFFS) + return index - spells::LONG_BUFFS + EQEmu::spells::LONG_BUFFS; // we're a normal buff return index; // as long as we guard against bad slots server side, we should be fine } diff --git a/common/patches/sod_limits.h b/common/patches/sod_limits.h index a26075cdb..7927a255b 100644 --- a/common/patches/sod_limits.h +++ b/common/patches/sod_limits.h @@ -289,14 +289,6 @@ namespace SoD 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*/ namespace behavior { @@ -337,6 +329,14 @@ namespace SoD const int SPELLBOOK_SIZE = 480; const int SPELL_GEM_COUNT = static_cast(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*/ }; /*SoD*/ diff --git a/common/patches/sof.cpp b/common/patches/sof.cpp index 1b1d9dc28..a1141f99c 100644 --- a/common/patches/sof.cpp +++ b/common/patches/sof.cpp @@ -3491,12 +3491,12 @@ namespace SoF static inline int ServerToSoFBuffSlot(int index) { // we're a disc - if (index >= EQEmu::constants::LongBuffs + EQEmu::constants::ShortBuffs) - return index - EQEmu::constants::LongBuffs - EQEmu::constants::ShortBuffs + - constants::LongBuffs + constants::ShortBuffs; + if (index >= EQEmu::spells::LONG_BUFFS + EQEmu::spells::SHORT_BUFFS) + return index - EQEmu::spells::LONG_BUFFS - EQEmu::spells::SHORT_BUFFS + + spells::LONG_BUFFS + spells::SHORT_BUFFS; // we're a song - if (index >= EQEmu::constants::LongBuffs) - return index - EQEmu::constants::LongBuffs + constants::LongBuffs; + if (index >= EQEmu::spells::LONG_BUFFS) + return index - EQEmu::spells::LONG_BUFFS + spells::LONG_BUFFS; // we're a normal buff 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) { // we're a disc - if (index >= constants::LongBuffs + constants::ShortBuffs) - return index - constants::LongBuffs - constants::ShortBuffs + EQEmu::constants::LongBuffs + - EQEmu::constants::ShortBuffs; + if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS) + return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQEmu::spells::LONG_BUFFS + + EQEmu::spells::SHORT_BUFFS; // we're a song - if (index >= constants::LongBuffs) - return index - constants::LongBuffs + EQEmu::constants::LongBuffs; + if (index >= spells::LONG_BUFFS) + return index - spells::LONG_BUFFS + EQEmu::spells::LONG_BUFFS; // we're a normal buff return index; // as long as we guard against bad slots server side, we should be fine } diff --git a/common/patches/sof_limits.h b/common/patches/sof_limits.h index 8f682c8c1..399ff8c1a 100644 --- a/common/patches/sof_limits.h +++ b/common/patches/sof_limits.h @@ -289,14 +289,6 @@ namespace SoF 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*/ namespace behavior { @@ -338,6 +330,14 @@ namespace SoF const int SPELLBOOK_SIZE = 480; const int SPELL_GEM_COUNT = static_cast(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*/ }; /*SoF*/ diff --git a/common/patches/titanium.cpp b/common/patches/titanium.cpp index 05357e3af..9220875a8 100644 --- a/common/patches/titanium.cpp +++ b/common/patches/titanium.cpp @@ -2794,12 +2794,12 @@ namespace Titanium static inline int ServerToTitaniumBuffSlot(int index) { // we're a disc - if (index >= EQEmu::constants::LongBuffs + EQEmu::constants::ShortBuffs) - return index - EQEmu::constants::LongBuffs - EQEmu::constants::ShortBuffs + - constants::LongBuffs + constants::ShortBuffs; + if (index >= EQEmu::spells::LONG_BUFFS + EQEmu::spells::SHORT_BUFFS) + return index - EQEmu::spells::LONG_BUFFS - EQEmu::spells::SHORT_BUFFS + + spells::LONG_BUFFS + spells::SHORT_BUFFS; // we're a song - if (index >= EQEmu::constants::LongBuffs) - return index - EQEmu::constants::LongBuffs + constants::LongBuffs; + if (index >= EQEmu::spells::LONG_BUFFS) + return index - EQEmu::spells::LONG_BUFFS + spells::LONG_BUFFS; // we're a normal buff 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) { // we're a disc - if (index >= constants::LongBuffs + constants::ShortBuffs) - return index - constants::LongBuffs - constants::ShortBuffs + EQEmu::constants::LongBuffs + - EQEmu::constants::ShortBuffs; + if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS) + return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQEmu::spells::LONG_BUFFS + + EQEmu::spells::SHORT_BUFFS; // we're a song - if (index >= constants::LongBuffs) - return index - constants::LongBuffs + EQEmu::constants::LongBuffs; + if (index >= spells::LONG_BUFFS) + return index - spells::LONG_BUFFS + EQEmu::spells::LONG_BUFFS; // we're a normal buff return index; // as long as we guard against bad slots server side, we should be fine } diff --git a/common/patches/titanium_limits.h b/common/patches/titanium_limits.h index 28eb414e3..5a804defb 100644 --- a/common/patches/titanium_limits.h +++ b/common/patches/titanium_limits.h @@ -288,14 +288,6 @@ namespace Titanium 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*/ namespace behavior { @@ -337,6 +329,14 @@ namespace Titanium const int SPELLBOOK_SIZE = 400; const int SPELL_GEM_COUNT = static_cast(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*/ }; /*Titanium*/ diff --git a/common/patches/uf.cpp b/common/patches/uf.cpp index 47d6bb4ff..9e87a7579 100644 --- a/common/patches/uf.cpp +++ b/common/patches/uf.cpp @@ -4460,12 +4460,12 @@ namespace UF static inline int ServerToUFBuffSlot(int index) { // we're a disc - if (index >= EQEmu::constants::LongBuffs + EQEmu::constants::ShortBuffs) - return index - EQEmu::constants::LongBuffs - EQEmu::constants::ShortBuffs + - constants::LongBuffs + constants::ShortBuffs; + if (index >= EQEmu::spells::LONG_BUFFS + EQEmu::spells::SHORT_BUFFS) + return index - EQEmu::spells::LONG_BUFFS - EQEmu::spells::SHORT_BUFFS + + spells::LONG_BUFFS + spells::SHORT_BUFFS; // we're a song - if (index >= EQEmu::constants::LongBuffs) - return index - EQEmu::constants::LongBuffs + constants::LongBuffs; + if (index >= EQEmu::spells::LONG_BUFFS) + return index - EQEmu::spells::LONG_BUFFS + spells::LONG_BUFFS; // we're a normal buff 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) { // we're a disc - if (index >= constants::LongBuffs + constants::ShortBuffs) - return index - constants::LongBuffs - constants::ShortBuffs + EQEmu::constants::LongBuffs + - EQEmu::constants::ShortBuffs; + if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS) + return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQEmu::spells::LONG_BUFFS + + EQEmu::spells::SHORT_BUFFS; // we're a song - if (index >= constants::LongBuffs) - return index - constants::LongBuffs + EQEmu::constants::LongBuffs; + if (index >= spells::LONG_BUFFS) + return index - spells::LONG_BUFFS + EQEmu::spells::LONG_BUFFS; // we're a normal buff return index; // as long as we guard against bad slots server side, we should be fine } diff --git a/common/patches/uf_limits.h b/common/patches/uf_limits.h index 5f5d5e199..429d57cd5 100644 --- a/common/patches/uf_limits.h +++ b/common/patches/uf_limits.h @@ -290,14 +290,6 @@ namespace UF 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*/ namespace behavior { @@ -340,6 +332,14 @@ namespace UF const int SPELLBOOK_SIZE = 720; const int SPELL_GEM_COUNT = static_cast(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*/ }; /*UF*/ diff --git a/zone/client.h b/zone/client.h index 854786efc..d1ccbb399 100644 --- a/zone/client.h +++ b/zone/client.h @@ -557,10 +557,10 @@ public: virtual int GetCurrentBuffSlots() const; virtual int GetCurrentSongSlots() const; virtual int GetCurrentDiscSlots() const { return 1; } - virtual int GetMaxBuffSlots() const { return EQEmu::constants::LongBuffs; } - virtual int GetMaxSongSlots() const { return EQEmu::constants::ShortBuffs; } - virtual int GetMaxDiscSlots() const { return EQEmu::constants::DiscBuffs; } - virtual int GetMaxTotalSlots() const { return EQEmu::constants::TotalBuffs; } + virtual int GetMaxBuffSlots() const { return EQEmu::spells::LONG_BUFFS; } + virtual int GetMaxSongSlots() const { return EQEmu::spells::SHORT_BUFFS; } + virtual int GetMaxDiscSlots() const { return EQEmu::spells::DISC_BUFFS; } + virtual int GetMaxTotalSlots() const { return EQEmu::spells::TOTAL_BUFFS; } virtual uint32 GetFirstBuffSlot(bool disc, bool song); virtual uint32 GetLastBuffSlot(bool disc, bool song); virtual void InitializeBuffSlots(); diff --git a/zone/mob.h b/zone/mob.h index 40e1a0dfd..ad65bab39 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -1538,7 +1538,7 @@ protected: glm::vec3 m_TargetRing; // 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; bool m_targetable; int QGVarDuration(const char *fmt); diff --git a/zone/spells.cpp b/zone/spells.cpp index 9e3c11b6b..c88522a57 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -5619,12 +5619,12 @@ int Client::GetCurrentBuffSlots() const numbuffs++; if (GetLevel() > 74) 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 { - 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() diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 29873a38e..420e9ec7d 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -3646,7 +3646,7 @@ void ZoneDatabase::LoadBuffs(Client *client) } // 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) { if (!IsValidSpell(buffs[index].spellid)) continue;