From 332171cafbf47f8cdcbe61f92b619d150741e167 Mon Sep 17 00:00:00 2001 From: CAtlas0784 Date: Sat, 17 Oct 2026 00:49:09 +0700 Subject: [PATCH] feat: add enable_aha_global passive support to Persistent and battle handlers --- internal/common/models.go | 6 ++++++ internal/gameserver/handlers_battle.go | 14 +++++++++----- persistent | 21 +++++++++++---------- 3 files changed, 26 insertions(+), 15 deletions(-) diff --git a/internal/common/models.go b/internal/common/models.go index b28ebd2..00aec87 100644 --- a/internal/common/models.go +++ b/internal/common/models.go @@ -305,6 +305,7 @@ type Persistent struct { MarchType MultiPathAvatar `json:"march_type"` EnableSWGlobal *bool `json:"enable_sw_global"` EnableCastoriceGlobal *bool `json:"enable_castorice_global"` + EnableAhaGlobal *bool `json:"enable_aha_global"` DressedSkins map[uint32]uint32 `json:"dressed_skins"` ExRanksUnlocked map[uint32]bool `json:"ex_ranks_unlocked"` } @@ -313,6 +314,7 @@ type Persistent struct { func DefaultPersistent() Persistent { sw := true cg := true + aha := true return Persistent{ Lineups: map[uint32]uint32{0: 1313, 1: 1006, 2: 8001, 3: 1405}, Position: DefaultPosition(), @@ -321,6 +323,7 @@ func DefaultPersistent() Persistent { MarchType: MultiPathMarchHunt, EnableSWGlobal: &sw, EnableCastoriceGlobal: &cg, + EnableAhaGlobal: &aha, DressedSkins: map[uint32]uint32{}, ExRanksUnlocked: map[uint32]bool{}, } @@ -344,6 +347,7 @@ type FreesrData struct { MarchType MultiPathAvatar `json:"-"` EnableSWGlobal *bool `json:"-"` EnableCastoriceGlobal *bool `json:"-"` + EnableAhaGlobal *bool `json:"-"` DressedSkins map[uint32]uint32 `json:"-"` } @@ -379,6 +383,7 @@ func LoadFreesrData() (*FreesrData, error) { data.MarchType = p.MarchType data.EnableSWGlobal = p.EnableSWGlobal data.EnableCastoriceGlobal = p.EnableCastoriceGlobal + data.EnableAhaGlobal = p.EnableAhaGlobal data.DressedSkins = p.DressedSkins for aid, unlocked := range p.ExRanksUnlocked { if av, ok := data.Avatars[aid]; ok { @@ -460,6 +465,7 @@ func (f *FreesrData) SavePersistent() { MarchType: f.MarchType, EnableSWGlobal: f.EnableSWGlobal, EnableCastoriceGlobal: f.EnableCastoriceGlobal, + EnableAhaGlobal: f.EnableAhaGlobal, DressedSkins: f.DressedSkins, ExRanksUnlocked: exUnlocked, } diff --git a/internal/gameserver/handlers_battle.go b/internal/gameserver/handlers_battle.go index f585d14..e37a006 100644 --- a/internal/gameserver/handlers_battle.go +++ b/internal/gameserver/handlers_battle.go @@ -405,6 +405,7 @@ func createBattleInfo(s *Session, casterID, skillIndex uint32) *goproto.SceneBat // global buffs hasCastorice, hasSilverWolf := false, false + hasAha := false for _, buff := range battleInfo.BuffList { if buff.Id == 140703 { hasCastorice = true @@ -412,6 +413,9 @@ func createBattleInfo(s *Session, casterID, skillIndex uint32) *goproto.SceneBat if buff.Id == 150602 { hasSilverWolf = true } + if buff.Id == 151104 { + hasAha = true + } } if !hasCastorice && (player.EnableCastoriceGlobal == nil || *player.EnableCastoriceGlobal) { battleInfo.BuffList = append(battleInfo.BuffList, &goproto.BattleBuff{ @@ -423,6 +427,11 @@ func createBattleInfo(s *Session, casterID, skillIndex uint32) *goproto.SceneBat Id: 150602, Level: 1, OwnerId: 0xffffffff, WaveFlag: 0xffffffff, }) } + if !hasAha && (player.EnableAhaGlobal == nil || *player.EnableAhaGlobal) { + battleInfo.BuffList = append(battleInfo.BuffList, &goproto.BattleBuff{ + Id: 151104, Level: 1, OwnerId: 0xffffffff, WaveFlag: 0xffffffff, + }) + } // Stage invasion buff (pearl-sr 4.6.53: e.g. Peak 11 stage 4 30511021/30511022 -> buff 3034004) if invasionID := getStageInvasionID(battleInfo.StageId); invasionID != 0 { @@ -445,11 +454,6 @@ func createBattleInfo(s *Session, casterID, skillIndex uint32) *goproto.SceneBat }) } - // Aha Global Passive (151104) — always on, same as the Rust build - battleInfo.BuffList = append(battleInfo.BuffList, &goproto.BattleBuff{ - Id: 151104, Level: 1, OwnerId: 0xffffffff, WaveFlag: 0xffffffff, - }) - return battleInfo } diff --git a/persistent b/persistent index 6ae9fb3..4deb079 100644 --- a/persistent +++ b/persistent @@ -1,25 +1,26 @@ { "lineups": { - "0": 1204, - "1": 1213, - "2": 1308, - "3": 1409 + "0": 1511, + "1": 1506, + "2": 1502, + "3": 1503 }, "position": { - "x": -92, - "y": 4278, - "z": 68083, + "x": 0, + "y": 0, + "z": 0, "rot_y": 155566 }, "scene": { - "plane_id": 10202, - "floor_id": 10202001, - "entry_id": 102020107 + "plane_id": 20001, + "floor_id": 20001001, + "entry_id": 2000101 }, "main_character": "FemaleHarmony", "march_type": "MarchHunt", "enable_sw_global": true, "enable_castorice_global": true, + "enable_aha_global": true, "dressed_skins": {}, "ex_ranks_unlocked": { "1204": true,