mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-10 10:18:21 +00:00
28 lines
778 B
C++
28 lines
778 B
C++
|
#include "AmTemplateSkillVolume.h"
|
||
|
#include "MissionComponent.h"
|
||
|
|
||
|
void AmTemplateSkillVolume::OnSkillEventFired(Entity* self, Entity* caster, const std::string& message)
|
||
|
{
|
||
|
if (message != "NinjagoSpinAttackEvent")
|
||
|
{
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
auto* missionComponent = caster->GetComponent<MissionComponent>();
|
||
|
|
||
|
const auto missionIDsVariable = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"missions"));
|
||
|
const auto missionIDs = GeneralUtils::SplitString(missionIDsVariable, '_');
|
||
|
|
||
|
for (const auto& missionIDStr : missionIDs)
|
||
|
{
|
||
|
int32_t missionID = 0;
|
||
|
|
||
|
if (!GeneralUtils::TryParse(missionIDStr, missionID))
|
||
|
{
|
||
|
continue;
|
||
|
}
|
||
|
|
||
|
missionComponent->ForceProgressTaskType(missionID, 1, 1, false);
|
||
|
}
|
||
|
}
|