AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
Acore::Hyperlinks::LinkTags::talent Struct Reference

#include "Hyperlinks.h"

Public Types

using value_type = TalentLinkData const &
 

Static Public Member Functions

static constexpr std::string_view tag ()
 
static bool StoreTo (TalentLinkData &val, std::string_view data)
 

Detailed Description

Member Typedef Documentation

◆ value_type

Member Function Documentation

◆ StoreTo()

bool Acore::Hyperlinks::LinkTags::talent::StoreTo ( TalentLinkData val,
std::string_view  data 
)
static
213{
215 uint32 talentId;
216 int8 rank; // talent links contain <learned rank>-1, we store <learned rank>
217
218 if (!(t.TryConsumeTo(talentId) && t.TryConsumeTo(rank) && t.IsEmpty()))
219 return false;
220
221 if (rank < -1 || rank >= MAX_TALENT_RANK)
222 return false;
223
224 val.Talent = sTalentStore.LookupEntry(talentId);
225 val.Rank = rank+1;
226
227 if (!val.Talent)
228 return false;
229
230 if (val.Rank > 0)
231 {
232 uint32 const spellId = val.Talent->RankID[val.Rank - 1];
233 if (!spellId)
234 return false;
235
236 val.Spell = sSpellMgr->GetSpellInfo(spellId);
237
238 if (!val.Spell)
239 return false;
240 }
241 else
242 {
243 val.Spell = nullptr;
244 }
245
246 return true;
247}
std::uint32_t uint32
Definition: Define.h:107
std::int8_t int8
Definition: Define.h:105
DBCStorage< TalentEntry > sTalentStore(TalentEntryfmt)
#define sSpellMgr
Definition: SpellMgr.h:825
#define MAX_TALENT_RANK
Definition: DBCStructure.h:1918
Definition: HyperlinkTags.cpp:28

References HyperlinkDataTokenizer::IsEmpty(), MAX_TALENT_RANK, Acore::Hyperlinks::TalentLinkData::Rank, TalentEntry::RankID, Acore::Hyperlinks::TalentLinkData::Spell, sSpellMgr, sTalentStore, Acore::Hyperlinks::TalentLinkData::Talent, and HyperlinkDataTokenizer::TryConsumeTo().

◆ tag()

static constexpr std::string_view Acore::Hyperlinks::LinkTags::talent::tag ( )
inlinestaticconstexpr
206{ return "talent"; }