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

Function ItemSetPermanentBoost

OsiInterface/Functions/ItemFunctions.cpp:145–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143
144 template <OsiPropertyMapType Type>
145 void ItemSetPermanentBoost(OsiArgumentDesc const & args)
146 {
147 auto item = FindItemByNameGuid(args[0].String);
148 if (item == nullptr) return;
149
150 auto permanentBoosts = GetItemDynamicStat(item, 1);
151 if (permanentBoosts == nullptr) return;
152
153 switch (permanentBoosts->StatsType) {
154 case EquipmentStatsType::Weapon:
155 {
156 auto * weapon = static_cast<CDivinityStats_Equipment_Attributes_Weapon *>(permanentBoosts);
157 OsirisPropertyMapSet(gEquipmentAttributesWeaponPropertyMap, weapon, args, 1, Type);
158 break;
159 }
160
161 case EquipmentStatsType::Armor:
162 {
163 auto * armor = static_cast<CDivinityStats_Equipment_Attributes_Armor *>(permanentBoosts);
164 OsirisPropertyMapSet(gEquipmentAttributesArmorPropertyMap, armor, args, 1, Type);
165 break;
166 }
167
168 case EquipmentStatsType::Shield:
169 {
170 auto * shield = static_cast<CDivinityStats_Equipment_Attributes_Shield *>(permanentBoosts);
171 OsirisPropertyMapSet(gEquipmentAttributesShieldPropertyMap, shield, args, 1, Type);
172 break;
173 }
174
175 default:
176 OsiError("Unknown equipment stats type: " << (unsigned)permanentBoosts->StatsType);
177 }
178 }
179
180
181 std::unique_ptr<ObjectSet<eoc::ItemDefinition>> gPendingItemClone;

Callers

nothing calls this directly

Calls 3

FindItemByNameGuidFunction · 0.85
GetItemDynamicStatFunction · 0.85
OsirisPropertyMapSetFunction · 0.85

Tested by

no test coverage detected