mirror of
https://github.com/rafi1212122/PemukulPaku
synced 2025-12-12 14:24:34 +01:00
fix cannot advance to next cycle, shicksal is untested
This commit is contained in:
111
Common/Utils/ExcelReader/OpenWorldStoryData.cs
Normal file
111
Common/Utils/ExcelReader/OpenWorldStoryData.cs
Normal file
@@ -0,0 +1,111 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Common.Utils.ExcelReader
|
||||
{
|
||||
public class OpenWorldStoryData : BaseExcelReader<OpenWorldStoryData, OpenWorldStoryDataExcel>
|
||||
{
|
||||
public override string FileName { get { return "OpenWorldStoryData.json"; } }
|
||||
|
||||
public OpenWorldStoryDataExcel? FromId(int id)
|
||||
{
|
||||
return All.Where(story => story.StoryId == id).FirstOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
|
||||
public partial class OpenWorldStoryDataExcel
|
||||
{
|
||||
[JsonProperty("StorySeriesID")]
|
||||
public int StorySeriesId { get; set; }
|
||||
|
||||
[JsonProperty("StorySeriesStep")]
|
||||
public int StorySeriesStep { get; set; }
|
||||
|
||||
[JsonProperty("StorySeriesTitle")]
|
||||
public HashName StorySeriesTitle { get; set; }
|
||||
|
||||
[JsonProperty("PreStory")]
|
||||
public int[] PreStory { get; set; }
|
||||
|
||||
[JsonProperty("StoryType")]
|
||||
public int StoryType { get; set; }
|
||||
|
||||
[JsonProperty("GroupType")]
|
||||
public int GroupType { get; set; }
|
||||
|
||||
[JsonProperty("Cycle")]
|
||||
public int Cycle { get; set; }
|
||||
|
||||
[JsonProperty("StoryStartDate")]
|
||||
public string StoryStartDate { get; set; }
|
||||
|
||||
[JsonProperty("UnlockMapLv")]
|
||||
public int UnlockMapLv { get; set; }
|
||||
|
||||
[JsonProperty("UnlockQuestLv")]
|
||||
public int UnlockQuestLv { get; set; }
|
||||
|
||||
[JsonProperty("ShowConditionList")]
|
||||
public string ShowConditionList { get; set; }
|
||||
|
||||
[JsonProperty("isUseNewCondition")]
|
||||
public bool IsUseNewCondition { get; set; }
|
||||
|
||||
[JsonProperty("UnlockConditionList")]
|
||||
public string UnlockConditionList { get; set; }
|
||||
|
||||
[JsonProperty("PreviewRelateSeries")]
|
||||
public int[] PreviewRelateSeries { get; set; }
|
||||
|
||||
[JsonProperty("UnlockConditionTips")]
|
||||
public HashName UnlockConditionTips { get; set; }
|
||||
|
||||
[JsonProperty("StoryMap")]
|
||||
public int StoryMap { get; set; }
|
||||
|
||||
[JsonProperty("StoryArea")]
|
||||
public int StoryArea { get; set; }
|
||||
|
||||
[JsonProperty("Name")]
|
||||
public HashName Name { get; set; }
|
||||
|
||||
[JsonProperty("HuntRewardItem")]
|
||||
public int HuntRewardItem { get; set; }
|
||||
|
||||
[JsonProperty("HuntRewardItemDisplay")]
|
||||
public int HuntRewardItemDisplay { get; set; }
|
||||
|
||||
[JsonProperty("Description")]
|
||||
public HashName Description { get; set; }
|
||||
|
||||
[JsonProperty("Target")]
|
||||
public HashName Target { get; set; }
|
||||
|
||||
[JsonProperty("MaxCount")]
|
||||
public int MaxCount { get; set; }
|
||||
|
||||
[JsonProperty("LocationID")]
|
||||
public int LocationId { get; set; }
|
||||
|
||||
[JsonProperty("DLCChallengeMode")]
|
||||
public bool DlcChallengeMode { get; set; }
|
||||
|
||||
[JsonProperty("IsTaskAnimation")]
|
||||
public int IsTaskAnimation { get; set; }
|
||||
|
||||
[JsonProperty("IsHideUI")]
|
||||
public bool IsHideUi { get; set; }
|
||||
|
||||
[JsonProperty("IsTutorial")]
|
||||
public bool IsTutorial { get; set; }
|
||||
|
||||
[JsonProperty("PreStage")]
|
||||
public object[] PreStage { get; set; }
|
||||
|
||||
[JsonProperty("DataImpl")]
|
||||
public object DataImpl { get; set; }
|
||||
|
||||
[JsonProperty("StoryID")]
|
||||
public int StoryId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,4 @@
|
||||
using Common.Database;
|
||||
using Common.Resources.Proto;
|
||||
using Common.Utils.ExcelReader;
|
||||
using Common.Resources.Proto;
|
||||
|
||||
namespace PemukulPaku.GameServer.Handlers.Openworld
|
||||
{
|
||||
@@ -10,12 +8,6 @@ namespace PemukulPaku.GameServer.Handlers.Openworld
|
||||
public void Handle(Session session, Packet packet)
|
||||
{
|
||||
TakeOpenworldCycleFinishRewardReq Data = packet.GetDecodedBody<TakeOpenworldCycleFinishRewardReq>();
|
||||
OpenWorldScheme? ow = session.Player.OpenWorlds.Where(x => x.MapId == Data.MapId).FirstOrDefault();
|
||||
if (ow is not null)
|
||||
{
|
||||
ow.Cycle = OpenWorldCycleData.GetInstance().GetNextCycle(Data.MapId, Data.Cycle);
|
||||
ow.HasTakeFinishRewardCycle = OpenWorldCycleData.GetInstance().GetNextCycle(Data.MapId, Data.Cycle);
|
||||
}
|
||||
|
||||
session.Send(Packet.FromProto(new TakeOpenworldCycleFinishRewardRsp()
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Common.Database;
|
||||
using Common.Resources.Proto;
|
||||
using Common.Utils.ExcelReader;
|
||||
|
||||
namespace PemukulPaku.GameServer.Handlers.Openworld
|
||||
{
|
||||
@@ -9,9 +10,20 @@ namespace PemukulPaku.GameServer.Handlers.Openworld
|
||||
public void Handle(Session session, Packet packet)
|
||||
{
|
||||
TakeOpenworldStoryRewardReq Data = packet.GetDecodedBody<TakeOpenworldStoryRewardReq>();
|
||||
UserScheme.OpenWorldStoryScheme? ow = session.Player.User.OpenWorldStory.FirstOrDefault(x => x.StoryId == Data.StoryId);
|
||||
if (ow is not null)
|
||||
ow.IsDone = true;
|
||||
UserScheme.OpenWorldStoryScheme? openWorldStory = session.Player.User.OpenWorldStory.FirstOrDefault(x => x.StoryId == Data.StoryId);
|
||||
if (openWorldStory is not null)
|
||||
openWorldStory.IsDone = true;
|
||||
|
||||
OpenWorldStoryDataExcel? storyData = OpenWorldStoryData.GetInstance().FromId((int)Data.StoryId);
|
||||
if (storyData is not null)
|
||||
{
|
||||
OpenWorldScheme? ow = session.Player.OpenWorlds.Where(x => x.MapId == storyData.StoryMap).FirstOrDefault();
|
||||
if (ow is not null && OpenWorldStoryData.GetInstance().All.FirstOrDefault(story => story.PreStory.Contains((int)Data.StoryId) && story.StoryMap == storyData.StoryMap)?.Cycle > storyData.Cycle)
|
||||
{
|
||||
ow.Cycle = OpenWorldCycleData.GetInstance().GetNextCycle((uint)storyData.StoryMap, (uint)storyData.Cycle);
|
||||
ow.HasTakeFinishRewardCycle = OpenWorldCycleData.GetInstance().GetNextCycle((uint)storyData.StoryMap, (uint)storyData.Cycle);
|
||||
}
|
||||
}
|
||||
|
||||
session.Send(Packet.FromProto(new TakeOpenworldStoryRewardRsp() { retcode = TakeOpenworldStoryRewardRsp.Retcode.Succ, StoryId = Data.StoryId }, CmdId.TakeOpenworldStoryRewardRsp));
|
||||
session.ProcessPacket(Packet.FromProto(new GetOpenworldStoryReq() { }, CmdId.GetOpenworldStoryReq));
|
||||
|
||||
@@ -6,6 +6,7 @@ using PemukulPaku.GameServer.Game;
|
||||
using PemukulPaku.GameServer.Commands;
|
||||
using MongoDB.Bson;
|
||||
using Common.Resources.Proto;
|
||||
using Common.Utils.ExcelReader;
|
||||
|
||||
namespace PemukulPaku
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user