Files
GaCy-GO/internal/gameserver/currency_wars_trial.go
T

32 lines
1.3 KiB
Go
Raw Normal View History

2026-10-28 18:54:43 +07:00
package gameserver
import (
"gac-hkrpg-go/internal/common"
pb "gac-hkrpg-go/protocol/proto"
)
// Fake avatars belong to CW's trial configuration, not the adventure roster.
// Source reference resolves SpecialAvatarID and serializes the special ID with
// AVATAR_TRIAL_TYPE. Current native rows supply all levels/equipment identities.
func cwTrialBattleAvatar(c *common.CurrencyWarsCatalog, role common.CurrencyWarsRoleVariant, index uint32) (*pb.BattleAvatar, error) {
wl := playerWorldLevel
if wl == 0 {
wl = 6
}
row, e := c.TrialAvatar(role.Config.SpecialAvatarID, role.Config.AvatarID, wl)
2026-10-28 18:54:43 +07:00
if e != nil {
return nil, e
}
avatar := &common.AvatarJson{AvatarID: row.AvatarID, Level: row.Level, Promotion: row.Promotion, Data: common.AvatarData{Rank: row.Rank}}
var equipment *common.Lightcone
if row.EquipmentID != 0 {
equipment = &common.Lightcone{ItemID: row.EquipmentID, Level: row.EquipmentLevel, Promotion: row.EquipmentPromotion, Rank: row.EquipmentRank}
}
result, _ := avatar.ToBattleAvatarProto(index, equipment, nil)
result.Id = row.AvatarID
result.AvatarType = pb.AvatarType_AvatarType_AvatarGridFightType
result.WorldLevel = wl
2026-10-28 18:54:43 +07:00
result.EnhancedId = row.EnhancedID
result.IGDEHGIKFJA = append([]uint32(nil), row.ExRankIDList...)
return result, nil
}