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:
@ -1,4 +1,4 @@
|
||||
set(DSCRIPTS_SOURCES_EQUIPMENTSCRIPTS
|
||||
set(DSCRIPTS_SOURCES_EQUIPMENTSCRIPTS
|
||||
"Sunflower.cpp"
|
||||
"AnvilOfArmor.cpp"
|
||||
"FountainOfImagination.cpp"
|
||||
@ -6,4 +6,5 @@ set(DSCRIPTS_SOURCES_EQUIPMENTSCRIPTS
|
||||
"PersonalFortress.cpp"
|
||||
"BuccaneerValiantShip.cpp"
|
||||
"FireFirstSkillonStartup.cpp"
|
||||
"StunImmunity.cpp"
|
||||
PARENT_SCOPE)
|
||||
|
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
|
||||
);
|
||||
}
|
||||
}
|
6
dScripts/EquipmentScripts/StunImmunity.h
Normal file
6
dScripts/EquipmentScripts/StunImmunity.h
Normal file
@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
#include "CppScripts.h"
|
||||
|
||||
class StunImmunity : public CppScripts::Script {
|
||||
void OnStartup(Entity* self) override;
|
||||
};
|
Reference in New Issue
Block a user