@@ -104,15 +104,19 @@ public static async void Load()
104104
105105 await Task . WhenAll ( Task . Run ( ( ) =>
106106 {
107- foreach ( var effect in SpellInfoStore . Where ( effect => SpellMisc . ContainsKey ( effect . Value . Spell . ID ) ) )
107+ foreach ( var spellMisc in SpellMisc . Values . Where ( misc => SpellInfoStore . ContainsKey ( misc . SpellID ) ) )
108108 {
109- effect . Value . Misc = SpellMisc [ effect . Value . Spell . ID ] ;
109+ if ( spellMisc . DifficultyID != 0 )
110+ continue ;
111+
112+ var spell = SpellInfoStore [ spellMisc . SpellID ] ;
113+ spell . Misc = spellMisc ;
110114
111- if ( SpellDuration . ContainsKey ( effect . Value . Misc . DurationIndex ) )
112- effect . Value . DurationEntry = SpellDuration [ effect . Value . Misc . DurationIndex ] ;
115+ if ( SpellDuration . ContainsKey ( spellMisc . DurationIndex ) )
116+ spell . DurationEntry = SpellDuration [ spellMisc . DurationIndex ] ;
113117
114- if ( SpellRange . ContainsKey ( effect . Value . Misc . RangeIndex ) )
115- effect . Value . Range = SpellRange [ effect . Value . Misc . RangeIndex ] ;
118+ if ( SpellRange . ContainsKey ( spellMisc . RangeIndex ) )
119+ spell . Range = SpellRange [ spellMisc . RangeIndex ] ;
116120 }
117121 } ) , Task . Run ( ( ) =>
118122 {
@@ -139,32 +143,32 @@ await Task.WhenAll(Task.Run(() =>
139143 }
140144 } ) , Task . Run ( ( ) =>
141145 {
142- foreach ( var effect in SpellTargetRestrictions . Values )
146+ foreach ( var spellTargetRestrictions in SpellTargetRestrictions . Values )
143147 {
144- if ( ! SpellInfoStore . ContainsKey ( effect . SpellID ) )
148+ if ( ! SpellInfoStore . ContainsKey ( spellTargetRestrictions . SpellID ) )
145149 {
146150 Console . WriteLine (
147- $ "SpellTargetRestrictions: Unknown spell { effect . SpellID } referenced, ignoring!") ;
151+ $ "SpellTargetRestrictions: Unknown spell { spellTargetRestrictions . SpellID } referenced, ignoring!") ;
148152 continue ;
149153 }
150154
151- SpellInfoStore [ effect . SpellID ] . TargetRestrictions . Add ( effect ) ;
155+ SpellInfoStore [ spellTargetRestrictions . SpellID ] . TargetRestrictions . Add ( spellTargetRestrictions ) ;
152156 }
153157 } ) , Task . Run ( ( ) =>
154158 {
155- foreach ( var spellXSpellVisual in SpellXSpellVisual . Where ( effect =>
156- effect . Value . DifficultyID == 0 && effect . Value . CasterPlayerConditionID == 0 ) )
159+ foreach ( var spellXSpellVisual in SpellXSpellVisual . Values . Where ( effect => effect . CasterPlayerConditionID == 0 ) )
157160 {
158- if ( spellXSpellVisual . Value . DifficultyID != 0 ) { continue ; }
161+ if ( spellXSpellVisual . DifficultyID != 0 )
162+ continue ;
159163
160- if ( ! SpellInfoStore . ContainsKey ( spellXSpellVisual . Value . SpellID ) )
164+ if ( ! SpellInfoStore . ContainsKey ( spellXSpellVisual . SpellID ) )
161165 {
162166 Console . WriteLine (
163- $ "SpellXSpellVisual: Unknown spell { spellXSpellVisual . Value . SpellID } referenced, ignoring!") ;
167+ $ "SpellXSpellVisual: Unknown spell { spellXSpellVisual . SpellID } referenced, ignoring!") ;
164168 continue ;
165169 }
166170
167- SpellInfoStore [ spellXSpellVisual . Value . SpellID ] . SpellXSpellVisual = spellXSpellVisual . Value ;
171+ SpellInfoStore [ spellXSpellVisual . SpellID ] . SpellXSpellVisual = spellXSpellVisual ;
168172 }
169173 } ) , Task . Run ( ( ) =>
170174 {
@@ -176,13 +180,15 @@ await Task.WhenAll(Task.Run(() =>
176180 $ "SpellScaling: Unknown spell { spellScaling . SpellID } referenced, ignoring!") ;
177181 continue ;
178182 }
179-
180183 SpellInfoStore [ spellScaling . SpellID ] . Scaling = spellScaling ;
181184 }
182185 } ) , Task . Run ( ( ) =>
183186 {
184187 foreach ( var spellAuraOptions in SpellAuraOptions . Values )
185188 {
189+ if ( spellAuraOptions . DifficultyID != 0 )
190+ continue ;
191+
186192 if ( ! SpellInfoStore . ContainsKey ( spellAuraOptions . SpellID ) )
187193 {
188194 Console . WriteLine (
@@ -196,21 +202,27 @@ await Task.WhenAll(Task.Run(() =>
196202 }
197203 } ) , Task . Run ( ( ) =>
198204 {
199- foreach ( var spellAuraRestriction in SpellAuraRestrictions . Values )
205+ foreach ( var spellAuraRestrictions in SpellAuraRestrictions . Values )
200206 {
201- if ( ! SpellInfoStore . ContainsKey ( spellAuraRestriction . SpellID ) )
207+ if ( spellAuraRestrictions . DifficultyID != 0 )
208+ continue ;
209+
210+ if ( ! SpellInfoStore . ContainsKey ( spellAuraRestrictions . SpellID ) )
202211 {
203212 Console . WriteLine (
204- $ "SpellAuraRestrictions: Unknown spell { spellAuraRestriction . SpellID } referenced, ignoring!") ;
213+ $ "SpellAuraRestrictions: Unknown spell { spellAuraRestrictions . SpellID } referenced, ignoring!") ;
205214 continue ;
206215 }
207216
208- SpellInfoStore [ spellAuraRestriction . SpellID ] . AuraRestrictions = spellAuraRestriction ;
217+ SpellInfoStore [ spellAuraRestrictions . SpellID ] . AuraRestrictions = spellAuraRestrictions ;
209218 }
210219 } ) , Task . Run ( ( ) =>
211220 {
212221 foreach ( var spellCategory in SpellCategories . Values )
213222 {
223+ if ( spellCategory . DifficultyID != 0 )
224+ continue ;
225+
214226 if ( ! SpellInfoStore . ContainsKey ( spellCategory . SpellID ) )
215227 {
216228 Console . WriteLine (
@@ -250,6 +262,9 @@ await Task.WhenAll(Task.Run(() =>
250262 {
251263 foreach ( var spellCooldown in SpellCooldowns . Values )
252264 {
265+ if ( spellCooldown . DifficultyID != 0 )
266+ continue ;
267+
253268 if ( ! SpellInfoStore . ContainsKey ( spellCooldown . SpellID ) )
254269 {
255270 Console . WriteLine (
@@ -289,6 +304,9 @@ await Task.WhenAll(Task.Run(() =>
289304 {
290305 foreach ( var spellLevel in SpellLevels . Values )
291306 {
307+ if ( spellLevel . DifficultyID != 0 )
308+ continue ;
309+
292310 if ( ! SpellInfoStore . ContainsKey ( spellLevel . SpellID ) )
293311 {
294312 Console . WriteLine ( $ "SpellLevels: Unknown spell { spellLevel . SpellID } referenced, ignoring!") ;
@@ -299,16 +317,16 @@ await Task.WhenAll(Task.Run(() =>
299317 }
300318 } ) , Task . Run ( ( ) =>
301319 {
302- foreach ( var effect in SpellReagents )
320+ foreach ( var spellReagents in SpellReagents )
303321 {
304- if ( ! SpellInfoStore . ContainsKey ( effect . Value . SpellID ) )
322+ if ( ! SpellInfoStore . ContainsKey ( spellReagents . Value . SpellID ) )
305323 {
306324 Console . WriteLine (
307- $ "SpellReagents: Unknown spell { effect . Value . SpellID } referenced, ignoring!") ;
325+ $ "SpellReagents: Unknown spell { spellReagents . Value . SpellID } referenced, ignoring!") ;
308326 continue ;
309327 }
310328
311- SpellInfoStore [ effect . Value . SpellID ] . Reagents = effect . Value ;
329+ SpellInfoStore [ spellReagents . Value . SpellID ] . Reagents = spellReagents . Value ;
312330 }
313331 } ) , Task . Run ( ( ) =>
314332 {
0 commit comments