WutheringWaves/GameServer/Controllers/RouletteController.cs

58 lines
2 KiB
C#
Raw Permalink Normal View History

2024-02-10 00:56:31 +00:00
using GameServer.Controllers.Attributes;
using GameServer.Network;
2024-02-10 16:04:03 +00:00
using GameServer.Systems.Entity;
using GameServer.Systems.Entity.Component;
using GameServer.Systems.Event;
2024-02-10 00:56:31 +00:00
using Protocol;
namespace GameServer.Controllers;
internal class RouletteController : Controller
{
public RouletteController(PlayerSession session) : base(session)
{
// RouletteController.
}
[GameEvent(GameEventType.EnterGame)]
public async Task OnEnterGame()
{
await Session.Push(MessageId.ExploreToolAllNotify, new ExploreToolAllNotify
{
SkillList = { 3001, 3002, 1005, 1006, 1001, 1004, 1003, 1007, 1009 },
2024-02-10 00:56:31 +00:00
ExploreSkill = 1001
});
await Session.Push(MessageId.ExploreSkillRouletteUpdateNotify, new ExploreSkillRouletteUpdateNotify
{
RouletteInfo =
{
new ExploreSkillRoulette
{
SkillIds = {1001, 1004, 1003, 0, 0, 0, 0, 0},
},
new ExploreSkillRoulette
{
SkillIds = {10002, 10004, 0, 0, 0, 0, 0, 0},
2024-02-10 00:56:31 +00:00
}
}
});
}
[NetEvent(MessageId.VisionExploreSkillSetRequest)]
public async Task<RpcResult> OnVisionExploreSkillSetRequest(VisionExploreSkillSetRequest request, CreatureController creatureController, EventSystem eventSystem)
2024-02-10 00:56:31 +00:00
{
PlayerEntity? playerEntity = creatureController.GetPlayerEntity();
2024-02-10 16:04:03 +00:00
if (playerEntity == null) return Response(MessageId.VisionExploreSkillSetResponse, new VisionExploreSkillSetResponse { ErrCode = (int)ErrorCode.PlayerNotInAnyScene });
EntityVisionSkillComponent visionSkillComponent = playerEntity.ComponentSystem.Get<EntityVisionSkillComponent>();
visionSkillComponent.SetExploreTool(request.SkillId);
await eventSystem.Emit(GameEventType.VisionSkillChanged);
2024-02-10 00:56:31 +00:00
return Response(MessageId.VisionExploreSkillSetResponse, new VisionExploreSkillSetResponse
{
SkillId = request.SkillId
});
}
}