mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-12-23 05:53:34 +00:00
ff0336793c
several summons use this script to be immune to stuns
20 lines
628 B
C++
20 lines
628 B
C++
#include "StunImmunity.h"
|
|
#include "DestroyableComponent.h"
|
|
#include "ControllablePhysicsComponent.h"
|
|
|
|
void StunImmunity::OnStartup(Entity* self) {
|
|
auto* destroyableComponent = self->GetComponent<DestroyableComponent>();
|
|
if (destroyableComponent) {
|
|
destroyableComponent->SetStatusImmunity(
|
|
eStateChangeType::PUSH, false, false, true, true, false, false, false, false, true
|
|
);
|
|
}
|
|
|
|
auto* controllablePhysicsComponent = self->GetComponent<ControllablePhysicsComponent>();
|
|
if (controllablePhysicsComponent) {
|
|
controllablePhysicsComponent->SetStunImmunity(
|
|
eStateChangeType::PUSH, self->GetObjectID(), true
|
|
);
|
|
}
|
|
}
|