mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-12-16 20:24:39 -06:00
Compare commits
3 Commits
poc-gm-imp
...
feat--medu
| Author | SHA1 | Date | |
|---|---|---|---|
| 43c18a2258 | |||
| 393c87e671 | |||
| f56f0a48fd |
@@ -804,6 +804,7 @@ void DestroyableComponent::SetFaction(int32_t factionID, bool ignoreChecks) {
|
||||
m_EnemyFactionIDs.clear();
|
||||
|
||||
AddFaction(factionID, ignoreChecks);
|
||||
Game::entityManager->SerializeEntity(m_Parent);
|
||||
}
|
||||
|
||||
void DestroyableComponent::SetStatusImmunity(
|
||||
|
||||
@@ -307,6 +307,12 @@
|
||||
#include "WildAndScared.h"
|
||||
#include "WildGfGlowbug.h"
|
||||
#include "WildAmbientCrab.h"
|
||||
#include "WildMedusa.h"
|
||||
#include "WildSnake01.h"
|
||||
#include "WildSnake02.h"
|
||||
#include "WildSnake03.h"
|
||||
#include "WildSnake04.h"
|
||||
#include "WildSnake05.h"
|
||||
#include "WildPants.h"
|
||||
#include "WildNinjaStudent.h"
|
||||
#include "WildNinjaSensei.h"
|
||||
@@ -921,6 +927,18 @@ CppScripts::Script* CppScripts::GetScript(Entity* parent, const std::string& scr
|
||||
script = new WildNinjaStudent();
|
||||
else if (scriptName == "scripts\\ai\\WILD\\L_WILD_NINJA_SENSEI.lua")
|
||||
script = new WildNinjaSensei();
|
||||
else if (scriptName == "scripts\\ai\\WILD\\L_WILD_MEDUSA.lua")
|
||||
script = new WildMedusa();
|
||||
else if (scriptName == "scripts\\ai\\WILD\\L_WILD_snake_01.lua")
|
||||
script = new WildSnake01();
|
||||
else if (scriptName == "scripts\\ai\\WILD\\L_WILD_snake_02.lua")
|
||||
script = new WildSnake02();
|
||||
else if (scriptName == "scripts\\ai\\WILD\\L_WILD_snake_03.lua")
|
||||
script = new WildSnake03();
|
||||
else if (scriptName == "scripts\\ai\\WILD\\L_WILD_snake_04.lua")
|
||||
script = new WildSnake04();
|
||||
else if (scriptName == "scripts\\ai\\WILD\\L_WILD_snake_05.lua")
|
||||
script = new WildSnake05();
|
||||
|
||||
// handle invalid script reporting if the path is greater than zero and it's not an ignored script
|
||||
// information not really needed for sys admins but is for developers
|
||||
|
||||
@@ -4,8 +4,14 @@ set(DSCRIPTS_SOURCES_AI_WILD
|
||||
"WildAmbientCrab.cpp"
|
||||
"WildAndScared.cpp"
|
||||
"WildGfGlowbug.cpp"
|
||||
"WildMedusa.cpp"
|
||||
"WildNinjaBricks.cpp"
|
||||
"WildNinjaStudent.cpp"
|
||||
"WildNinjaSensei.cpp"
|
||||
"WildPants.cpp"
|
||||
"WildSnake01.cpp"
|
||||
"WildSnake02.cpp"
|
||||
"WildSnake03.cpp"
|
||||
"WildSnake04.cpp"
|
||||
"WildSnake05.cpp"
|
||||
PARENT_SCOPE)
|
||||
|
||||
55
dScripts/ai/WILD/WildMedusa.cpp
Normal file
55
dScripts/ai/WILD/WildMedusa.cpp
Normal file
@@ -0,0 +1,55 @@
|
||||
#include "WildMedusa.h"
|
||||
#include "EntityInfo.h"
|
||||
#include "DestroyableComponent.h"
|
||||
#include "RenderComponent.h"
|
||||
|
||||
void WildMedusa::OnStartup(Entity* self) {
|
||||
self->AddTimer("SnakeStartup", 0.2);
|
||||
self->AddToGroup("snakesonaplane");
|
||||
|
||||
auto pos = self->GetPosition();
|
||||
|
||||
EntityInfo snake1{};
|
||||
snake1.lot = 6564;
|
||||
snake1.spawnerID = self->GetObjectID();
|
||||
snake1.pos = NiPoint3(pos.x, pos.y, pos.z + 5);
|
||||
auto* snake1_entity = Game::entityManager->CreateEntity(snake1);
|
||||
Game::entityManager->ConstructEntity(snake1_entity);
|
||||
|
||||
EntityInfo snake2{};
|
||||
snake2.lot = 6565;
|
||||
snake2.spawnerID = self->GetObjectID();
|
||||
snake2.pos = NiPoint3(pos.x, pos.y, pos.z - 5);
|
||||
auto* snake2_entity = Game::entityManager->CreateEntity(snake2);
|
||||
Game::entityManager->ConstructEntity(snake2_entity);
|
||||
|
||||
EntityInfo snake3{};
|
||||
snake3.lot = 6566;
|
||||
snake3.spawnerID = self->GetObjectID();
|
||||
snake3.pos = NiPoint3(pos.x + 5, pos.y, pos.z);
|
||||
auto* snake3_entity = Game::entityManager->CreateEntity(snake3);
|
||||
Game::entityManager->ConstructEntity(snake3_entity);
|
||||
|
||||
EntityInfo snake4{};
|
||||
snake4.lot = 6567;
|
||||
snake4.spawnerID = self->GetObjectID();
|
||||
snake4.pos = NiPoint3(pos.x - 5, pos.y, pos.z);
|
||||
auto* snake4_entity = Game::entityManager->CreateEntity(snake4);
|
||||
Game::entityManager->ConstructEntity(snake4_entity);
|
||||
|
||||
EntityInfo snake5{};
|
||||
snake5.lot = 6568;
|
||||
snake5.spawnerID = self->GetObjectID();
|
||||
snake5.pos = NiPoint3(pos.x + 5, pos.y, pos.z - 5);
|
||||
auto* snake5_entity = Game::entityManager->CreateEntity(snake5);
|
||||
Game::entityManager->ConstructEntity(snake5_entity);
|
||||
}
|
||||
|
||||
void WildMedusa:: OnNotifyObject(Entity* self, Entity* sender, const std::string& name, int32_t param1, int32_t param2) {
|
||||
if (name == "next5"){
|
||||
auto* destroyableComponent = self->GetComponent<DestroyableComponent>();
|
||||
if (destroyableComponent) destroyableComponent->SetFaction(4);
|
||||
auto* renderComponent = self->GetComponent<RenderComponent>();
|
||||
if (renderComponent) renderComponent->PlayEffect(634, u"medusa", "");
|
||||
}
|
||||
}
|
||||
8
dScripts/ai/WILD/WildMedusa.h
Normal file
8
dScripts/ai/WILD/WildMedusa.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
#include "CppScripts.h"
|
||||
|
||||
class WildMedusa : public CppScripts::Script {
|
||||
public:
|
||||
void OnStartup(Entity* self) override;
|
||||
void OnNotifyObject(Entity* self, Entity* sender, const std::string& name, int32_t param1, int32_t param2) override;
|
||||
};
|
||||
38
dScripts/ai/WILD/WildSnake01.cpp
Normal file
38
dScripts/ai/WILD/WildSnake01.cpp
Normal file
@@ -0,0 +1,38 @@
|
||||
#include "WildSnake01.h"
|
||||
#include "EntityManager.h"
|
||||
#include "DestroyableComponent.h"
|
||||
#include "RenderComponent.h"
|
||||
|
||||
void WildSnake01::OnStartup(Entity* self) {
|
||||
self->AddTimer("SnakeStartup",0.2f);
|
||||
self->AddTimer("SnakeFollow",0.3f);
|
||||
}
|
||||
|
||||
void WildSnake01::OnNotifyObject(Entity* self, Entity* sender, const std::string& name, int32_t param1, int32_t param2) {
|
||||
if (name == "next4"){
|
||||
auto* destroyableComponent = self->GetComponent<DestroyableComponent>();
|
||||
if (destroyableComponent) destroyableComponent->SetFaction(4);
|
||||
auto* renderComponent = self->GetComponent<RenderComponent>();
|
||||
if (renderComponent) renderComponent->PlayEffect(634, u"purple", "");
|
||||
}
|
||||
}
|
||||
|
||||
void WildSnake01::OnTimerDone(Entity* self, std::string timerName) {
|
||||
if (timerName == "SnakeStartup"){
|
||||
self->AddToGroup("snakesonaplane");
|
||||
} else if (timerName == "SnakeFollow") {
|
||||
auto snakes = Game::entityManager->GetEntitiesInGroup("snakesonaplane");
|
||||
for (const auto &snake : snakes) {
|
||||
if (snake && snake->GetLOT() == 6602){
|
||||
// self:FollowTarget { targetID = friends[i], radius = 4.5, speed = 1, keepFollowing = true }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void WildSnake01::OnDie(Entity* self, Entity* killer) {
|
||||
auto snakes = Game::entityManager->GetEntitiesInGroup("snakesonaplane");
|
||||
for (const auto &snake : snakes) {
|
||||
if (snake) snake->NotifyObject(self, "next5");
|
||||
}
|
||||
}
|
||||
10
dScripts/ai/WILD/WildSnake01.h
Normal file
10
dScripts/ai/WILD/WildSnake01.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include "CppScripts.h"
|
||||
|
||||
class WildSnake01 : public CppScripts::Script {
|
||||
public:
|
||||
void OnStartup(Entity* self) override;
|
||||
void OnNotifyObject(Entity* self, Entity* sender, const std::string& name, int32_t param1, int32_t param2) override;
|
||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||
void OnDie(Entity* self, Entity* killer) override;
|
||||
};
|
||||
38
dScripts/ai/WILD/WildSnake02.cpp
Normal file
38
dScripts/ai/WILD/WildSnake02.cpp
Normal file
@@ -0,0 +1,38 @@
|
||||
#include "WildSnake02.h"
|
||||
#include "EntityManager.h"
|
||||
#include "DestroyableComponent.h"
|
||||
#include "RenderComponent.h"
|
||||
|
||||
void WildSnake02::OnStartup(Entity* self) {
|
||||
self->AddTimer("SnakeStartup",0.2f);
|
||||
self->AddTimer("SnakeFollow",0.3f);
|
||||
}
|
||||
|
||||
void WildSnake02::OnNotifyObject(Entity* self, Entity* sender, const std::string& name, int32_t param1, int32_t param2) {
|
||||
if (name == "next3"){
|
||||
auto* destroyableComponent = self->GetComponent<DestroyableComponent>();
|
||||
if (destroyableComponent) destroyableComponent->SetFaction(4);
|
||||
auto* renderComponent = self->GetComponent<RenderComponent>();
|
||||
if (renderComponent) renderComponent->PlayEffect(634, u"blue", "");
|
||||
}
|
||||
}
|
||||
|
||||
void WildSnake02::OnTimerDone(Entity* self, std::string timerName) {
|
||||
if (timerName == "SnakeStartup"){
|
||||
self->AddToGroup("snakesonaplane");
|
||||
} else if (timerName == "SnakeFollow") {
|
||||
auto snakes = Game::entityManager->GetEntitiesInGroup("snakesonaplane");
|
||||
for (const auto &snake : snakes) {
|
||||
if (snake && snake->GetLOT() == 6564){
|
||||
// self:FollowTarget { targetID = friends[i], radius = 4.5, speed = 1, keepFollowing = true }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void WildSnake02::OnDie(Entity* self, Entity* killer) {
|
||||
auto snakes = Game::entityManager->GetEntitiesInGroup("snakesonaplane");
|
||||
for (const auto &snake : snakes) {
|
||||
if (snake) snake->NotifyObject(self, "next4");
|
||||
}
|
||||
}
|
||||
10
dScripts/ai/WILD/WildSnake02.h
Normal file
10
dScripts/ai/WILD/WildSnake02.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include "CppScripts.h"
|
||||
|
||||
class WildSnake02 : public CppScripts::Script {
|
||||
public:
|
||||
void OnStartup(Entity* self) override;
|
||||
void OnNotifyObject(Entity* self, Entity* sender, const std::string& name, int32_t param1, int32_t param2) override;
|
||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||
void OnDie(Entity* self, Entity* killer) override;
|
||||
};
|
||||
38
dScripts/ai/WILD/WildSnake03.cpp
Normal file
38
dScripts/ai/WILD/WildSnake03.cpp
Normal file
@@ -0,0 +1,38 @@
|
||||
#include "WildSnake03.h"
|
||||
#include "EntityManager.h"
|
||||
#include "DestroyableComponent.h"
|
||||
#include "RenderComponent.h"
|
||||
|
||||
void WildSnake03::OnStartup(Entity* self) {
|
||||
self->AddTimer("SnakeStartup",0.2f);
|
||||
self->AddTimer("SnakeFollow",0.3f);
|
||||
}
|
||||
|
||||
void WildSnake03::OnNotifyObject(Entity* self, Entity* sender, const std::string& name, int32_t param1, int32_t param2) {
|
||||
if (name == "next2"){
|
||||
auto* destroyableComponent = self->GetComponent<DestroyableComponent>();
|
||||
if (destroyableComponent) destroyableComponent->SetFaction(4);
|
||||
auto* renderComponent = self->GetComponent<RenderComponent>();
|
||||
if (renderComponent) renderComponent->PlayEffect(634, u"green", "");
|
||||
}
|
||||
}
|
||||
|
||||
void WildSnake03::OnTimerDone(Entity* self, std::string timerName) {
|
||||
if (timerName == "SnakeStartup"){
|
||||
self->AddToGroup("snakesonaplane");
|
||||
} else if (timerName == "SnakeFollow") {
|
||||
auto snakes = Game::entityManager->GetEntitiesInGroup("snakesonaplane");
|
||||
for (const auto &snake : snakes) {
|
||||
if (snake && snake->GetLOT() == 6565){
|
||||
// self:FollowTarget { targetID = friends[i], radius = 4.5, speed = 1, keepFollowing = true }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void WildSnake03::OnDie(Entity* self, Entity* killer) {
|
||||
auto snakes = Game::entityManager->GetEntitiesInGroup("snakesonaplane");
|
||||
for (const auto &snake : snakes) {
|
||||
if (snake) snake->NotifyObject(self, "next3");
|
||||
}
|
||||
}
|
||||
10
dScripts/ai/WILD/WildSnake03.h
Normal file
10
dScripts/ai/WILD/WildSnake03.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include "CppScripts.h"
|
||||
|
||||
class WildSnake03 : public CppScripts::Script {
|
||||
public:
|
||||
void OnStartup(Entity* self) override;
|
||||
void OnNotifyObject(Entity* self, Entity* sender, const std::string& name, int32_t param1, int32_t param2) override;
|
||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||
void OnDie(Entity* self, Entity* killer) override;
|
||||
};
|
||||
38
dScripts/ai/WILD/WildSnake04.cpp
Normal file
38
dScripts/ai/WILD/WildSnake04.cpp
Normal file
@@ -0,0 +1,38 @@
|
||||
#include "WildSnake04.h"
|
||||
#include "EntityManager.h"
|
||||
#include "DestroyableComponent.h"
|
||||
#include "RenderComponent.h"
|
||||
|
||||
void WildSnake04::OnStartup(Entity* self) {
|
||||
self->AddTimer("SnakeStartup",0.2f);
|
||||
self->AddTimer("SnakeFollow",0.3f);
|
||||
}
|
||||
|
||||
void WildSnake04::OnNotifyObject(Entity* self, Entity* sender, const std::string& name, int32_t param1, int32_t param2) {
|
||||
if (name == "next1"){
|
||||
auto* destroyableComponent = self->GetComponent<DestroyableComponent>();
|
||||
if (destroyableComponent) destroyableComponent->SetFaction(4);
|
||||
auto* renderComponent = self->GetComponent<RenderComponent>();
|
||||
if (renderComponent) renderComponent->PlayEffect(634, u"yellow", "");
|
||||
}
|
||||
}
|
||||
|
||||
void WildSnake04::OnTimerDone(Entity* self, std::string timerName) {
|
||||
if (timerName == "SnakeStartup"){
|
||||
self->AddToGroup("snakesonaplane");
|
||||
} else if (timerName == "SnakeFollow") {
|
||||
auto snakes = Game::entityManager->GetEntitiesInGroup("snakesonaplane");
|
||||
for (const auto &snake : snakes) {
|
||||
if (snake && snake->GetLOT() == 6566){
|
||||
// self:FollowTarget { targetID = friends[i], radius = 4.5, speed = 1, keepFollowing = true }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void WildSnake04::OnDie(Entity* self, Entity* killer) {
|
||||
auto snakes = Game::entityManager->GetEntitiesInGroup("snakesonaplane");
|
||||
for (const auto &snake : snakes) {
|
||||
if (snake) snake->NotifyObject(self, "next2");
|
||||
}
|
||||
}
|
||||
10
dScripts/ai/WILD/WildSnake04.h
Normal file
10
dScripts/ai/WILD/WildSnake04.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include "CppScripts.h"
|
||||
|
||||
class WildSnake04 : public CppScripts::Script {
|
||||
public:
|
||||
void OnStartup(Entity* self) override;
|
||||
void OnNotifyObject(Entity* self, Entity* sender, const std::string& name, int32_t param1, int32_t param2) override;
|
||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||
void OnDie(Entity* self, Entity* killer) override;
|
||||
};
|
||||
35
dScripts/ai/WILD/WildSnake05.cpp
Normal file
35
dScripts/ai/WILD/WildSnake05.cpp
Normal file
@@ -0,0 +1,35 @@
|
||||
#include "WildSnake05.h"
|
||||
#include "EntityManager.h"
|
||||
#include "DestroyableComponent.h"
|
||||
#include "RenderComponent.h"
|
||||
|
||||
void WildSnake05::OnStartup(Entity* self) {
|
||||
self->AddTimer("SnakeStartup",0.2f);
|
||||
self->AddTimer("SnakeFollow",0.3f);
|
||||
self->AddTimer("SnakeGlow",2.0f);
|
||||
}
|
||||
|
||||
void WildSnake05::OnTimerDone(Entity* self, std::string timerName) {
|
||||
if (timerName == "SnakeStartup"){
|
||||
self->AddToGroup("snakesonaplane");
|
||||
auto* destroyableComponent = self->GetComponent<DestroyableComponent>();
|
||||
if (destroyableComponent) destroyableComponent->SetFaction(4);
|
||||
} else if (timerName == "SnakeFollow") {
|
||||
auto snakes = Game::entityManager->GetEntitiesInGroup("snakesonaplane");
|
||||
for (const auto &snake : snakes) {
|
||||
if (snake && snake->GetLOT() == 6566){
|
||||
// self:FollowTarget { targetID = friends[i], radius = 4.5, speed = 1, keepFollowing = true }
|
||||
}
|
||||
}
|
||||
} else if (timerName == "SnakeGlow") {
|
||||
auto* renderComponent = self->GetComponent<RenderComponent>();
|
||||
if (renderComponent) renderComponent->PlayEffect(634, u"red", "");
|
||||
}
|
||||
}
|
||||
|
||||
void WildSnake05::OnDie(Entity* self, Entity* killer) {
|
||||
auto snakes = Game::entityManager->GetEntitiesInGroup("snakesonaplane");
|
||||
for (const auto &snake : snakes) {
|
||||
if (snake) snake->NotifyObject(self, "next1");
|
||||
}
|
||||
}
|
||||
9
dScripts/ai/WILD/WildSnake05.h
Normal file
9
dScripts/ai/WILD/WildSnake05.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
#include "CppScripts.h"
|
||||
|
||||
class WildSnake05 : public CppScripts::Script {
|
||||
public:
|
||||
void OnStartup(Entity* self) override;
|
||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||
void OnDie(Entity* self, Entity* killer) override;
|
||||
};
|
||||
1
thirdparty/magic_enum
vendored
Submodule
1
thirdparty/magic_enum
vendored
Submodule
Submodule thirdparty/magic_enum added at e26b05e0a0
Reference in New Issue
Block a user