mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-05 18:24:12 +00:00
feat: move all ldf config to be in xml (#1482)
* feat: move all ldf config to be in xml cleanup dev-tribute.xml add comments to atm.xml remove custom script tag in favor of ldfconfig for it * replace sto* calls with tryParse's * remove unesessary .has_value() calls and check for null_lot * remove member variable naming that on on-member vars * move max's vendor inventory to be configurable via vanity * Consolidate triplecated vendor code * don't write name if one is not given * Updates to vanity xml's and demo for later docs * rename vars
This commit is contained in:
@@ -5,20 +5,17 @@
|
||||
#include "RenderComponent.h"
|
||||
|
||||
void DLUVanityTeleportingObject::OnStartup(Entity* self) {
|
||||
if (!self->HasVar(u"npcName") || !self->HasVar(u"teleport")) return;
|
||||
m_Object = VanityUtilities::GetObject(self->GetVarAsString(u"npcName"));
|
||||
if (!self->HasVar(u"npcName")) return;
|
||||
|
||||
m_Object = VanityUtilities::GetObject(self->GetVarAsString(u"npcName"));
|
||||
if (!m_Object) return;
|
||||
if (self->HasVar(u"teleportInterval")) m_TeleportInterval = self->GetVar<float>(u"teleportInterval");
|
||||
|
||||
if (self->GetVar<bool>(u"teleport")) {
|
||||
self->AddTimer("setupTeleport", m_TeleportInterval);
|
||||
}
|
||||
self->AddTimer("setupTeleport", m_TeleportInterval);
|
||||
}
|
||||
|
||||
void DLUVanityTeleportingObject::OnTimerDone(Entity* self, std::string timerName) {
|
||||
if (timerName == "setupTeleport") {
|
||||
RenderComponent::PlayAnimation(self, u"interact");
|
||||
GameMessages::SendPlayFXEffect(self->GetObjectID(), 6478, u"teleportBeam", "teleportBeam");
|
||||
GameMessages::SendPlayFXEffect(self->GetObjectID(), 6478, u"teleportRings", "teleportRings");
|
||||
|
||||
@@ -40,7 +37,6 @@ void DLUVanityTeleportingObject::OnTimerDone(Entity* self, std::string timerName
|
||||
|
||||
self->SetPosition(newLocation.m_Position);
|
||||
self->SetRotation(newLocation.m_Rotation);
|
||||
self->SetScale(newLocation.m_Scale);
|
||||
GameMessages::SendPlayFXEffect(self->GetObjectID(), 6478, u"teleportBeam", "teleportBeam");
|
||||
GameMessages::SendPlayFXEffect(self->GetObjectID(), 6478, u"teleportRings", "teleportRings");
|
||||
self->AddTimer("stopFX", 2.0f);
|
||||
|
Reference in New Issue
Block a user