mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-08 11:44:11 +00:00
.github
cmake
dAuthServer
dChatFilter
dChatServer
dCommon
dDatabase
dGame
dMasterServer
dNavigation
dNet
dPhysics
dScripts
02_server
DLU
Enemy
Equipment
Map
AG
AgBugsprayer.cpp
AgBugsprayer.h
AgCagedBricksServer.cpp
AgCagedBricksServer.h
AgLaserSensorServer.cpp
AgLaserSensorServer.h
AgMonumentBirds.cpp
AgMonumentBirds.h
AgMonumentLaserServer.cpp
AgMonumentLaserServer.h
AgMonumentRaceCancel.cpp
AgMonumentRaceCancel.h
AgMonumentRaceGoal.cpp
AgMonumentRaceGoal.h
CMakeLists.txt
NpcAgCourseStarter.cpp
NpcAgCourseStarter.h
NpcCowboyServer.cpp
NpcCowboyServer.h
NpcEpsilonServer.cpp
NpcEpsilonServer.h
NpcNjAssistantServer.cpp
NpcNjAssistantServer.h
NpcPirateServer.cpp
NpcPirateServer.h
NpcWispServer.cpp
NpcWispServer.h
RemoveRentalGear.cpp
RemoveRentalGear.h
AG_Spider_Queen
AM
FV
GF
General
NS
NT
PR
Property
SS
VE
njhub
CMakeLists.txt
Minigame
Objects
Pets
CMakeLists.txt
EquipmentScripts
EquipmentTriggers
ai
client
zone
ActivityManager.cpp
ActivityManager.h
BaseConsoleTeleportServer.cpp
BaseConsoleTeleportServer.h
BasePropertyServer.cpp
BasePropertyServer.h
BaseRandomServer.cpp
BaseRandomServer.h
BaseSurvivalServer.cpp
BaseSurvivalServer.h
BaseWavesGenericEnemy.cpp
BaseWavesGenericEnemy.h
BaseWavesServer.cpp
BaseWavesServer.h
CMakeLists.txt
ChooseYourDestinationNsToNt.cpp
ChooseYourDestinationNsToNt.h
CppScripts.cpp
CppScripts.h
Darkitect.cpp
Darkitect.h
InvalidScript.cpp
InvalidScript.h
NPCAddRemoveItem.cpp
NPCAddRemoveItem.h
NtFactionSpyServer.cpp
NtFactionSpyServer.h
ScriptComponent.cpp
ScriptComponent.h
ScriptedPowerupSpawner.cpp
ScriptedPowerupSpawner.h
SpawnPetBaseServer.cpp
SpawnPetBaseServer.h
dServer
dWorldServer
dZoneManager
docs
migrations
resources
tests
thirdparty
vanity
.dockerignore
.editorconfig
.env.example
.git-blame-ignore-revs
.gitattributes
.gitignore
.gitmodules
CMakeLists.txt
CMakePresets.json
CMakeVariables.txt
CONTRIBUTING.md
Dockerfile
LICENSE
README.md
SECURITY.md
build.sh
docker-compose.yml
entrypoint.sh
logo.png
systemd.example
versions.txt

* Move EntityManager to Game namespace * move initialization to later Need to wait for dZoneManager to be initialized. * Fix bugs - Cannot delete from a RandomAccessIterator while in a range based for loop. Touchup zone manager initialize replace magic numbers with better named constants replace magic zonecontrol id with a more readable hex alternative condense stack variables move initializers closer to their use initialize entity manager with zone control change initialize timings If zone is not zero we expect to initialize the entity manager during zone manager initialization Add constexpr for zone control LOT * Add proper error handling * revert vanity changes * Update WorldServer.cpp * Update dZoneManager.cpp
37 lines
1.2 KiB
C++
37 lines
1.2 KiB
C++
#include "AgMonumentBirds.h"
|
|
#include "GameMessages.h"
|
|
#include "Entity.h"
|
|
#include "RenderComponent.h"
|
|
#include "EntityManager.h"
|
|
|
|
//--------------------------------------------------------------
|
|
//Makes the ag birds fly away when you get close and smashes them.
|
|
//Created mrb... 6 / 3 / 11
|
|
//Ported Max 20/07/2020
|
|
//--------------------------------------------------------------
|
|
|
|
void AgMonumentBirds::OnStartup(Entity* self) {
|
|
self->SetProximityRadius(flyRadius, "MonumentBirds");
|
|
}
|
|
|
|
void AgMonumentBirds::OnProximityUpdate(Entity* self, Entity* entering, std::string name, std::string status) {
|
|
if (self->GetVar<bool>(u"IsFlying")) return;
|
|
|
|
if (name == "MonumentBirds" && status == "ENTER") {
|
|
self->AddTimer("killBird", 1.0f);
|
|
RenderComponent::PlayAnimation(self, sOnProximityAnim);
|
|
self->SetVar<bool>(u"IsFlying", true);
|
|
self->SetVar<LWOOBJID>(u"PlayerID", entering->GetObjectID());
|
|
}
|
|
}
|
|
|
|
void AgMonumentBirds::OnTimerDone(Entity* self, std::string timerName) {
|
|
if (timerName != "killBird") return;
|
|
|
|
auto* player = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(u"PlayerID"));
|
|
|
|
if (player == nullptr) return;
|
|
|
|
self->ScheduleKillAfterUpdate(player);
|
|
}
|