MCPcopy Create free account
hub / github.com/Norbyte/ositools / CharacterDisableTalent

Function CharacterDisableTalent

OsiInterface/Functions/CharacterFunctions.cpp:125–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123 }
124
125 void CharacterDisableTalent(OsiArgumentDesc const & args)
126 {
127 auto characterGuid = args[0].String;
128 auto talent = args[1].String;
129 auto disabled = args[2].Int32;
130
131 auto character = FindCharacterByNameGuid(characterGuid);
132 if (character == nullptr) return;
133
134 auto permanentBoosts = GetCharacterDynamicStat(character, 1);
135 if (permanentBoosts == nullptr) return;
136
137 auto talentId = EnumInfo<TalentType>::Find(talent);
138 if (!talentId) {
139 OsiError("Talent name is invalid: " << talent);
140 return;
141 }
142
143 permanentBoosts->RemoveTalent(*talentId, disabled != 0);
144 }
145 }
146
147 void CustomFunctionLibrary::RegisterCharacterFunctions()

Callers

nothing calls this directly

Calls 3

FindCharacterByNameGuidFunction · 0.85
GetCharacterDynamicStatFunction · 0.85
RemoveTalentMethod · 0.80

Tested by

no test coverage detected