聊天剧情奖励

This commit is contained in:
fatiao 2025-11-05 18:30:03 +08:00
parent 0226595ff0
commit 6ad99e26ab
6 changed files with 1274 additions and 1210 deletions

View File

@ -0,0 +1,12 @@
剧情Id,剧情奖励
StoryId,StoryRewards
int,list
100011,841:1;11:100000;19:20000
100021,841:1;11:100000;19:20000
100031,841:1;11:100000;19:20000
100041,841:1;11:100000;19:20000
100051,841:1;11:100000;19:20000
100061,841:1;11:100000;19:20000
100071,841:1;11:100000;19:20000
100081,841:1;11:100000;19:20000
100091,841:1;11:100000;19:20000
1 剧情Id 剧情奖励
2 StoryId StoryRewards
3 int list
4 100011 841:1;11:100000;19:20000
5 100021 841:1;11:100000;19:20000
6 100031 841:1;11:100000;19:20000
7 100041 841:1;11:100000;19:20000
8 100051 841:1;11:100000;19:20000
9 100061 841:1;11:100000;19:20000
10 100071 841:1;11:100000;19:20000
11 100081 841:1;11:100000;19:20000
12 100091 841:1;11:100000;19:20000

View File

@ -2075,9 +2075,30 @@ func (this *Role) SetRoleGuide(guideId int32) {
func (this *Role) SetRoleStory(story *serverproto.KeyValueType) {
nRet := this.GetRoleBase().SetStoryId(story)
storyRewards := make([]*serverproto.KeyValueType, 0)
// 如果值为8表示领取剧情奖励
if story.Value == 8 {
storyId := story.Key
storyRewardCfgMap := serverproto.StoryRewardsLoader
storyRewardCfg := storyRewardCfgMap[storyId]
rewardItems := make(map[int32]int32)
for _, v := range storyRewardCfg.StoryRewards {
key, value := model.Str2Res(v)
storyRewards = append(storyRewards, &serverproto.KeyValueType{
Key: key,
Value: value,
})
rewardItems[key] = value
util.InfoF("SetRoleStory: %d-%d", key, value)
}
this.AddItemList(rewardItems, AddFrom_StoryChat, true)
}
util.InfoF("SetRoleStory: storyRewards %d", len(storyRewards))
ackMsg := &serverproto.SCRoleStoryAck{
Error: int32(nRet),
StoryId: story,
Error: int32(nRet),
StoryId: story,
StoryRewards: storyRewards,
}
this.ReplayGate(ackMsg, true)
}

View File

@ -100,6 +100,7 @@ const (
AddFrom_PetRankAward //84 宠物比拼
AddFrom_DrawLevelupSummon //可升级的抽奖卡池
AddFrom_Fruit
AddFrom_StoryChat
)
type RoleBag struct {

View File

@ -133,6 +133,7 @@ const (
CFG_SkillSuitNewCfg = "SkillSuitNewCfg.csv"
CFG_SkillTreeCfg = "SkillTreeCfg.csv"
CFG_SkillUpEffectCfg = "SkillUpEffectCfg.csv"
CFG_StoryRewards = "StoryRewards.csv"
CFG_SummonCfg = "SummonCfg.csv"
CFG_SummonLevelUpCfg = "SummonLevelUpCfg.csv"
CFG_SummonServerCfg = "SummonServerCfg.csv"
@ -284,6 +285,7 @@ func configNameListInit() {
CFGNameList["SkillSuitNewCfg"] = SkillSuitNewCfgLoad
CFGNameList["SkillTreeCfg"] = SkillTreeCfgLoad
CFGNameList["SkillUpEffectCfg"] = SkillUpEffectCfgLoad
CFGNameList["StoryRewards"] = StoryRewardsLoad
CFGNameList["SummonCfg"] = SummonCfgLoad
CFGNameList["SummonLevelUpCfg"] = SummonLevelUpCfgLoad
CFGNameList["SummonServerCfg"] = SummonServerCfgLoad
@ -466,6 +468,7 @@ func ConfigInit(path string) {
SkillSuitNewCfgLoad(path)
SkillTreeCfgLoad(path)
SkillUpEffectCfgLoad(path)
StoryRewardsLoad(path)
SummonCfgLoad(path)
SummonLevelUpCfgLoad(path)
SummonServerCfgLoad(path)
@ -3563,6 +3566,22 @@ func SkillUpEffectCfgLoad(path string) {
}
}
var StoryRewardsLoader map[int32]*StoryRewards
type StoryRewards struct {
StoryId int32 `csv:"StoryId"` //剧情Id
StoryRewards []string `csv:"StoryRewards"` //剧情奖励
}
func StoryRewardsLoad(path string) {
cfg := []*StoryRewards{}
StoryRewardsLoader = map[int32]*StoryRewards{}
loadCsvCfg(path+"StoryRewards.csv", &cfg)
for _, row := range cfg {
StoryRewardsLoader[row.StoryId] = row
}
}
var SummonCfgLoader map[int32]*SummonCfg
type SummonCfg struct {

File diff suppressed because it is too large Load Diff

View File

@ -1441,6 +1441,7 @@ message CSRoleStoryReq { //project game //RouteRule game
message SCRoleStoryAck {
int32 error = 1; //
KeyValueType story_id = 2; //
repeated KeyValueType story_rewards = 3; //
}
//