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"
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-28 13:39:57 +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;
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
auto* missionComponent = caster->GetComponent<MissionComponent>();
|
|
|
|
if (missionComponent != nullptr && missionComponent->GetMissionState(healMission) == MissionState::MISSION_STATE_ACTIVE) {
|
|
|
|
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_SCRIPT, self->GetLOT());
|
|
|
|
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"ClearMaelstrom", 0, 0,
|
|
|
|
caster->GetObjectID(), "", caster->GetSystemAddress());
|
|
|
|
}
|
|
|
|
}
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|