Skip to content

Commit

Permalink
add spell string
Browse files Browse the repository at this point in the history
  • Loading branch information
hatersgit committed Nov 20, 2023
1 parent d637163 commit b3792a7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 23 deletions.
6 changes: 4 additions & 2 deletions modules/mod-Forge/src/ForgeCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ struct ForgeTalentTab
std::string Background;
std::string Description;
uint8 Role;
std::string SpellString;
CharacterPointType TalentType;
uint32 TabIndex;
std::unordered_map<uint32 /*spellId*/, ForgeTalent*> Talents;
Expand Down Expand Up @@ -1262,8 +1263,9 @@ class ForgeCache : public DatabaseScript
newTab->Background = talentFields[5].Get<std::string>();
newTab->Description = talentFields[6].Get<std::string>();
newTab->Role = talentFields[7].Get<uint8>();
newTab->TalentType = (CharacterPointType)talentFields[8].Get<uint8>();
newTab->TabIndex = talentFields[9].Get<uint32>();
newTab->SpellString = talentFields[8].Get<std::string>();
newTab->TalentType = (CharacterPointType)talentFields[9].Get<uint8>();
newTab->TabIndex = talentFields[10].Get<uint32>();

for (auto& race : RaceAndClassTabMap)
{
Expand Down
25 changes: 4 additions & 21 deletions modules/mod-Forge/src/ForgeCommonMessage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,30 +51,13 @@ std::string ForgeCommonMessage::BuildTree(Player* player, CharacterPointType poi

msg = msg + std::to_string(tab->Id) + "^" +
tab->Name + "^" + std::to_string(tab->SpellIconId) + "^" +
tab->Background + "^" + tab->Description +
"^" + std::to_string(tab->Role) + "^" +
tab->Background + "^" +
tab->Description + "^" +
std::to_string(tab->Role) + "^" +
tab->SpellString + "^" +
std::to_string((int)tab->TalentType) + "^" +
std::to_string(tab->TabIndex) + "^";

auto level10s = fc->_levelClassSpellMap.find(sConfigMgr->GetIntDefault("Forge.StrictSpecs.TalentLevelReq", 10));
if (level10s != fc->_levelClassSpellMap.end()) {
auto pClass = level10s->second.find(player->getClass());
if (pClass != level10s->second.end())
{
auto spec = pClass->second.find(tab->Id);
if (spec != pClass->second.end()) {
auto spells = spec->second;
int j = 0;
for (auto spell : spells) {
auto spellSep = j ? "§" : "";
msg += spellSep + std::to_string(spell);
j++;
}
msg += "^";
}
}
}

int i = 0;

for (auto& talentKvp : tab->Talents)
Expand Down

0 comments on commit b3792a7

Please sign in to comment.