Skip to content

Commit

Permalink
Wind druid (#313)
Browse files Browse the repository at this point in the history
Co-authored-by: SoundsLegit <[email protected]>
  • Loading branch information
SoundsLegit and dmelia committed Jun 23, 2024
1 parent a9be33d commit 00238d5
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 14 deletions.
8 changes: 4 additions & 4 deletions internal/action/buff.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (b *Builder) Buff() *StepChainAction {
for _, kb := range preKeys {
helper.Sleep(100)
b.HID.PressKeyBinding(kb)
helper.Sleep(150)
helper.Sleep(180)
b.HID.Click(game.RightButton, 640, 340)
helper.Sleep(100)
}
Expand Down Expand Up @@ -97,7 +97,7 @@ func (b *Builder) Buff() *StepChainAction {
for _, kb := range postKeys {
helper.Sleep(100)
b.HID.PressKeyBinding(kb)
helper.Sleep(150)
helper.Sleep(180)
b.HID.Click(game.RightButton, 640, 340)
helper.Sleep(100)
}
Expand Down Expand Up @@ -155,11 +155,11 @@ func (b *Builder) buffCTA(d game.Data) (steps []step.Step) {
steps = append(steps,
step.SyncStep(func(d game.Data) error {
b.HID.PressKeyBinding(d.KeyBindings.MustKBForSkill(skill.BattleCommand))
helper.Sleep(150)
helper.Sleep(180)
b.HID.Click(game.RightButton, 300, 300)
helper.Sleep(100)
b.HID.PressKeyBinding(d.KeyBindings.MustKBForSkill(skill.BattleOrders))
helper.Sleep(150)
helper.Sleep(180)
b.HID.Click(game.RightButton, 300, 300)
helper.Sleep(100)

Expand Down
54 changes: 44 additions & 10 deletions internal/character/wind_druid.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ func (du WindDruid) KillMonsterSequence(
step.PrimaryAttack(
id,
3,
true,
step.Distance(druMinDistance, druMaxDistance),
),
)
Expand All @@ -84,13 +85,13 @@ func (du WindDruid) KillMonsterSequence(

func (du WindDruid) RecastBuffs(d game.Data) {
skills := []skill.ID{skill.Hurricane, skill.OakSage, skill.CycloneArmor}
states := []state.State{state.Hurricane, state.Oaksage, state.Cyclonearmor}

for _, druSkill := range skills {
for i, druSkill := range skills {
if kb, found := d.KeyBindings.KeyBindingForSkill(druSkill); found {
du.logger.Error("Hurricane not found")
if !d.PlayerUnit.States.HasState(state.Hurricane) {
if !d.PlayerUnit.States.HasState(states[i]) {
du.container.HID.PressKeyBinding(kb)
helper.Sleep(100)
helper.Sleep(180)
du.container.HID.Click(game.RightButton, 640, 340)
helper.Sleep(100)
}
Expand All @@ -112,19 +113,51 @@ func (du WindDruid) BuffSkills(d game.Data) (buffs []skill.ID) {
}

func (du WindDruid) PreCTABuffSkills(d game.Data) (skills []skill.ID) {
needsBear := true
wolves := 5
direWolves := 3
needsOak := true

// Broken for now
//for _, summon := range d.NPCs {
// if summon.ID == npc.DruBear {
// du.logger.Info("found bear")
// needsBear = false
// }
// if summon.ID == npc.DruFenris {
// du.logger.Info("found wolf")
// direWolves--
// }
// if summon.ID == npc.DruSpiritWolf {
// du.logger.Info("found spirit wolf")
// wolves--
// }
// du.logger.Info("npc name : ", summon.Name)
//}

if d.PlayerUnit.States.HasState(state.Oaksage) {
needsOak = false
}

_, foundDireWolf := d.KeyBindings.KeyBindingForSkill(skill.SummonDireWolf)
_, foundWolf := d.KeyBindings.KeyBindingForSkill(skill.SummonSpiritWolf)
_, foundBear := d.KeyBindings.KeyBindingForSkill(skill.SummonGrizzly)
_, foundOak := d.KeyBindings.KeyBindingForSkill(skill.OakSage)

if foundWolf {
for i := 0; i < wolves; i++ {
skills = append(skills, skill.SummonSpiritWolf)
}
}
if foundDireWolf {
skills = append(skills, skill.SummonDireWolf)
skills = append(skills, skill.SummonDireWolf)
skills = append(skills, skill.SummonDireWolf)
for i := 0; i < direWolves; i++ {
skills = append(skills, skill.SummonDireWolf)
}
}
if foundBear {
if foundBear && needsBear {
skills = append(skills, skill.SummonGrizzly)
}
if foundOak {
if foundOak && needsOak {
skills = append(skills, skill.OakSage)
}

Expand Down Expand Up @@ -225,8 +258,8 @@ func (du WindDruid) KillCouncil() action.Action {
step.PrimaryAttack(
m.UnitID,
3,
true,
step.Distance(druMinDistance, druMaxDistance),
step.EnsureAura(skill.Conviction),
),
)
}
Expand All @@ -253,6 +286,7 @@ func (du WindDruid) killMonster(npcId npc.ID, t data.MonsterType) action.Action
step.PrimaryAttack(
m.UnitID,
3,
true,
step.Distance(druMinDistance, druMaxDistance),
),
)
Expand Down

0 comments on commit 00238d5

Please sign in to comment.