2021-12-05 17:54:36 +00:00
|
|
|
#include "ImaginationBackpackHealServer.h"
|
|
|
|
#include "GameMessages.h"
|
2022-07-05 06:00:10 +00:00
|
|
|
#include "MissionComponent.h"
|
|
|
|
#include "eMissionTaskType.h"
|
|
|
|
#include "eMissionState.h"
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
void ImaginationBackpackHealServer::OnSkillEventFired(Entity* self, Entity* caster, const std::string& message) {
|
|
|
|
if (message == "CastImaginationBackpack") {
|
|
|
|
auto healMission = self->GetVar<int32_t>(u"FXOffMis");
|
|
|
|
if (healMission == 0)
|
|
|
|
healMission = self->GetVar<int32_t>(u"FXOnMis");
|
|
|
|
if (healMission == 0)
|
|
|
|
return;
|
|
|
|
|
2023-06-07 07:23:50 +00:00
|
|
|
auto missionComponent = caster->GetComponent<MissionComponent>();
|
2021-12-05 17:54:36 +00:00
|
|
|
if (missionComponent != nullptr && missionComponent->GetMissionState(healMission) == eMissionState::ACTIVE) {
|
|
|
|
missionComponent->Progress(eMissionTaskType::SCRIPT, self->GetLOT());
|
|
|
|
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"ClearMaelstrom", 0, 0,
|
|
|
|
caster->GetObjectID(), "", caster->GetSystemAddress());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|