diff --git a/Client/Domain/DTO/UseSkillParams.cs b/Client/Domain/DTO/UseSkillParams.cs new file mode 100644 index 0000000..aa594d2 --- /dev/null +++ b/Client/Domain/DTO/UseSkillParams.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Client.Domain.DTO +{ + public struct UseSkillParams + { + public uint skillId; + public bool isForced; + public bool isShiftPressed; + } +} diff --git a/Client/Domain/Service/WorldHandler.cs b/Client/Domain/Service/WorldHandler.cs index c755e43..0a39060 100644 --- a/Client/Domain/Service/WorldHandler.cs +++ b/Client/Domain/Service/WorldHandler.cs @@ -111,7 +111,14 @@ namespace Client.Domain.Service return; } - SendMessage(OutgoingMessageTypeEnum.UseSkill, id); + var data = new UseSkillParams + { + skillId = id, + isForced = isForced, + isShiftPressed = isShiftPressed + }; + + SendMessage(OutgoingMessageTypeEnum.UseSkill, data); } public void RequestUseItem(uint id) diff --git a/L2BotCore/Domain/DTO/UseSkillParams.h b/L2BotCore/Domain/DTO/UseSkillParams.h new file mode 100644 index 0000000..e9a6eb3 --- /dev/null +++ b/L2BotCore/Domain/DTO/UseSkillParams.h @@ -0,0 +1,15 @@ +#pragma once + +#include +#include "../Events/EventDispatcher.h" +#include "../Logger/Logger.h" + +namespace L2Bot::Domain::DTO +{ + struct UseSkillParams + { + uint32_t skillId; + bool isForced; + bool isShiftPressed; + }; +} \ No newline at end of file diff --git a/L2BotCore/Domain/Services/IncomingMessageProcessor.h b/L2BotCore/Domain/Services/IncomingMessageProcessor.h index 78c1f49..2018458 100644 --- a/L2BotCore/Domain/Services/IncomingMessageProcessor.h +++ b/L2BotCore/Domain/Services/IncomingMessageProcessor.h @@ -4,6 +4,7 @@ #include "../Serializers/IncomingMessageFactoryInterface.h" #include "HeroServiceInterface.h" #include "../Enums/RestartPointTypeEnum.h" +#include "../DTO/UseSkillParams.h" namespace L2Bot::Domain::Services { @@ -38,7 +39,8 @@ namespace L2Bot::Domain::Services m_HeroService.Pickup(message.GetRawContent()); break; case Serializers::IncomingMessage::Type::useSkill: - m_HeroService.UseSkill(message.GetRawContent(), false, false); + const auto params = message.GetRawContent(); + m_HeroService.UseSkill(params.skillId, params.isForced, params.isShiftPressed); break; case Serializers::IncomingMessage::Type::useItem: m_HeroService.UseItem(message.GetRawContent()); diff --git a/L2BotCore/L2BotCore.vcxproj b/L2BotCore/L2BotCore.vcxproj index 60e7c50..95eb4e2 100644 --- a/L2BotCore/L2BotCore.vcxproj +++ b/L2BotCore/L2BotCore.vcxproj @@ -201,6 +201,7 @@ + diff --git a/L2BotCore/L2BotCore.vcxproj.filters b/L2BotCore/L2BotCore.vcxproj.filters index 19eb53c..54ee5bc 100644 --- a/L2BotCore/L2BotCore.vcxproj.filters +++ b/L2BotCore/L2BotCore.vcxproj.filters @@ -243,6 +243,9 @@ Header Files + + Header Files + diff --git a/L2BotDll/Serializers/JsonIncomingMessageFactory.h b/L2BotDll/Serializers/JsonIncomingMessageFactory.h index a083139..7456aa0 100644 --- a/L2BotDll/Serializers/JsonIncomingMessageFactory.h +++ b/L2BotDll/Serializers/JsonIncomingMessageFactory.h @@ -4,6 +4,7 @@ #include "../ThirdParty/json.hpp" #include "Domain/ValueObjects/Vector3.h" #include "Domain/Enums/RestartPointTypeEnum.h" +#include "Domain/DTO/UseSkillParams.h" using namespace L2Bot::Domain; using json = nlohmann::json; @@ -80,7 +81,11 @@ private: return Serializers::IncomingMessage { Serializers::IncomingMessage::Type::useSkill, - std::make_shared(jsonObject.get()) + std::make_shared( + jsonObject["skillId"].get(), + jsonObject["isForced"].get(), + jsonObject["isShiftPressed"].get() + ) }; } else if (type == "UseItem")