Add levels and fix tz?
This commit is contained in:
15651
cmd/d2data/d2data/levels.json
Normal file
15651
cmd/d2data/d2data/levels.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -28,6 +28,16 @@ var Skills = map[ID]Skill{
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
}`
|
}`
|
||||||
|
|
||||||
|
const templateLevels = `// Code generated by d2data. DO NOT EDIT.
|
||||||
|
// source: cmd/d2data/d2data/levels.json
|
||||||
|
package area
|
||||||
|
|
||||||
|
var Areas = map[ID]Area{
|
||||||
|
{{- range $key, $value := . }}
|
||||||
|
{{ $key }}: {Name: "{{ $value.LevelName }}", ID: {{ $key }}},
|
||||||
|
{{- end }}
|
||||||
|
}`
|
||||||
|
|
||||||
type skillDesc struct {
|
type skillDesc struct {
|
||||||
Skilldesc string `json:"skilldesc"`
|
Skilldesc string `json:"skilldesc"`
|
||||||
SkillPage int `json:"SkillPage"`
|
SkillPage int `json:"SkillPage"`
|
||||||
@@ -47,6 +57,11 @@ type Skill struct {
|
|||||||
Name string `json:"skill"`
|
Name string `json:"skill"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Level struct {
|
||||||
|
ID int `json:"Id"`
|
||||||
|
LevelName string `json:"LevelName"`
|
||||||
|
}
|
||||||
|
|
||||||
// Generate static code from https://github.com/blizzhackers/d2data data files.
|
// Generate static code from https://github.com/blizzhackers/d2data data files.
|
||||||
func main() {
|
func main() {
|
||||||
err := generateFromFile(templateSkillDesc, "cmd/d2data/d2data/skilldesc.json", "pkg/data/skill/skilldesc.go", &map[string]skillDesc{})
|
err := generateFromFile(templateSkillDesc, "cmd/d2data/d2data/skilldesc.json", "pkg/data/skill/skilldesc.go", &map[string]skillDesc{})
|
||||||
@@ -58,6 +73,11 @@ func main() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = generateFromFile(templateLevels, "cmd/d2data/d2data/levels.json", "pkg/data/area/areas.go", &map[string]Level{})
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func generateFromFile(templateName, filePath, outPath string, unmarshallStruct interface{}) error {
|
func generateFromFile(templateName, filePath, outPath string, unmarshallStruct interface{}) error {
|
||||||
|
|||||||
@@ -25,13 +25,13 @@ type Watcher struct {
|
|||||||
|
|
||||||
type itemFootprint struct {
|
type itemFootprint struct {
|
||||||
detectedAt time.Time
|
detectedAt time.Time
|
||||||
area area.Area
|
area area.ID
|
||||||
position data.Position
|
position data.Position
|
||||||
name item.Name
|
name item.Name
|
||||||
quality item.Quality
|
quality item.Quality
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fp itemFootprint) Match(area area.Area, i data.Item) bool {
|
func (fp itemFootprint) Match(area area.ID, i data.Item) bool {
|
||||||
return fp.area == area && fp.position == i.Position && fp.name == i.Name && fp.quality == i.Quality
|
return fp.area == area && fp.position == i.Position && fp.name == i.Name && fp.quality == i.Quality
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,13 @@
|
|||||||
package area
|
package area
|
||||||
|
|
||||||
type Area int
|
type ID int
|
||||||
|
|
||||||
func (a Area) IsTown() bool {
|
type Area struct {
|
||||||
|
ID
|
||||||
|
Name string
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a ID) IsTown() bool {
|
||||||
switch a {
|
switch a {
|
||||||
case RogueEncampment, LutGholein, KurastDocks, ThePandemoniumFortress, Harrogath:
|
case RogueEncampment, LutGholein, KurastDocks, ThePandemoniumFortress, Harrogath:
|
||||||
return true
|
return true
|
||||||
@@ -11,7 +16,7 @@ func (a Area) IsTown() bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a Area) Act() int {
|
func (a ID) Act() int {
|
||||||
if a < 40 {
|
if a < 40 {
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
@@ -29,146 +34,146 @@ func (a Area) Act() int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
Abaddon Area = 125
|
Abaddon ID = 125
|
||||||
AncientTunnels Area = 65
|
AncientTunnels ID = 65
|
||||||
ArcaneSanctuary Area = 74
|
ArcaneSanctuary ID = 74
|
||||||
ArreatPlateau Area = 112
|
ArreatPlateau ID = 112
|
||||||
ArreatSummit Area = 120
|
ArreatSummit ID = 120
|
||||||
Barracks Area = 28
|
Barracks ID = 28
|
||||||
BlackMarsh Area = 6
|
BlackMarsh ID = 6
|
||||||
BloodMoor Area = 2
|
BloodMoor ID = 2
|
||||||
BloodyFoothills Area = 110
|
BloodyFoothills ID = 110
|
||||||
BurialGrounds Area = 17
|
BurialGrounds ID = 17
|
||||||
CanyonOfTheMagi Area = 46
|
CanyonOfTheMagi ID = 46
|
||||||
CatacombsLevel1 Area = 34
|
CatacombsLevel1 ID = 34
|
||||||
CatacombsLevel2 Area = 35
|
CatacombsLevel2 ID = 35
|
||||||
CatacombsLevel3 Area = 36
|
CatacombsLevel3 ID = 36
|
||||||
CatacombsLevel4 Area = 37
|
CatacombsLevel4 ID = 37
|
||||||
Cathedral Area = 33
|
Cathedral ID = 33
|
||||||
CaveLevel1 Area = 9
|
CaveLevel1 ID = 9
|
||||||
CaveLevel2 Area = 13
|
CaveLevel2 ID = 13
|
||||||
ChaosSanctuary Area = 108
|
ChaosSanctuary ID = 108
|
||||||
CityOfTheDamned Area = 106
|
CityOfTheDamned ID = 106
|
||||||
ClawViperTempleLevel1 Area = 58
|
ClawViperTempleLevel1 ID = 58
|
||||||
ClawViperTempleLevel2 Area = 61
|
ClawViperTempleLevel2 ID = 61
|
||||||
ColdPlains Area = 3
|
ColdPlains ID = 3
|
||||||
Crypt Area = 18
|
Crypt ID = 18
|
||||||
CrystallinePassage Area = 113
|
CrystallinePassage ID = 113
|
||||||
DarkWood Area = 5
|
DarkWood ID = 5
|
||||||
DenOfEvil Area = 8
|
DenOfEvil ID = 8
|
||||||
DisusedFane Area = 95
|
DisusedFane ID = 95
|
||||||
DisusedReliquary Area = 99
|
DisusedReliquary ID = 99
|
||||||
DrifterCavern Area = 116
|
DrifterCavern ID = 116
|
||||||
DryHills Area = 42
|
DryHills ID = 42
|
||||||
DuranceOfHateLevel1 Area = 100
|
DuranceOfHateLevel1 ID = 100
|
||||||
DuranceOfHateLevel2 Area = 101
|
DuranceOfHateLevel2 ID = 101
|
||||||
DuranceOfHateLevel3 Area = 102
|
DuranceOfHateLevel3 ID = 102
|
||||||
DurielsLair Area = 73
|
DurielsLair ID = 73
|
||||||
FarOasis Area = 43
|
FarOasis ID = 43
|
||||||
FlayerDungeonLevel1 Area = 88
|
FlayerDungeonLevel1 ID = 88
|
||||||
FlayerDungeonLevel2 Area = 89
|
FlayerDungeonLevel2 ID = 89
|
||||||
FlayerDungeonLevel3 Area = 91
|
FlayerDungeonLevel3 ID = 91
|
||||||
FlayerJungle Area = 78
|
FlayerJungle ID = 78
|
||||||
ForgottenReliquary Area = 96
|
ForgottenReliquary ID = 96
|
||||||
ForgottenSands Area = 134
|
ForgottenSands ID = 134
|
||||||
ForgottenTemple Area = 97
|
ForgottenTemple ID = 97
|
||||||
ForgottenTower Area = 20
|
ForgottenTower ID = 20
|
||||||
FrigidHighlands Area = 111
|
FrigidHighlands ID = 111
|
||||||
FrozenRiver Area = 114
|
FrozenRiver ID = 114
|
||||||
FrozenTundra Area = 117
|
FrozenTundra ID = 117
|
||||||
FurnaceOfPain Area = 135
|
FurnaceOfPain ID = 135
|
||||||
GlacialTrail Area = 115
|
GlacialTrail ID = 115
|
||||||
GreatMarsh Area = 77
|
GreatMarsh ID = 77
|
||||||
HallsOfAnguish Area = 122
|
HallsOfAnguish ID = 122
|
||||||
HallsOfPain Area = 123
|
HallsOfPain ID = 123
|
||||||
HallsOfTheDeadLevel1 Area = 56
|
HallsOfTheDeadLevel1 ID = 56
|
||||||
HallsOfTheDeadLevel2 Area = 57
|
HallsOfTheDeadLevel2 ID = 57
|
||||||
HallsOfTheDeadLevel3 Area = 60
|
HallsOfTheDeadLevel3 ID = 60
|
||||||
HallsOfVaught Area = 124
|
HallsOfVaught ID = 124
|
||||||
HaremLevel1 Area = 50
|
HaremLevel1 ID = 50
|
||||||
HaremLevel2 Area = 51
|
HaremLevel2 ID = 51
|
||||||
Harrogath Area = 109
|
Harrogath ID = 109
|
||||||
HoleLevel1 Area = 11
|
HoleLevel1 ID = 11
|
||||||
HoleLevel2 Area = 15
|
HoleLevel2 ID = 15
|
||||||
IcyCellar Area = 119
|
IcyCellar ID = 119
|
||||||
InfernalPit Area = 127
|
InfernalPit ID = 127
|
||||||
InnerCloister Area = 32
|
InnerCloister ID = 32
|
||||||
JailLevel1 Area = 29
|
JailLevel1 ID = 29
|
||||||
JailLevel2 Area = 30
|
JailLevel2 ID = 30
|
||||||
JailLevel3 Area = 31
|
JailLevel3 ID = 31
|
||||||
KurastBazaar Area = 80
|
KurastBazaar ID = 80
|
||||||
KurastCauseway Area = 82
|
KurastCauseway ID = 82
|
||||||
KurastDocks Area = 75
|
KurastDocks ID = 75
|
||||||
LostCity Area = 44
|
LostCity ID = 44
|
||||||
LowerKurast Area = 79
|
LowerKurast ID = 79
|
||||||
LutGholein Area = 40
|
LutGholein ID = 40
|
||||||
MaggotLairLevel1 Area = 62
|
MaggotLairLevel1 ID = 62
|
||||||
MaggotLairLevel2 Area = 63
|
MaggotLairLevel2 ID = 63
|
||||||
MaggotLairLevel3 Area = 64
|
MaggotLairLevel3 ID = 64
|
||||||
MatronsDen Area = 133
|
MatronsDen ID = 133
|
||||||
Mausoleum Area = 19
|
Mausoleum ID = 19
|
||||||
MonasteryGate Area = 26
|
MonasteryGate ID = 26
|
||||||
MooMooFarm Area = 39
|
MooMooFarm ID = 39
|
||||||
NihlathaksTemple Area = 121
|
NihlathaksTemple ID = 121
|
||||||
None Area = 0
|
None ID = 0
|
||||||
OuterCloister Area = 27
|
OuterCloister ID = 27
|
||||||
OuterSteppes Area = 104
|
OuterSteppes ID = 104
|
||||||
PalaceCellarLevel1 Area = 52
|
PalaceCellarLevel1 ID = 52
|
||||||
PalaceCellarLevel2 Area = 53
|
PalaceCellarLevel2 ID = 53
|
||||||
PalaceCellarLevel3 Area = 54
|
PalaceCellarLevel3 ID = 54
|
||||||
PitLevel1 Area = 12
|
PitLevel1 ID = 12
|
||||||
PitLevel2 Area = 16
|
PitLevel2 ID = 16
|
||||||
PitOfAcheron Area = 126
|
PitOfAcheron ID = 126
|
||||||
PlainsOfDespair Area = 105
|
PlainsOfDespair ID = 105
|
||||||
RiverOfFlame Area = 107
|
RiverOfFlame ID = 107
|
||||||
RockyWaste Area = 41
|
RockyWaste ID = 41
|
||||||
RogueEncampment Area = 1
|
RogueEncampment ID = 1
|
||||||
RuinedFane Area = 98
|
RuinedFane ID = 98
|
||||||
RuinedTemple Area = 94
|
RuinedTemple ID = 94
|
||||||
SewersLevel1Act2 Area = 47
|
SewersLevel1Act2 ID = 47
|
||||||
SewersLevel1Act3 Area = 92
|
SewersLevel1Act3 ID = 92
|
||||||
SewersLevel2Act2 Area = 48
|
SewersLevel2Act2 ID = 48
|
||||||
SewersLevel2Act3 Area = 93
|
SewersLevel2Act3 ID = 93
|
||||||
SewersLevel3Act2 Area = 49
|
SewersLevel3Act2 ID = 49
|
||||||
SpiderCave Area = 84
|
SpiderCave ID = 84
|
||||||
SpiderCavern Area = 85
|
SpiderCavern ID = 85
|
||||||
SpiderForest Area = 76
|
SpiderForest ID = 76
|
||||||
StonyField Area = 4
|
StonyField ID = 4
|
||||||
StonyTombLevel1 Area = 55
|
StonyTombLevel1 ID = 55
|
||||||
StonyTombLevel2 Area = 59
|
StonyTombLevel2 ID = 59
|
||||||
SwampyPitLevel1 Area = 86
|
SwampyPitLevel1 ID = 86
|
||||||
SwampyPitLevel2 Area = 87
|
SwampyPitLevel2 ID = 87
|
||||||
SwampyPitLevel3 Area = 90
|
SwampyPitLevel3 ID = 90
|
||||||
TalRashasTomb1 Area = 66
|
TalRashasTomb1 ID = 66
|
||||||
TalRashasTomb2 Area = 67
|
TalRashasTomb2 ID = 67
|
||||||
TalRashasTomb3 Area = 68
|
TalRashasTomb3 ID = 68
|
||||||
TalRashasTomb4 Area = 69
|
TalRashasTomb4 ID = 69
|
||||||
TalRashasTomb5 Area = 70
|
TalRashasTomb5 ID = 70
|
||||||
TalRashasTomb6 Area = 71
|
TalRashasTomb6 ID = 71
|
||||||
TalRashasTomb7 Area = 72
|
TalRashasTomb7 ID = 72
|
||||||
TamoeHighland Area = 7
|
TamoeHighland ID = 7
|
||||||
TheAncientsWay Area = 118
|
TheAncientsWay ID = 118
|
||||||
ThePandemoniumFortress Area = 103
|
ThePandemoniumFortress ID = 103
|
||||||
TheWorldstoneChamber Area = 132
|
TheWorldstoneChamber ID = 132
|
||||||
TheWorldStoneKeepLevel1 Area = 128
|
TheWorldStoneKeepLevel1 ID = 128
|
||||||
TheWorldStoneKeepLevel2 Area = 129
|
TheWorldStoneKeepLevel2 ID = 129
|
||||||
TheWorldStoneKeepLevel3 Area = 130
|
TheWorldStoneKeepLevel3 ID = 130
|
||||||
ThroneOfDestruction Area = 131
|
ThroneOfDestruction ID = 131
|
||||||
TowerCellarLevel1 Area = 21
|
TowerCellarLevel1 ID = 21
|
||||||
TowerCellarLevel2 Area = 22
|
TowerCellarLevel2 ID = 22
|
||||||
TowerCellarLevel3 Area = 23
|
TowerCellarLevel3 ID = 23
|
||||||
TowerCellarLevel4 Area = 24
|
TowerCellarLevel4 ID = 24
|
||||||
TowerCellarLevel5 Area = 25
|
TowerCellarLevel5 ID = 25
|
||||||
Travincal Area = 83
|
Travincal ID = 83
|
||||||
Tristram Area = 38
|
Tristram ID = 38
|
||||||
UberTristram Area = 136
|
UberTristram ID = 136
|
||||||
UndergroundPassageLevel1 Area = 10
|
UndergroundPassageLevel1 ID = 10
|
||||||
UndergroundPassageLevel2 Area = 14
|
UndergroundPassageLevel2 ID = 14
|
||||||
UpperKurast Area = 81
|
UpperKurast ID = 81
|
||||||
ValleyOfSnakes Area = 45
|
ValleyOfSnakes ID = 45
|
||||||
MapsAncientTemple Area = 137
|
MapsAncientTemple ID = 137
|
||||||
MapsDesecratedTemple Area = 138
|
MapsDesecratedTemple ID = 138
|
||||||
MapsFrigidPlateau Area = 139
|
MapsFrigidPlateau ID = 139
|
||||||
MapsInfernalTrial Area = 140
|
MapsInfernalTrial ID = 140
|
||||||
MapsRuinedCitadel Area = 141
|
MapsRuinedCitadel ID = 141
|
||||||
)
|
)
|
||||||
|
|||||||
143
pkg/data/area/areas.go
Normal file
143
pkg/data/area/areas.go
Normal file
@@ -0,0 +1,143 @@
|
|||||||
|
// Code generated by d2data. DO NOT EDIT.
|
||||||
|
// source: cmd/d2data/d2data/levels.json
|
||||||
|
package area
|
||||||
|
|
||||||
|
var Areas = map[ID]Area{
|
||||||
|
0: {Name: "", ID: 0},
|
||||||
|
1: {Name: "Rogue Encampment", ID: 1},
|
||||||
|
10: {Name: "Underground Passage Level 1", ID: 10},
|
||||||
|
100: {Name: "Durance of Hate Level 1", ID: 100},
|
||||||
|
101: {Name: "Durance of Hate Level 2", ID: 101},
|
||||||
|
102: {Name: "Durance of Hate Level 3", ID: 102},
|
||||||
|
103: {Name: "The Pandemonium Fortress", ID: 103},
|
||||||
|
104: {Name: "Outer Steppes", ID: 104},
|
||||||
|
105: {Name: "Plains of Despair", ID: 105},
|
||||||
|
106: {Name: "City of the Damned", ID: 106},
|
||||||
|
107: {Name: "River of Flame", ID: 107},
|
||||||
|
108: {Name: "Chaos Sanctum", ID: 108},
|
||||||
|
109: {Name: "Harrogath", ID: 109},
|
||||||
|
11: {Name: "Hole Level 1", ID: 11},
|
||||||
|
110: {Name: "Bloody Foothills", ID: 110},
|
||||||
|
111: {Name: "Rigid Highlands", ID: 111},
|
||||||
|
112: {Name: "Arreat Plateau", ID: 112},
|
||||||
|
113: {Name: "Crystalized Cavern Level 1", ID: 113},
|
||||||
|
114: {Name: "Cellar of Pity", ID: 114},
|
||||||
|
115: {Name: "Crystalized Cavern Level 2", ID: 115},
|
||||||
|
116: {Name: "Echo Chamber", ID: 116},
|
||||||
|
117: {Name: "Tundra Wastelands", ID: 117},
|
||||||
|
118: {Name: "Glacial Caves Level 1", ID: 118},
|
||||||
|
119: {Name: "Glacial Caves Level 2", ID: 119},
|
||||||
|
12: {Name: "Pit Level 1", ID: 12},
|
||||||
|
120: {Name: "Rocky Summit", ID: 120},
|
||||||
|
121: {Name: "Nihlathaks Temple", ID: 121},
|
||||||
|
122: {Name: "Halls of Anguish", ID: 122},
|
||||||
|
123: {Name: "Halls of Death's Calling", ID: 123},
|
||||||
|
124: {Name: "Halls of Vaught", ID: 124},
|
||||||
|
125: {Name: "Hell1", ID: 125},
|
||||||
|
126: {Name: "Hell2", ID: 126},
|
||||||
|
127: {Name: "Hell3", ID: 127},
|
||||||
|
128: {Name: "The Worldstone Keep Level 1", ID: 128},
|
||||||
|
129: {Name: "The Worldstone Keep Level 2", ID: 129},
|
||||||
|
13: {Name: "Cave Level 2", ID: 13},
|
||||||
|
130: {Name: "The Worldstone Keep Level 3", ID: 130},
|
||||||
|
131: {Name: "Throne of Destruction", ID: 131},
|
||||||
|
132: {Name: "The Worldstone Chamber", ID: 132},
|
||||||
|
133: {Name: "Pandemonium Run 1", ID: 133},
|
||||||
|
134: {Name: "Pandemonium Run 2", ID: 134},
|
||||||
|
135: {Name: "Pandemonium Run 3", ID: 135},
|
||||||
|
136: {Name: "Tristram", ID: 136},
|
||||||
|
14: {Name: "Underground Passage Level 2", ID: 14},
|
||||||
|
15: {Name: "Hole Level 2", ID: 15},
|
||||||
|
16: {Name: "Pit Level 2", ID: 16},
|
||||||
|
17: {Name: "Burial Grounds", ID: 17},
|
||||||
|
18: {Name: "Crypt", ID: 18},
|
||||||
|
19: {Name: "Mausoleum", ID: 19},
|
||||||
|
2: {Name: "Blood Moor", ID: 2},
|
||||||
|
20: {Name: "Forgotten Tower", ID: 20},
|
||||||
|
21: {Name: "Tower Cellar Level 1", ID: 21},
|
||||||
|
22: {Name: "Tower Cellar Level 2", ID: 22},
|
||||||
|
23: {Name: "Tower Cellar Level 3", ID: 23},
|
||||||
|
24: {Name: "Tower Cellar Level 4", ID: 24},
|
||||||
|
25: {Name: "Tower Cellar Level 5", ID: 25},
|
||||||
|
26: {Name: "Monastery Gate", ID: 26},
|
||||||
|
27: {Name: "Outer Cloister", ID: 27},
|
||||||
|
28: {Name: "Barracks", ID: 28},
|
||||||
|
29: {Name: "Jail Level 1", ID: 29},
|
||||||
|
3: {Name: "Cold Plains", ID: 3},
|
||||||
|
30: {Name: "Jail Level 2", ID: 30},
|
||||||
|
31: {Name: "Jail Level 3", ID: 31},
|
||||||
|
32: {Name: "Inner Cloister", ID: 32},
|
||||||
|
33: {Name: "Cathedral", ID: 33},
|
||||||
|
34: {Name: "Catacombs Level 1", ID: 34},
|
||||||
|
35: {Name: "Catacombs Level 2", ID: 35},
|
||||||
|
36: {Name: "Catacombs Level 3", ID: 36},
|
||||||
|
37: {Name: "Catacombs Level 4", ID: 37},
|
||||||
|
38: {Name: "Tristram", ID: 38},
|
||||||
|
39: {Name: "Moo Moo Farm", ID: 39},
|
||||||
|
4: {Name: "Stony Field", ID: 4},
|
||||||
|
40: {Name: "Lut Gholein", ID: 40},
|
||||||
|
41: {Name: "Rocky Waste", ID: 41},
|
||||||
|
42: {Name: "Dry Hills", ID: 42},
|
||||||
|
43: {Name: "Far Oasis", ID: 43},
|
||||||
|
44: {Name: "Lost City", ID: 44},
|
||||||
|
45: {Name: "Valley of Snakes", ID: 45},
|
||||||
|
46: {Name: "Canyon of the Magi", ID: 46},
|
||||||
|
47: {Name: "Sewers Level 1", ID: 47},
|
||||||
|
48: {Name: "Sewers Level 2", ID: 48},
|
||||||
|
49: {Name: "Sewers Level 3", ID: 49},
|
||||||
|
5: {Name: "Dark Wood", ID: 5},
|
||||||
|
50: {Name: "Harem Level 1", ID: 50},
|
||||||
|
51: {Name: "Harem Level 2", ID: 51},
|
||||||
|
52: {Name: "Palace Cellar Level 1", ID: 52},
|
||||||
|
53: {Name: "Palace Cellar Level 2", ID: 53},
|
||||||
|
54: {Name: "Palace Cellar Level 3", ID: 54},
|
||||||
|
55: {Name: "Stony Tomb Level 1", ID: 55},
|
||||||
|
56: {Name: "Halls of the Dead Level 1", ID: 56},
|
||||||
|
57: {Name: "Halls of the Dead Level 2", ID: 57},
|
||||||
|
58: {Name: "Claw Viper Temple Level 1", ID: 58},
|
||||||
|
59: {Name: "Stony Tomb Level 2", ID: 59},
|
||||||
|
6: {Name: "Black Marsh", ID: 6},
|
||||||
|
60: {Name: "Halls of the Dead Level 3", ID: 60},
|
||||||
|
61: {Name: "Claw Viper Temple Level 2", ID: 61},
|
||||||
|
62: {Name: "Maggot Lair Level 1", ID: 62},
|
||||||
|
63: {Name: "Maggot Lair Level 2", ID: 63},
|
||||||
|
64: {Name: "Maggot Lair Level 3", ID: 64},
|
||||||
|
65: {Name: "Ancient Tunnels", ID: 65},
|
||||||
|
66: {Name: "Tal Rasha's Tomb", ID: 66},
|
||||||
|
67: {Name: "Tal Rasha's Tomb", ID: 67},
|
||||||
|
68: {Name: "Tal Rasha's Tomb", ID: 68},
|
||||||
|
69: {Name: "Tal Rasha's Tomb", ID: 69},
|
||||||
|
7: {Name: "Tamoe Highland", ID: 7},
|
||||||
|
70: {Name: "Tal Rasha's Tomb", ID: 70},
|
||||||
|
71: {Name: "Tal Rasha's Tomb", ID: 71},
|
||||||
|
72: {Name: "Tal Rasha's Tomb", ID: 72},
|
||||||
|
73: {Name: "Duriel's Lair", ID: 73},
|
||||||
|
74: {Name: "Arcane Sanctuary", ID: 74},
|
||||||
|
75: {Name: "Kurast Docktown", ID: 75},
|
||||||
|
76: {Name: "Spider Forest", ID: 76},
|
||||||
|
77: {Name: "Great Marsh", ID: 77},
|
||||||
|
78: {Name: "Flayer Jungle", ID: 78},
|
||||||
|
79: {Name: "Lower Kurast", ID: 79},
|
||||||
|
8: {Name: "Den of Evil", ID: 8},
|
||||||
|
80: {Name: "Kurast Bazaar", ID: 80},
|
||||||
|
81: {Name: "Upper Kurast", ID: 81},
|
||||||
|
82: {Name: "Kurast Causeway", ID: 82},
|
||||||
|
83: {Name: "Travincal", ID: 83},
|
||||||
|
84: {Name: "Spider Cave", ID: 84},
|
||||||
|
85: {Name: "Spider Cavern", ID: 85},
|
||||||
|
86: {Name: "Swampy Pit Level 1", ID: 86},
|
||||||
|
87: {Name: "Swampy Pit Level 2", ID: 87},
|
||||||
|
88: {Name: "Flayer Dungeon Level 1", ID: 88},
|
||||||
|
89: {Name: "Flayer Dungeon Level 2", ID: 89},
|
||||||
|
9: {Name: "Cave Level 1", ID: 9},
|
||||||
|
90: {Name: "Swampy Pit Level 3", ID: 90},
|
||||||
|
91: {Name: "Flayer Dungeon Level 3", ID: 91},
|
||||||
|
92: {Name: "Sewers Level 1", ID: 92},
|
||||||
|
93: {Name: "Sewers Level 2", ID: 93},
|
||||||
|
94: {Name: "Ruined Temple", ID: 94},
|
||||||
|
95: {Name: "Disused Fane", ID: 95},
|
||||||
|
96: {Name: "Forgotten Reliquary", ID: 96},
|
||||||
|
97: {Name: "Forgotten Temple", ID: 97},
|
||||||
|
98: {Name: "Ruined Fane", ID: 98},
|
||||||
|
99: {Name: "Disused Reliquary", ID: 99},
|
||||||
|
}
|
||||||
@@ -1,55 +1,55 @@
|
|||||||
package area
|
package area
|
||||||
|
|
||||||
// WPAddresses represents the addresses of the waypoints in the game UI and the linked areas between them
|
// WPAddresses represents the addresses of the waypoints in the game UI and the linked areas between them
|
||||||
var WPAddresses = map[Area]WPAddress{
|
var WPAddresses = map[ID]WPAddress{
|
||||||
// Act 1
|
// Act 1
|
||||||
RogueEncampment: {1, 1, nil},
|
RogueEncampment: {1, 1, nil},
|
||||||
ColdPlains: {1, 2, []Area{RogueEncampment, BloodMoor}},
|
ColdPlains: {1, 2, []ID{RogueEncampment, BloodMoor}},
|
||||||
StonyField: {1, 3, []Area{ColdPlains}},
|
StonyField: {1, 3, []ID{ColdPlains}},
|
||||||
DarkWood: {1, 4, []Area{StonyField, UndergroundPassageLevel1}},
|
DarkWood: {1, 4, []ID{StonyField, UndergroundPassageLevel1}},
|
||||||
BlackMarsh: {1, 5, []Area{DarkWood}},
|
BlackMarsh: {1, 5, []ID{DarkWood}},
|
||||||
OuterCloister: {1, 6, []Area{BlackMarsh, TamoeHighland, MonasteryGate}},
|
OuterCloister: {1, 6, []ID{BlackMarsh, TamoeHighland, MonasteryGate}},
|
||||||
JailLevel1: {1, 7, []Area{OuterCloister, Barracks}},
|
JailLevel1: {1, 7, []ID{OuterCloister, Barracks}},
|
||||||
InnerCloister: {1, 8, []Area{JailLevel1, JailLevel2, JailLevel3}},
|
InnerCloister: {1, 8, []ID{JailLevel1, JailLevel2, JailLevel3}},
|
||||||
CatacombsLevel2: {1, 9, []Area{InnerCloister, Cathedral, CatacombsLevel1}},
|
CatacombsLevel2: {1, 9, []ID{InnerCloister, Cathedral, CatacombsLevel1}},
|
||||||
// Act 2
|
// Act 2
|
||||||
LutGholein: {2, 1, nil},
|
LutGholein: {2, 1, nil},
|
||||||
SewersLevel2Act2: {2, 2, []Area{LutGholein, SewersLevel1Act2}},
|
SewersLevel2Act2: {2, 2, []ID{LutGholein, SewersLevel1Act2}},
|
||||||
DryHills: {2, 3, []Area{LutGholein, RockyWaste}},
|
DryHills: {2, 3, []ID{LutGholein, RockyWaste}},
|
||||||
HallsOfTheDeadLevel2: {2, 4, []Area{DryHills, HallsOfTheDeadLevel1}},
|
HallsOfTheDeadLevel2: {2, 4, []ID{DryHills, HallsOfTheDeadLevel1}},
|
||||||
FarOasis: {2, 5, []Area{DryHills}},
|
FarOasis: {2, 5, []ID{DryHills}},
|
||||||
LostCity: {2, 6, []Area{FarOasis}},
|
LostCity: {2, 6, []ID{FarOasis}},
|
||||||
PalaceCellarLevel1: {2, 7, []Area{LutGholein, HaremLevel1, HaremLevel2}},
|
PalaceCellarLevel1: {2, 7, []ID{LutGholein, HaremLevel1, HaremLevel2}},
|
||||||
ArcaneSanctuary: {2, 8, []Area{PalaceCellarLevel1, PalaceCellarLevel2, PalaceCellarLevel3}},
|
ArcaneSanctuary: {2, 8, []ID{PalaceCellarLevel1, PalaceCellarLevel2, PalaceCellarLevel3}},
|
||||||
CanyonOfTheMagi: {2, 9, []Area{ArcaneSanctuary}},
|
CanyonOfTheMagi: {2, 9, []ID{ArcaneSanctuary}},
|
||||||
// Act 3
|
// Act 3
|
||||||
KurastDocks: {3, 1, nil},
|
KurastDocks: {3, 1, nil},
|
||||||
SpiderForest: {3, 2, []Area{KurastDocks}},
|
SpiderForest: {3, 2, []ID{KurastDocks}},
|
||||||
GreatMarsh: {3, 3, []Area{SpiderForest}},
|
GreatMarsh: {3, 3, []ID{SpiderForest}},
|
||||||
FlayerJungle: {3, 4, []Area{GreatMarsh}},
|
FlayerJungle: {3, 4, []ID{GreatMarsh}},
|
||||||
LowerKurast: {3, 5, []Area{FlayerJungle}},
|
LowerKurast: {3, 5, []ID{FlayerJungle}},
|
||||||
KurastBazaar: {3, 6, []Area{LowerKurast}},
|
KurastBazaar: {3, 6, []ID{LowerKurast}},
|
||||||
UpperKurast: {3, 7, []Area{KurastBazaar}},
|
UpperKurast: {3, 7, []ID{KurastBazaar}},
|
||||||
Travincal: {3, 8, []Area{UpperKurast, KurastCauseway}},
|
Travincal: {3, 8, []ID{UpperKurast, KurastCauseway}},
|
||||||
DuranceOfHateLevel2: {3, 9, []Area{Travincal, DuranceOfHateLevel1}},
|
DuranceOfHateLevel2: {3, 9, []ID{Travincal, DuranceOfHateLevel1}},
|
||||||
// Act 4
|
// Act 4
|
||||||
ThePandemoniumFortress: {4, 1, nil},
|
ThePandemoniumFortress: {4, 1, nil},
|
||||||
CityOfTheDamned: {4, 2, []Area{ThePandemoniumFortress, OuterSteppes, PlainsOfDespair}},
|
CityOfTheDamned: {4, 2, []ID{ThePandemoniumFortress, OuterSteppes, PlainsOfDespair}},
|
||||||
RiverOfFlame: {4, 3, []Area{CityOfTheDamned}},
|
RiverOfFlame: {4, 3, []ID{CityOfTheDamned}},
|
||||||
// Act 5
|
// Act 5
|
||||||
Harrogath: {5, 1, nil},
|
Harrogath: {5, 1, nil},
|
||||||
FrigidHighlands: {5, 2, []Area{Harrogath, BloodyFoothills}},
|
FrigidHighlands: {5, 2, []ID{Harrogath, BloodyFoothills}},
|
||||||
ArreatPlateau: {5, 3, []Area{FrigidHighlands}},
|
ArreatPlateau: {5, 3, []ID{FrigidHighlands}},
|
||||||
CrystallinePassage: {5, 4, []Area{ArreatPlateau}},
|
CrystallinePassage: {5, 4, []ID{ArreatPlateau}},
|
||||||
GlacialTrail: {5, 5, []Area{CrystallinePassage}},
|
GlacialTrail: {5, 5, []ID{CrystallinePassage}},
|
||||||
HallsOfPain: {5, 6, []Area{Harrogath, NihlathaksTemple, HallsOfAnguish}},
|
HallsOfPain: {5, 6, []ID{Harrogath, NihlathaksTemple, HallsOfAnguish}},
|
||||||
FrozenTundra: {5, 7, []Area{GlacialTrail}},
|
FrozenTundra: {5, 7, []ID{GlacialTrail}},
|
||||||
TheAncientsWay: {5, 8, []Area{FrozenTundra}},
|
TheAncientsWay: {5, 8, []ID{FrozenTundra}},
|
||||||
TheWorldStoneKeepLevel2: {5, 9, []Area{TheAncientsWay, ArreatSummit, TheWorldStoneKeepLevel1}},
|
TheWorldStoneKeepLevel2: {5, 9, []ID{TheAncientsWay, ArreatSummit, TheWorldStoneKeepLevel1}},
|
||||||
}
|
}
|
||||||
|
|
||||||
type WPAddress struct {
|
type WPAddress struct {
|
||||||
Tab int
|
Tab int
|
||||||
Row int
|
Row int
|
||||||
LinkedFrom []Area
|
LinkedFrom []ID
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ type Data struct {
|
|||||||
OpenMenus OpenMenus
|
OpenMenus OpenMenus
|
||||||
Roster Roster
|
Roster Roster
|
||||||
HoverData HoverData
|
HoverData HoverData
|
||||||
TerrorZones []area.Area
|
TerrorZones []area.ID
|
||||||
Quests quest.Quests
|
Quests quest.Quests
|
||||||
KeyBindings KeyBindings
|
KeyBindings KeyBindings
|
||||||
}
|
}
|
||||||
@@ -112,7 +112,7 @@ func (d Data) MercHPPercent() int {
|
|||||||
|
|
||||||
type RosterMember struct {
|
type RosterMember struct {
|
||||||
Name string
|
Name string
|
||||||
Area area.Area
|
Area area.ID
|
||||||
Position Position
|
Position Position
|
||||||
}
|
}
|
||||||
type Roster []RosterMember
|
type Roster []RosterMember
|
||||||
@@ -128,7 +128,7 @@ func (r Roster) FindByName(name string) (RosterMember, bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Level struct {
|
type Level struct {
|
||||||
Area area.Area
|
Area area.ID
|
||||||
Position Position
|
Position Position
|
||||||
IsEntrance bool // This means the area can not be accessed just walking through it, needs to be clicked
|
IsEntrance bool // This means the area can not be accessed just walking through it, needs to be clicked
|
||||||
}
|
}
|
||||||
@@ -159,7 +159,7 @@ type Position struct {
|
|||||||
type PlayerUnit struct {
|
type PlayerUnit struct {
|
||||||
Name string
|
Name string
|
||||||
ID UnitID
|
ID UnitID
|
||||||
Area area.Area
|
Area area.ID
|
||||||
Position Position
|
Position Position
|
||||||
Stats map[stat.ID]int
|
Stats map[stat.ID]int
|
||||||
Skills map[skill.ID]skill.Points
|
Skills map[skill.ID]skill.Points
|
||||||
@@ -167,7 +167,7 @@ type PlayerUnit struct {
|
|||||||
Class Class
|
Class Class
|
||||||
LeftSkill skill.ID
|
LeftSkill skill.ID
|
||||||
RightSkill skill.ID
|
RightSkill skill.ID
|
||||||
AvailableWaypoints []area.Area // Is only filled when WP menu is open and only for the specific selected tab
|
AvailableWaypoints []area.ID // Is only filled when WP menu is open and only for the specific selected tab
|
||||||
MaxHPValue *PointCounter
|
MaxHPValue *PointCounter
|
||||||
MaxMPValue *PointCounter
|
MaxMPValue *PointCounter
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -144,21 +144,21 @@ func (gd *GameReader) GetPlayerUnit(playerUnit uintptr, previousHP, previousMP *
|
|||||||
levelPtr := uintptr(gd.Process.ReadUInt(room2Ptr+0x90, Uint64))
|
levelPtr := uintptr(gd.Process.ReadUInt(room2Ptr+0x90, Uint64))
|
||||||
levelNo := gd.Process.ReadUInt(levelPtr+0x1F8, Uint32)
|
levelNo := gd.Process.ReadUInt(levelPtr+0x1F8, Uint32)
|
||||||
|
|
||||||
availableWPs := make([]area.Area, 0)
|
availableWPs := make([]area.ID, 0)
|
||||||
// Probably there is a better place to pick up those values, since this seems to be very tied to the UI
|
// Probably there is a better place to pick up those values, since this seems to be very tied to the UI
|
||||||
wpList := gd.Process.ReadBytesFromMemory(gd.moduleBaseAddressPtr+0x21AD220, 0x48)
|
wpList := gd.Process.ReadBytesFromMemory(gd.moduleBaseAddressPtr+0x21AD220, 0x48)
|
||||||
for i := 0; i < 0x48; i = i + 8 {
|
for i := 0; i < 0x48; i = i + 8 {
|
||||||
a := binary.LittleEndian.Uint32(wpList[i : i+4])
|
a := binary.LittleEndian.Uint32(wpList[i : i+4])
|
||||||
available := binary.LittleEndian.Uint32(wpList[i+4 : i+8])
|
available := binary.LittleEndian.Uint32(wpList[i+4 : i+8])
|
||||||
if available == 1 || area.Area(levelNo) == area.Area(a) {
|
if available == 1 || area.ID(levelNo) == area.ID(a) {
|
||||||
availableWPs = append(availableWPs, area.Area(a))
|
availableWPs = append(availableWPs, area.ID(a))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
d := data.PlayerUnit{
|
d := data.PlayerUnit{
|
||||||
Name: name,
|
Name: name,
|
||||||
ID: data.UnitID(unitID),
|
ID: data.UnitID(unitID),
|
||||||
Area: area.Area(levelNo),
|
Area: area.ID(levelNo),
|
||||||
Position: data.Position{
|
Position: data.Position{
|
||||||
X: int(xPos),
|
X: int(xPos),
|
||||||
Y: int(yPos),
|
Y: int(yPos),
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ func (gd *GameReader) getRoster() (roster []data.RosterMember) {
|
|||||||
|
|
||||||
roster = append(roster, data.RosterMember{
|
roster = append(roster, data.RosterMember{
|
||||||
Name: name,
|
Name: name,
|
||||||
Area: area.Area(a),
|
Area: area.ID(a),
|
||||||
Position: data.Position{X: int(xPos), Y: int(yPos)},
|
Position: data.Position{X: int(xPos), Y: int(yPos)},
|
||||||
})
|
})
|
||||||
partyStruct = uintptr(gd.Process.ReadUInt(partyStruct+0x148, Uint64))
|
partyStruct = uintptr(gd.Process.ReadUInt(partyStruct+0x148, Uint64))
|
||||||
|
|||||||
@@ -4,13 +4,13 @@ import (
|
|||||||
"github.com/hectorgimenez/d2go/pkg/data/area"
|
"github.com/hectorgimenez/d2go/pkg/data/area"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (gd *GameReader) TerrorZones() (areas []area.Area) {
|
func (gd *GameReader) TerrorZones() (areas []area.ID) {
|
||||||
tz := gd.moduleBaseAddressPtr + 0x299E2D8
|
tz := gd.moduleBaseAddressPtr + 0x29E9558
|
||||||
|
|
||||||
for i := 0; i < 7; i++ {
|
for i := 0; i < 7; i++ {
|
||||||
tzArea := gd.ReadUInt(tz+uintptr(i*Uint32), Uint32)
|
tzArea := gd.ReadUInt(tz+uintptr(i*Uint32), Uint32)
|
||||||
if tzArea != 0 {
|
if tzArea != 0 {
|
||||||
areas = append(areas, area.Area(tzArea))
|
areas = append(areas, area.ID(tzArea))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user