2021-12-05 17:54:36 +00:00
|
|
|
#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) {
|
2024-02-10 11:05:25 +00:00
|
|
|
const auto missionID = GeneralUtils::TryParse<uint32_t>(missionIDStr);
|
|
|
|
if (!missionID) continue;
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2024-02-10 11:05:25 +00:00
|
|
|
missionComponent->ForceProgressTaskType(missionID.value(), 1, 1, false);
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
}
|