-
Notifications
You must be signed in to change notification settings - Fork 2
/
items.go
79 lines (77 loc) · 4.06 KB
/
items.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
package gw2api
// Item is a game item
type Item struct {
ID int `json:"id"`
ChatLink string `json:"chat_link"`
Name string `json:"name"`
Icon string `json:"icon"`
Description string `json:"description"`
Type string `json:"type"`
Rarity string `json:"rarity"`
Level int `json:"level"`
VendorValue int `json:"vendor_value"`
DefaultSkin int `json:"default_skin"`
Flags []string `json:"flags"`
GameTypes []string `json:"game_types"`
Restrictions []string `json:"restrictions"`
UpgradesInto []struct {
Upgrade string `json:"upgrade"`
ItemID int `json:"item_id"`
} `json:"upgrades_into"`
UpgradesFrom []struct {
Upgrade string `json:"upgrade"`
ItemID int `json:"item_id"`
} `json:"upgrades_from"`
Details struct {
Type string `json:"type"` // Armor / Consumable / Container / Gathering tools / Gizmo / Salvage kits / Trinket / Upgrade component / Weapon
WeightClass string `json:"weight_class"` // Armor
Defense int `json:"defense"` // Armor / Weapon
InfusionSlots []struct {
Flags []string `json:"flags"`
ItemID int `json:"item_id"`
} `json:"infusion_slots"` // Armor / Back item / Trinket / Weapon
AttributeAdjustment float64 `json:"attribute_adjustment"` // Armor / Back item / Trinket / Weapon
InfixUpgrade struct {
ID int `json:"id"`
Attributes []struct {
Attribute string `json:"attribute"`
Modifier int `json:"modifier"`
}
Buff struct {
SkillID int `json:"skill_id"`
Description string `json:"description"`
} `json:"buff"`
} `json:"infix_upgrade"` // Armor / Back item / Trinket / Upgrade component / Weapon
SuffixItemID int `json:"suffix_item_id"` // Armor / Back item / Trinket / Weapon
SecondarySuffixItemID string `json:"secondary_suffix_item_id"` // Armor / Back item / Trinket / Weapon
StatChoices []int `json:"stat_choices"` // Armor / Back item / Trinket / Weapon
Size int `json:"size"` // Bag
NoSellOrSort bool `json:"no_sell_or_sort"` // Bag
Description string `json:"description"` // Consumable
DurationMS int `json:"duration_ms"` // Consumable
UnlockType string `json:"unlock_type"` // Consumable
ColorID int `json:"color_id"` // Consumable
RecipeID int `json:"recipe_id"` // Consumable
ExtraRecipeIDs []int `json:"extra_recipe_ids"` // Consumable
GuildUpgradeID int `json:"guild_upgrade_id"` // Consumable / Gizmo
ApplyCount int `json:"apply_count"` // Consumable
Name string `json:"name"` // Consumable
Icon string `json:"icon"` // Consumable
Skins []int `json:"skins"` // Consumable
VendorIDs []int `json:"vendor_ids"` // Gizmo
MinipetID int `json:"minipet_id"` // Miniature
Charges int `json:"charges"` // Salvage kits
Flags []string `json:"flags"` // Upgrade component
InfusionUpgradesFlags []string `json:"infusion_upgrades_flags"` // Upgrade component
Suffix string `json:"suffix"` // Upgrade component
Bonuses []string `json:"bonuses"` // Upgrade component
DamageType string `json:"damage_type"` // Weapon
MinPower int `json:"min_power"` // Weapon
MaxPower int `json:"max_power"` // Weapon
} `json:"details"`
}
// Items returns the items with the given id
func (s *Session) Items(ids ...int) (rsp []*Item, err error) {
err = s.get(concatStrings("/v2/items", genArgs(ids...)), &rsp)
return
}