implement rest of equipment scripts (#1714)

This commit is contained in:
David Markowitz
2025-01-03 14:44:20 -08:00
committed by GitHub
parent c8fcb3788d
commit fb32534ae3
15 changed files with 188 additions and 30 deletions

View File

@@ -0,0 +1,22 @@
#include "ImaginationBackPack.h"
#include "SkillComponent.h"
void ImaginationBackPack::OnFactionTriggerItemEquipped(Entity* itemOwner, LWOOBJID itemObjId) {
LOG("Subscribing to PlayerResurrectionFinished");
itemOwner->Subscribe(itemObjId, this, "PlayerResurrectionFinished");
}
void ImaginationBackPack::NotifyPlayerResurrectionFinished(Entity& self, GameMessages::PlayerResurrectionFinished& msg) {
LOG("PlayerResurrectionFinished");
auto* skillComponent = self.GetComponent<SkillComponent>();
if (!skillComponent) return;
LOG("Casting skill 1334");
skillComponent->CastSkill(1334);
}
void ImaginationBackPack::OnFactionTriggerItemUnequipped(Entity* itemOwner, LWOOBJID itemObjId) {
LOG("Unsubscribing from PlayerResurrectionFinished");
itemOwner->Unsubscribe(itemObjId, "PlayerResurrectionFinished");
}