mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-06-24 15:44:21 +00:00
feat: dragon instance script (#2012)
* feat: dragon instance script * Update FvDragonInstanceServer.h * feat: implement ronin script * Update CountdownDestroyAI.cpp * default initialize Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * remove unused handlers Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * use float Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * fixes * Update ScriptComponent.h --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
3
dScripts/ai/FV/Dragon_Instance/CMakeLists.txt
Normal file
3
dScripts/ai/FV/Dragon_Instance/CMakeLists.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
set(DSCRIPTS_SOURCES_AI_FV_DRAGON_INSTANCE
|
||||
"FvDragonInstanceServer.cpp"
|
||||
PARENT_SCOPE)
|
||||
14
dScripts/ai/FV/Dragon_Instance/FvDragonInstanceServer.cpp
Normal file
14
dScripts/ai/FV/Dragon_Instance/FvDragonInstanceServer.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#include "FvDragonInstanceServer.h"
|
||||
|
||||
#include "Entity.h"
|
||||
#include "DestroyableComponent.h"
|
||||
|
||||
void FvDragonInstanceServer::OnPlayerLoaded(Entity* self, Entity* player) {
|
||||
auto* const destComp = player->GetComponent<DestroyableComponent>();
|
||||
if (destComp) {
|
||||
destComp->SetHealth(destComp->GetMaxHealth());
|
||||
destComp->SetArmor(destComp->GetMaxArmor());
|
||||
destComp->SetImagination(destComp->GetMaxImagination());
|
||||
Game::entityManager->SerializeEntity(player);
|
||||
}
|
||||
}
|
||||
7
dScripts/ai/FV/Dragon_Instance/FvDragonInstanceServer.h
Normal file
7
dScripts/ai/FV/Dragon_Instance/FvDragonInstanceServer.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
#include "CppScripts.h"
|
||||
|
||||
class FvDragonInstanceServer : public CppScripts::Script {
|
||||
public:
|
||||
void OnPlayerLoaded(Entity* self, Entity* player) override;
|
||||
};
|
||||
Reference in New Issue
Block a user