mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-25 15:07:28 +00:00
add stun immunity script (#1015)
several summons use this script to be immune to stuns
This commit is contained in:
parent
49047a267b
commit
ff0336793c
@ -281,6 +281,7 @@
|
||||
#include "GemPack.h"
|
||||
#include "ShardArmor.h"
|
||||
#include "TeslaPack.h"
|
||||
#include "StunImmunity.h"
|
||||
|
||||
// Survival scripts
|
||||
#include "AgSurvivalStromling.h"
|
||||
@ -846,6 +847,8 @@ CppScripts::Script* CppScripts::GetScript(Entity* parent, const std::string& scr
|
||||
script = new ShardArmor();
|
||||
else if (scriptName == "scripts\\equipmenttriggers\\coilbackpack.lua")
|
||||
script = new TeslaPack();
|
||||
else if (scriptName == "scripts\\EquipmentScripts\\stunImmunity.lua")
|
||||
script = new StunImmunity();
|
||||
|
||||
// FB
|
||||
else if (scriptName == "scripts\\ai\\NS\\WH\\L_ROCKHYDRANT_BROKEN.lua")
|
||||
|
@ -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;
|
||||
};
|
Loading…
Reference in New Issue
Block a user