fix: sync current handlers, repair relic data and restore visible launcher consoles
This commit is contained in:
1 parent
163d4433e6
commit
74f3c4411b
46 files changed
+4599
-1402
No files matched your search
@@ -44,11 +44,12 @@ func relicAffixes(subs []SubAffix) []*goproto.RelicAffix {
|
||||
}
|
||||
|
||||
func (r *Relic) ToBattleRelic() *goproto.BattleRelic {
|
||||
// Match PearlSR's standalone battle relic format. Inventory UniqueID is
|
||||
// only sent by ToProtoRelic/ToEquipRelic; battle carries the full affixes.
|
||||
return &goproto.BattleRelic{
|
||||
Id: r.RelicID,
|
||||
Level: r.Level,
|
||||
MainAffixId: r.MainAffixID,
|
||||
UniqueId: r.UniqueID(),
|
||||
SubAffixList: relicAffixes(r.SubAffixes),
|
||||
}
|
||||
}
|
||||
@@ -316,19 +317,26 @@ func (m *Monster) ToSceneMonster() *goproto.SceneMonster {
|
||||
return &goproto.SceneMonster{
|
||||
MonsterId: m.MonsterID,
|
||||
MaxHp: hp,
|
||||
CurHp: hp,
|
||||
}
|
||||
}
|
||||
|
||||
func monsterWave(waveID uint32, monsters []Monster) *goproto.SceneMonsterWave {
|
||||
func monsterWave(monsters []Monster) *goproto.SceneMonsterWave {
|
||||
maxLevel := uint32(0)
|
||||
for _, monster := range monsters {
|
||||
if monster.Level > maxLevel {
|
||||
maxLevel = monster.Level
|
||||
}
|
||||
}
|
||||
if maxLevel == 0 {
|
||||
maxLevel = 95
|
||||
}
|
||||
|
||||
wave := &goproto.SceneMonsterWave{
|
||||
WaveId: waveID,
|
||||
MonsterList: make([]*goproto.SceneMonster, 0, len(monsters)),
|
||||
// NOTE: WaveParam MUST be nil! In client 4.6.53 GameAssembly.dll
|
||||
// AdventureModule.CreateBattleServerCheckResult (RVA 0x166b2ef6),
|
||||
// if WaveParam is non-nil it tries to dereference [wave_param + 0x10]
|
||||
// and throws NullReferenceException. When nil, it safely jumps over.
|
||||
WaveParam: nil,
|
||||
// Include a level so the client can validate this wave directly instead
|
||||
// of looking up monster data from the battle stage's static table. This
|
||||
// matters when a Calyx request reuses a custom battle stage ID.
|
||||
WaveParam: &goproto.SceneMonsterWaveParam{Level: maxLevel},
|
||||
}
|
||||
for i := range monsters {
|
||||
wave.MonsterList = append(wave.MonsterList, monsters[i].ToSceneMonster())
|
||||
@@ -338,8 +346,8 @@ func monsterWave(waveID uint32, monsters []Monster) *goproto.SceneMonsterWave {
|
||||
|
||||
func ToSceneMonsterWaves(waves [][]Monster) []*goproto.SceneMonsterWave {
|
||||
out := make([]*goproto.SceneMonsterWave, 0, len(waves))
|
||||
for i, wave := range waves {
|
||||
out = append(out, monsterWave(uint32(i+1), wave))
|
||||
for _, wave := range waves {
|
||||
out = append(out, monsterWave(wave))
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user