DarkflameServer/dScripts/ai/AG/AgShipPlayerShockServer.cpp

24 lines
846 B
C++
Raw Permalink Normal View History

#include "AgShipPlayerShockServer.h"
#include "GameMessages.h"
#include "RenderComponent.h"
#include "Entity.h"
#include "eTerminateType.h"
2022-07-28 13:39:57 +00:00
void AgShipPlayerShockServer::OnUse(Entity* self, Entity* user) {
GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
if (active) {
return;
}
active = true;
RenderComponent::PlayAnimation(user, shockAnim);
GameMessages::SendKnockback(user->GetObjectID(), self->GetObjectID(), self->GetObjectID(), 0, NiPoint3(-20, 10, -20));
GameMessages::SendPlayFXEffect(self, 1430, u"create", "console_sparks", LWOOBJID_EMPTY, 1.0, 1.0, true);
self->AddTimer("FXTime", fxTime);
}
2022-07-28 13:39:57 +00:00
void AgShipPlayerShockServer::OnTimerDone(Entity* self, std::string timerName) {
GameMessages::SendStopFXEffect(self, true, "console_sparks");
active = false;
}