DarkflameServer/dScripts/02_server/Map/AM/AmTemplateSkillVolume.cpp
David Markowitz 8d37d9b681
Organize dScripts (#814)
* Organize dScripts

whitespace

Remove parent scope

Remove parent scope from initial setter

Remove debug

Remove helper programs

* Fix NtImagimeterVisibility script

Co-authored-by: aronwk-aaron <aronwk.aaron@gmail.com>
2022-11-03 12:57:54 -05:00

24 lines
701 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);
}
}