122{
125
126 if (!t.TryConsumeTo(itemId))
127 return false;
128
129 val.Item =
sObjectMgr->GetItemTemplate(itemId);
130 val.IsBuggedInspectLink = false;
131
132
133
134
135
136
137 int32 randomPropertyId;
138 if (!(val.Item && t.TryConsumeTo(val.EnchantId) && t.TryConsumeTo(val.GemEnchantId[0]) && t.TryConsumeTo(val.GemEnchantId[1]) &&
139 t.TryConsumeTo(val.GemEnchantId[2]) && t.TryConsumeTo(dummy) && t.TryConsumeTo(randomPropertyId) && t.TryConsumeTo(val.RandomSuffixBaseAmount) &&
140 t.TryConsumeTo(val.RenderLevel) && t.IsEmpty() && !dummy))
141 return false;
142
143 if ((
static_cast<int32>(std::numeric_limits<int16>::max()) < randomPropertyId) && (randomPropertyId <= std::numeric_limits<uint16>::max()))
144 {
145 randomPropertyId =
static_cast<int16>(randomPropertyId);
146 val.IsBuggedInspectLink = true;
147 }
148
149 if (randomPropertyId < 0)
150 {
151 if (!val.Item->RandomSuffix)
152 return false;
153
155 return false;
156
158 {
159 val.RandomSuffix = suffixEntry;
160 val.RandomProperty = nullptr;
161 }
162 else
163 return false;
164 }
165 else if (randomPropertyId > 0)
166 {
167 if (!val.Item->RandomProperty)
168 return false;
169
171 {
172 val.RandomSuffix = nullptr;
173 val.RandomProperty = propEntry;
174 }
175 else
176 return false;
177 }
178 else
179 {
180 val.RandomSuffix = nullptr;
181 val.RandomProperty = nullptr;
182 }
183
184 if ((val.RandomSuffix && !val.RandomSuffixBaseAmount) || (val.RandomSuffixBaseAmount && !val.RandomSuffix))
185 return false;
186
187 return true;
188}
std::int32_t int32
Definition: Define.h:103
std::uint32_t uint32
Definition: Define.h:107
std::int16_t int16
Definition: Define.h:104
#define sObjectMgr
Definition: ObjectMgr.h:1623
DBCStorage< ItemRandomSuffixEntry > sItemRandomSuffixStore(ItemRandomSuffixfmt)
DBCStorage< ItemRandomPropertiesEntry > sItemRandomPropertiesStore(ItemRandomPropertiesfmt)
Definition: HyperlinkTags.cpp:28
Definition: DBCStructure.h:1207
Definition: DBCStructure.h:1217