mirror of
https://github.com/DarkflameUniverse/DarkflameServer
synced 2024-08-30 18:43:58 +00:00
add stun immunity script (#1015)
several summons use this script to be immune to stuns
This commit is contained in:
19
dScripts/EquipmentScripts/StunImmunity.cpp
Normal file
19
dScripts/EquipmentScripts/StunImmunity.cpp
Normal file
@ -0,0 +1,19 @@
|
||||
#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
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user