Skip to content

Commit 8ef98c5

Browse files
authored
Fix bliz sorc boss killing (#727)
1 parent 0a6820f commit 8ef98c5

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

internal/character/blizzard_sorceress.go

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,25 @@ func (s BlizzardSorceress) killMonster(npc npc.ID, t data.MonsterType) error {
120120
}
121121

122122
func (s BlizzardSorceress) killMonsterByName(id npc.ID, monsterType data.MonsterType, skipOnImmunities []stat.Resist) error {
123-
return s.KillMonsterSequence(func(d game.Data) (data.UnitID, bool) {
124-
if m, found := d.Monsters.FindOne(id, monsterType); found {
125-
return m.UnitID, true
126-
}
123+
// while the monster is alive, keep attacking it
124+
for {
125+
if m, found := s.Data.Monsters.FindOne(id, monsterType); found {
126+
if m.Stats[stat.Life] <= 0 {
127+
break
128+
}
127129

128-
return 0, false
129-
}, skipOnImmunities)
130+
s.KillMonsterSequence(func(d game.Data) (data.UnitID, bool) {
131+
if m, found := d.Monsters.FindOne(id, monsterType); found {
132+
return m.UnitID, true
133+
}
134+
135+
return 0, false
136+
}, skipOnImmunities)
137+
} else {
138+
break
139+
}
140+
}
141+
return nil
130142
}
131143

132144
func (s BlizzardSorceress) BuffSkills() []skill.ID {
@@ -199,7 +211,7 @@ func (s BlizzardSorceress) KillIzual() error {
199211
m, _ := s.Data.Monsters.FindOne(npc.Izual, data.MonsterTypeUnique)
200212
_ = step.SecondaryAttack(skill.StaticField, m.UnitID, 4, step.Distance(5, 8))
201213

202-
return s.killMonster(npc.Izual, data.MonsterTypeUnique)
214+
return s.killMonsterByName(npc.Izual, data.MonsterTypeUnique, nil)
203215
}
204216

205217
func (s BlizzardSorceress) KillDiablo() error {
@@ -230,7 +242,7 @@ func (s BlizzardSorceress) KillDiablo() error {
230242

231243
_ = step.SecondaryAttack(skill.StaticField, diablo.UnitID, 5, step.Distance(3, 8))
232244

233-
return s.killMonster(npc.Diablo, data.MonsterTypeUnique)
245+
return s.killMonsterByName(npc.Diablo, data.MonsterTypeUnique, nil)
234246
}
235247
}
236248

@@ -246,5 +258,5 @@ func (s BlizzardSorceress) KillBaal() error {
246258
m, _ := s.Data.Monsters.FindOne(npc.BaalCrab, data.MonsterTypeUnique)
247259
step.SecondaryAttack(skill.StaticField, m.UnitID, 4, step.Distance(5, 8))
248260

249-
return s.killMonster(npc.BaalCrab, data.MonsterTypeUnique)
261+
return s.killMonsterByName(npc.BaalCrab, data.MonsterTypeUnique, nil)
250262
}

0 commit comments

Comments
 (0)