mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-10-14 19:38:08 +00:00
Merge RC script from differnt branch
Add wandering vendor script Update proximity monitors to move with their respective entityies
This commit is contained in:
@@ -1,3 +1,12 @@
|
||||
set(DSCRIPTS_SOURCES_ZONE_LUPS
|
||||
|
||||
set(DSCRIPTS_SOURCES_ZONE_LUPS
|
||||
"WblGenericZone.cpp"
|
||||
PARENT_SCOPE)
|
||||
)
|
||||
|
||||
add_subdirectory(RobotCity_Intro)
|
||||
|
||||
foreach(file ${DSCRIPTS_SOURCES_ZONE_LUPS_ROBOTCITYINTRO})
|
||||
set(DSCRIPTS_SOURCES_ZONE_LUPS ${DSCRIPTS_SOURCES_ZONE_LUPS} "RobotCity_Intro/${file}")
|
||||
endforeach()
|
||||
|
||||
set(DSCRIPTS_SOURCES_ZONE_LUPS ${DSCRIPTS_SOURCES_ZONE_LUPS} PARENT_SCOPE)
|
||||
|
3
dScripts/zone/LUPs/RobotCity_Intro/CMakeLists.txt
Normal file
3
dScripts/zone/LUPs/RobotCity_Intro/CMakeLists.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
set(DSCRIPTS_SOURCES_ZONE_LUPS_ROBOTCITYINTRO
|
||||
"WblRobotCitizen.cpp"
|
||||
PARENT_SCOPE)
|
25
dScripts/zone/LUPs/RobotCity_Intro/WblRobotCitizen.cpp
Normal file
25
dScripts/zone/LUPs/RobotCity_Intro/WblRobotCitizen.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#include "WblRobotCitizen.h"
|
||||
#include "MovementAIComponent.h"
|
||||
#include "RenderComponent.h"
|
||||
|
||||
void WblRobotCitizen::OnStartup(Entity* self) {
|
||||
auto movementAIComponent = self->GetComponent<MovementAIComponent>();
|
||||
if (!movementAIComponent) return;
|
||||
movementAIComponent->Resume();
|
||||
}
|
||||
|
||||
void WblRobotCitizen::OnUse(Entity* self, Entity* user) {
|
||||
auto movementAIComponent = self->GetComponent<MovementAIComponent>();
|
||||
if (!movementAIComponent) return;
|
||||
movementAIComponent->Pause();
|
||||
auto face = NiQuaternion::LookAt(self->GetPosition(), user->GetPosition());
|
||||
self->SetRotation(face);
|
||||
auto timer = RenderComponent::PlayAnimation(self, "wave");
|
||||
self->AddTimer("animation time", timer);
|
||||
}
|
||||
|
||||
void WblRobotCitizen::OnTimerDone(Entity* self, std::string timerName) {
|
||||
auto movementAIComponent = self->GetComponent<MovementAIComponent>();
|
||||
if (!movementAIComponent) return;
|
||||
movementAIComponent->Resume();
|
||||
}
|
10
dScripts/zone/LUPs/RobotCity_Intro/WblRobotCitizen.h
Normal file
10
dScripts/zone/LUPs/RobotCity_Intro/WblRobotCitizen.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include "CppScripts.h"
|
||||
|
||||
class WblRobotCitizen : public CppScripts::Script {
|
||||
public:
|
||||
void OnStartup(Entity* self) override;
|
||||
void OnUse(Entity* self, Entity* user) override;
|
||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||
};
|
||||
|
Reference in New Issue
Block a user