2021-12-05 17:54:36 +00:00
|
|
|
#include "AmTemplateSkillVolume.h"
|
|
|
|
#include "MissionComponent.h"
|
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
void AmTemplateSkillVolume::OnSkillEventFired(Entity* self, Entity* caster, const std::string& message) {
|
|
|
|
if (message != "NinjagoSpinAttackEvent") {
|
|
|
|
return;
|
|
|
|
}
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
auto* missionComponent = caster->GetComponent<MissionComponent>();
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
const auto missionIDsVariable = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"missions"));
|
|
|
|
const auto missionIDs = GeneralUtils::SplitString(missionIDsVariable, '_');
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
for (const auto& missionIDStr : missionIDs) {
|
|
|
|
int32_t missionID = 0;
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
if (!GeneralUtils::TryParse(missionIDStr, missionID)) {
|
|
|
|
continue;
|
|
|
|
}
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
missionComponent->ForceProgressTaskType(missionID, 1, 1, false);
|
|
|
|
}
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|