Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: extended kurast chest run #694

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions config/template/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ game:
spider_cavern:
openChests: true
focusOnElitePacks: false
lower_kurast_chests:
openRacks: true
getSewersChests: false
pit:
# default - Outer Cloister -> Monastery Gates -> Tamoe Highland
moveThroughBlackMarsh: false # Use Black Marsh -> Tamoe Highland route
Expand Down
3 changes: 2 additions & 1 deletion internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ type CharacterCfg struct {
KillShenk bool `yaml:"killShenk"`
} `yaml:"eldritch"`
LowerKurastChest struct {
OpenRacks bool `yaml:"openRacks"`
OpenRacks bool `yaml:"openRacks"`
GetSewersChests bool `yaml:"getSewersChests"`
} `yaml:"lowerkurastchests"`
TerrorZone struct {
FocusOnElitePacks bool `yaml:"focusOnElitePacks"`
Expand Down
67 changes: 59 additions & 8 deletions internal/run/lower_kurast_chests.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"slices"
"sort"
"time"

"github.com/hectorgimenez/d2go/pkg/data"
"github.com/hectorgimenez/d2go/pkg/data/area"
Expand Down Expand Up @@ -108,15 +109,65 @@ func (run LowerKurastChests) Run() error {
}
}

// Return to town
if err = action.ReturnTown(); err != nil {
return err
}
if run.ctx.CharacterCfg.Game.LowerKurastChest.GetSewersChests {
// Go get all those chests in sewers lvl 2
err = action.MoveToArea(area.KurastBazaar)
err = action.MoveToArea(area.SewersLevel1Act3)
if err != nil {
return err
}
action.Buff()

// Move to A4 if possible to shorten the run time
err = action.WayPoint(area.ThePandemoniumFortress)
if err != nil {
return err
err = action.MoveTo(func() (data.Position, bool) {
for _, l := range run.ctx.Data.AdjacentLevels {
if l.Area == area.SewersLevel2Act3 {
return l.Position, true
}
}
return data.Position{}, false
})
if err != nil {
return err
}

_ = action.ClearAreaAroundPlayer(10, data.MonsterAnyFilter())

stairs, found := run.ctx.Data.Objects.FindOne(object.Act3SewerStairsToLevel3)
if !found {
run.ctx.Logger.Debug("Stairs in Act 3 Sewers not found")
}

_ = action.MoveToCoords(stairs.Position)

_ = action.InteractObject(stairs, func() bool {
o, _ := run.ctx.Data.Objects.FindOne(object.Act3SewerStairsToLevel3)

return !o.Selectable
})

time.Sleep(3000)

err = action.MoveToArea(area.SewersLevel2Act3)
if err != nil {
return err
}
action.Buff()

err = action.ClearCurrentLevel(true, run.ctx.Data.MonsterFilterAnyReachable())
if err != nil {
return err
}

// Return to town
if err = action.ReturnTown(); err != nil {
return err
}

// Move to A4 if possible to shorten the run time
err = action.WayPoint(area.ThePandemoniumFortress)
if err != nil {
return err
}
}

// Done
Expand Down
1 change: 1 addition & 0 deletions internal/server/http_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,7 @@ func (s *HttpServer) characterSettings(w http.ResponseWriter, r *http.Request) {

cfg.Game.Eldritch.KillShenk = r.Form.Has("gameEldritchKillShenk")
cfg.Game.LowerKurastChest.OpenRacks = r.Form.Has("gameLowerKurastChestOpenRacks")
cfg.Game.LowerKurastChest.GetSewersChests = r.Form.Has("gameLowerKurastChestGetSewersChests")
cfg.Game.Diablo.StartFromStar = r.Form.Has("gameDiabloStartFromStar")
cfg.Game.Diablo.KillDiablo = r.Form.Has("gameDiabloKillDiablo")
cfg.Game.Diablo.FocusOnElitePacks = r.Form.Has("gameDiabloFocusOnElitePacks")
Expand Down
1 change: 1 addition & 0 deletions internal/server/templates/run_settings_components.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
{{ define "lower_kurast_chest" }}
<fieldset>
<label><input type="checkbox" name="gameLowerKurastChestOpenRacks" {{ if .Config.Game.LowerKurastChest.OpenRacks }}checked{{ end }}> Weapon Racks + Armor Stands</label>
<label><input type="checkbox" name="gameLowerKurastChestGetSewersChests" {{ if .Config.Game.LowerKurastChest.GetSewersChests }}checked{{ end }}> Get Sewers Chests</label>
</fieldset>
{{ end }}

Expand Down