-
Notifications
You must be signed in to change notification settings - Fork 2
/
parse_types_unity.go
499 lines (437 loc) · 18.4 KB
/
parse_types_unity.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
package dodumap
// changes: removed twoHanded and conditions
type MappedMultilangItemUnity struct {
AnkamaId int `json:"ankama_id"`
Type MappedMultilangItemType `json:"type"`
Description map[string]string `json:"description"`
Name map[string]string `json:"name"`
Image string `json:"image"`
Conditions *ConditionTreeNodeMapped `json:"conditions"`
Level int `json:"level"`
UsedInRecipes []int `json:"used_in_recipes"`
Characteristics []MappedMultilangCharacteristic `json:"characteristics"`
Effects []MappedMultilangEffect `json:"effects"`
DropMonsterIds []int `json:"dropMonsterIds"`
CriticalHitBonus int `json:"criticalHitBonus"`
MaxCastPerTurn int `json:"maxCastPerTurn"`
ApCost int `json:"apCost"`
Range int `json:"range"`
MinRange int `json:"minRange"`
CriticalHitProbability int `json:"criticalHitProbability"`
Pods int `json:"pods"`
IconId int `json:"iconId"`
ParentSet MappedMultilangSetReverseLink `json:"parentSet"`
HasParentSet bool `json:"hasParentSet"`
}
type MappedMultilangSetUnity struct {
AnkamaId int `json:"ankama_id"`
Name map[string]string `json:"name"`
ItemIds []int `json:"items"`
Effects map[int][]MappedMultilangEffect `json:"effects"`
Level int `json:"level"`
ContainsCosmetics bool `json:"contains_cosmetics"`
ContainsCosmeticsOnly bool `json:"contains_cosmetics_only"`
}
func (i JSONGameSetUnityRaw) GetID() int {
return i.Id
}
type JSONGameSetUnityRaw struct {
Id int `json:"id"`
//BonusIsSecret int `json:"bonusIsSecret"` // always 0, maybe used in the future
ItemIds JSONGameUnityAnkamaIdArray `json:"items"`
NameId int `json:"nameId"`
Effects JSONGameUnityArray[struct {
Values JSONGameUnityRefArray `json:"values"`
}] `json:"effects"`
}
func (i *JSONGameSetUnityRaw) Merge(other [][]*JSONGameItemPossibleEffectUnity) JSONGameSetUnity {
return JSONGameSetUnity{
Id: i.Id,
NameId: i.NameId,
Effects: other,
ItemIds: i.ItemIds.Array,
}
}
func (i JSONGameSetUnity) GetID() int {
return i.Id
}
type JSONGameSetUnity struct {
Id int `json:"id"`
//BonusIsSecret int `json:"bonusIsSecret"` // always 0, maybe used in the future
ItemIds []int `json:"items"`
NameId int `json:"nameId"`
Effects [][]*JSONGameItemPossibleEffectUnity `json:"effects"`
}
type JsonGameUnityRefLookup[T any, A any] struct {
Ref map[int64]A
AnkamaId map[int]T
}
type JsonGameUnityRef struct {
Ref string `json:"rid"`
}
type JSONGameUnityArray[T any] struct {
Array []T `json:"Array"`
}
type JSONGameUnityAnkamaIdArray = JSONGameUnityArray[int]
type JSONGameUnityRefArray = JSONGameUnityArray[JsonGameUnityRef]
func (i JSONGameItemUnity) GetID() int {
return i.Id
}
type JSONGameItemUnityRaw struct {
Id int `json:"id"`
TypeId int `json:"typeId"`
DescriptionId int `json:"descriptionId"`
IconId int `json:"iconId"`
NameId int `json:"nameId"`
Level int `json:"level"`
PossibleEffects JSONGameUnityRefArray `json:"possibleEffects"`
RecipeIds JSONGameUnityAnkamaIdArray `json:"recipeIds"`
Pods int `json:"realWeight"`
EvolutiveEffectIds JSONGameUnityAnkamaIdArray `json:"evolutiveEffectIds"`
DropMonsterIds JSONGameUnityAnkamaIdArray `json:"dropMonsterIds"`
ItemSetId int `json:"itemSetId"`
Criteria string `json:"criteria"`
CriticalHitBonus int `json:"criticalHitBonus"`
MaxCastPerTurn int `json:"maxCastPerTurn"`
ApCost int `json:"apCost"`
Range int `json:"range"`
MinRange int `json:"minRange"`
CriticalHitProbability int `json:"criticalHitProbability"`
}
func (i JSONGameItemUnityRaw) GetID() int {
return i.Id
}
type JSONGameItemUnity struct {
Id int `json:"id"`
TypeId int `json:"typeId"`
DescriptionId int `json:"descriptionId"`
IconId int `json:"iconId"`
NameId int `json:"nameId"`
Level int `json:"level"`
PossibleEffects []*JSONGameItemPossibleEffectUnity `json:"possibleEffects"`
RecipeIds JSONGameUnityAnkamaIdArray `json:"recipeIds"`
Pods int `json:"realWeight"`
EvolutiveEffectIds JSONGameUnityAnkamaIdArray `json:"evolutiveEffectIds"`
DropMonsterIds JSONGameUnityAnkamaIdArray `json:"dropMonsterIds"`
ItemSetId int `json:"itemSetId"`
Criteria string `json:"criteria"`
CriticalHitBonus int `json:"criticalHitBonus"`
MaxCastPerTurn int `json:"maxCastPerTurn"`
ApCost int `json:"apCost"`
Range int `json:"range"`
MinRange int `json:"minRange"`
CriticalHitProbability int `json:"criticalHitProbability"`
}
func (i *JSONGameItemUnityRaw) Merge(other []*JSONGameItemPossibleEffectUnity) JSONGameItemUnity {
return JSONGameItemUnity{
Id: i.Id,
TypeId: i.TypeId,
DescriptionId: i.DescriptionId,
IconId: i.IconId,
NameId: i.NameId,
Level: i.Level,
PossibleEffects: other,
RecipeIds: i.RecipeIds,
Pods: i.Pods,
EvolutiveEffectIds: i.EvolutiveEffectIds,
DropMonsterIds: i.DropMonsterIds,
ItemSetId: i.ItemSetId,
Criteria: i.Criteria,
CriticalHitBonus: i.CriticalHitBonus,
CriticalHitProbability: i.CriticalHitProbability,
ApCost: i.ApCost,
MaxCastPerTurn: i.MaxCastPerTurn,
Range: i.Range,
MinRange: i.MinRange,
}
}
type JSONGameItemTypeUnity struct {
Id int `json:"id"`
NameId int `json:"nameId"`
SuperTypeId int `json:"superTypeId"`
CategoryId int `json:"categoryId"`
Plural int `json:"plural"` // 0, 1
Gender int `json:"gender"` // 0, 1, 2
}
func (i JSONGameItemTypeUnity) GetID() int {
return i.Id
}
type JSONGameEffectUnity struct {
Id int `json:"id"`
DescriptionId int `json:"descriptionId"`
IconId int `json:"iconId"`
Characteristic int `json:"characteristic"`
Category int `json:"category"`
UseDice int `json:"useDice"` // bool
Active int `json:"active"` // bool
TheoreticalDescriptionId string `json:"theoreticalDescriptionId"` // and int inside a string lol
BonusType int `json:"bonusType"` // -1,0,+1
ElementId int `json:"elementId"`
UseInFight int `json:"useInFight"` // bool
IsInPercent int `json:"isInPercent"` // bool
}
func (i JSONGameEffectUnity) GetID() int {
return i.Id
}
type JSONGameBonusUnity struct {
Amount int `json:"amount"`
Id int `json:"id"`
CriterionsIds JSONGameUnityAnkamaIdArray `json:"criterionsIds"`
Type int `json:"type"`
}
func (i JSONGameBonusUnity) GetID() int {
return i.Id
}
type JSONGameRecipeUnity struct {
Id int `json:"resultId"`
NameId string `json:"resultNameId"` // int in a string
TypeId int `json:"resultTypeId"`
Level int `json:"resultLevel"`
IngredientIds JSONGameUnityAnkamaIdArray `json:"ingredientIds"`
Quantities JSONGameUnityArray[int] `json:"quantities"`
JobId int `json:"jobId"`
SkillId int `json:"skillId"`
}
func (i JSONGameRecipeUnity) GetID() int {
return i.Id
}
type JSONGameMountUnityRaw struct {
Id int `json:"id"`
FamilyId int `json:"familyId"`
NameId int `json:"nameId"`
Effects JSONGameUnityRefArray `json:"effects"`
CertificateId int `json:"certificateId"`
}
func (i JSONGameMountUnityRaw) GetID() int {
return i.Id
}
func (i *JSONGameMountUnityRaw) Merge(other []*JSONGameItemPossibleEffectUnity) JSONGameMountUnity {
return JSONGameMountUnity{
Id: i.Id,
FamilyId: i.FamilyId,
NameId: i.NameId,
Effects: other,
CertificateId: i.CertificateId,
}
}
type JSONGameMountUnity struct {
Id int `json:"id"`
FamilyId int `json:"familyId"`
NameId int `json:"nameId"`
Effects []*JSONGameItemPossibleEffectUnity `json:"effects"`
CertificateId int `json:"certificateId"`
}
func (i JSONGameMountUnity) GetID() int {
return i.Id
}
// actually a playable class
type JSONGameBreedUnity struct {
Id int `json:"id"`
ShortNameId string `json:"shortNameId"` // int
LongNameId string `json:"longNameId"` // int
DescriptionId int `json:"descriptionId"`
GameplayClassDescriptionId string `json:"gameplayClassDescriptionId"` // int
GuideItemId int `json:"guideItemId"`
MaleArtwork int `json:"maleArtwork"`
FemaleArtwork int `json:"femaleArtwork"`
BreedSpellsId JSONGameUnityAnkamaIdArray `json:"breedSpellsId"`
BreedRolesId JSONGameUnityArray[struct {
BreedId int `json:"breedId"`
RoleId int `json:"roleId"`
DescriptionId int `json:"descriptionId"`
Value int `json:"value"`
Order int `json:"order"`
}] `json:"breedRolesId"`
Complexity int `json:"complexity"`
SortIndex int `json:"sortIndex"`
}
func (i JSONGameBreedUnity) GetID() int {
return i.Id
}
type JSONGameMountFamilyUnity struct {
Id int `json:"id"`
NameId int `json:"nameId"`
HeadUri string `json:"headUri"`
}
func (i JSONGameMountFamilyUnity) GetID() int {
return i.Id
}
type JSONGameNPCUnity struct {
Id int `json:"id"`
NameId int `json:"nameId"`
DialogMessages JSONGameUnityArray[struct {
Values JSONGameUnityAnkamaIdArray `json:"values"`
}] `json:"dialogMessages"`
DialogReplies JSONGameUnityArray[struct {
Values JSONGameUnityAnkamaIdArray `json:"values"`
}] `json:"dialogReplies"`
Actions JSONGameUnityAnkamaIdArray `json:"actions"`
}
func (i JSONGameNPCUnity) GetID() int {
return i.Id
}
type JSONGameTitleUnity struct {
Id int `json:"id"`
NameMaleId string `json:"nameMaleId"` // int in a string
NameFemaleId string `json:"nameFemaleId"` // int in a string
Visible int `json:"visible"` // bool
CategoryId int `json:"categoryId"`
}
func (i JSONGameTitleUnity) GetID() int {
return i.Id
}
type JSONGameQuestUnity struct {
Id int `json:"id"`
NameId int `json:"nameId"`
StepIds JSONGameUnityAnkamaIdArray `json:"stepIds"`
CategoryId int `json:"categoryId"`
RepeatType int `json:"repeatType"`
RepeatLimit int `json:"repeatLimit"`
IsDungeonQuest int `json:"isDungeonQuest"` // bool
LevelMin int `json:"levelMin"`
LevelMax int `json:"levelMax"`
Followable int `json:"followable"` // bool
IsPartyQuest int `json:"isPartyQuest"` // bool
StartCriterion string `json:"startCriterion"`
}
func (i JSONGameQuestUnity) GetID() int {
return i.Id
}
type JSONGameQuestStepUnity struct {
Id int `json:"id"`
DescriptionId int `json:"descriptionId"`
DialogId int `json:"dialogId"`
NameId int `json:"nameId"`
OptimalLevel int `json:"optimalLevel"`
Duration float64 `json:"duration"`
ObjectiveIds JSONGameUnityAnkamaIdArray `json:"objectiveIds"`
RewardsIds JSONGameUnityAnkamaIdArray `json:"rewardsIds"`
QuestId int `json:"questId"`
}
func (i JSONGameQuestStepUnity) GetID() int {
return i.Id
}
type JSONGameQuestParameterUnity struct {
DungeonOnly int `json:"dungeonOnly"` // bool
NumParams int `json:"numParams"`
Parameter0 int `json:"parameter0"`
Parameter1 int `json:"parameter1"`
Parameter2 int `json:"parameter2"`
Parameter3 int `json:"parameter3"`
Parameter4 int `json:"parameter4"`
}
type JSONGameQuestObjectiveUnity struct {
Id int `json:"id"`
Coords JSONGameCoordinate `json:"coords"`
MapId int `json:"mapId"`
Parameters JSONGameQuestParameterUnity `json:"parameters"`
StepId int `json:"stepId"`
TypeId int `json:"typeId"`
}
func (i JSONGameQuestObjectiveUnity) GetID() int {
return i.Id
}
type JSONGameQuestStepRewardsUnity struct {
Id int `json:"id"`
ExperienceRatio float64 `json:"experienceRatio"`
KamasRatio float64 `json:"kamasRatio"`
ItemsReward JSONGameUnityArray[struct {
Values JSONGameUnityArray[int] `json:"values"`
}] `json:"itemsReward"`
KamasScaleWithPlayerLevel int `json:"kamasScaleWithPlayerLevel"` // bool
LevelMax int `json:"levelMax"`
LevelMin int `json:"levelMin"`
//SpellsReward []int `json:"spellsReward"`
//EmotesReward []int `json:"emotesReward"`
//TitlesReward []int `json:"titlesReward"`
StepId int `json:"stepId"`
}
func (i JSONGameQuestStepRewardsUnity) GetID() int {
return i.Id
}
type JSONGameQuestCategoryUnity struct {
Id int `json:"id"`
NameId int `json:"nameId"`
Order int `json:"order"`
QuestIds JSONGameUnityAnkamaIdArray `json:"questIds"`
}
func (i JSONGameQuestCategoryUnity) GetID() int {
return i.Id
}
type JSONGameAlamanaxCalendarUnity struct {
Id int `json:"id"`
DescId string `json:"descId"` // int
NameId int `json:"nameId"`
NpcId int `json:"npcId"`
BonusesIds JSONGameUnityAnkamaIdArray `json:"bonusesIds"`
}
func (i JSONGameAlamanaxCalendarUnity) GetID() int {
return i.Id
}
type JSONGameItemPossibleEffectUnity struct {
EffectId int `json:"effectId"`
MinimumValue int `json:"diceNum"`
MaximumValue int `json:"diceSide"`
Value int `json:"value"`
BaseEffectId int `json:"baseEffectId"`
EffectElement int `json:"effectElement"`
Dispellable int `json:"dispellable"`
SpellId int `json:"spellId"`
Duration int `json:"duration"`
}
func (i JSONGameItemPossibleEffectUnity) GetID() int {
return i.EffectId
}
type JSONLangDictUnity struct {
Texts map[string]string `json:"entries"` // "1": "Account- oder Abohandel",
}
type LangDictUnity struct {
Texts map[int]string `json:"entries"` // 1: "Account- oder Abohandel",
}
type JSONGameSpellUnity struct {
Id int `json:"id"`
NameId int `json:"nameId"`
DescriptionId int `json:"descriptionId"`
TypeId int `json:"typeId"`
Order int `json:"order"`
IconId int `json:"iconId"`
SpellLevels JSONGameUnityAnkamaIdArray `json:"spellLevels"`
}
func (i JSONGameSpellUnity) GetID() int {
return i.Id
}
type JSONGameAreaUnity struct {
Id int `json:"id"`
NameId int `json:"nameId"`
SuperAreaId int `json:"superAreaId"`
ContainHouses int `json:"containHouses"` // bool
ContainPaddocks int `json:"containPaddocks"` // bool
Bounds JSONGameAreaBounds `json:"bounds"`
WorldmapId int `json:"worldmapId"`
HasWorldMap int `json:"hasWorldMap"` // bool
}
func (i JSONGameAreaUnity) GetID() int {
return i.Id
}
type JSONGameDataUnity struct {
Items map[int]JSONGameItemUnity
Sets map[int]JSONGameSetUnity
ItemTypes map[int]JSONGameItemTypeUnity
effects map[int]JSONGameEffectUnity
bonuses map[int]JSONGameBonusUnity
Recipes map[int]JSONGameRecipeUnity
spells map[int]JSONGameSpellUnity
//spellTypes map[int]JSONGameSpellType
areas map[int]JSONGameAreaUnity
Mounts map[int]JSONGameMountUnity
classes map[int]JSONGameBreedUnity
MountFamilys map[int]JSONGameMountFamilyUnity
npcs map[int]JSONGameNPCUnity
titles map[int]JSONGameTitleUnity
quests map[int]JSONGameQuestUnity
questSteps map[int]JSONGameQuestStepUnity
questObjectives map[int]JSONGameQuestObjectiveUnity
questStepRewards map[int]JSONGameQuestStepRewardsUnity
questCategories map[int]JSONGameQuestCategoryUnity
almanaxCalendars map[int]JSONGameAlamanaxCalendarUnity
}