mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-10-21 14:58:09 +00:00
Public release of the DLU server code!
Have fun!
This commit is contained in:
53
dScripts/QbEnemyStunner.cpp
Normal file
53
dScripts/QbEnemyStunner.cpp
Normal file
@@ -0,0 +1,53 @@
|
||||
#include "QbEnemyStunner.h"
|
||||
#include "EntityManager.h"
|
||||
#include "SkillComponent.h"
|
||||
#include "GameMessages.h"
|
||||
#include "DestroyableComponent.h"
|
||||
|
||||
void QbEnemyStunner::OnRebuildComplete(Entity* self, Entity* target)
|
||||
{
|
||||
auto* destroyable = self->GetComponent<DestroyableComponent>();
|
||||
|
||||
if (destroyable != nullptr)
|
||||
{
|
||||
destroyable->SetFaction(115);
|
||||
}
|
||||
|
||||
auto* skillComponent = self->GetComponent<SkillComponent>();
|
||||
|
||||
if (skillComponent != nullptr)
|
||||
{
|
||||
skillComponent->CalculateBehavior(499, 6095, LWOOBJID_EMPTY);
|
||||
}
|
||||
|
||||
self->AddTimer("TickTime", 1);
|
||||
|
||||
self->AddTimer("PlayEffect", 20);
|
||||
}
|
||||
|
||||
void QbEnemyStunner::OnTimerDone(Entity* self, std::string timerName)
|
||||
{
|
||||
if (timerName == "DieTime")
|
||||
{
|
||||
self->Smash();
|
||||
|
||||
self->CancelAllTimers();
|
||||
}
|
||||
else if (timerName == "PlayEffect")
|
||||
{
|
||||
self->SetNetworkVar(u"startEffect", 5.0f, UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
self->AddTimer("DieTime", 5.0f);
|
||||
}
|
||||
else if (timerName == "TickTime")
|
||||
{
|
||||
auto* skillComponent = self->GetComponent<SkillComponent>();
|
||||
|
||||
if (skillComponent != nullptr)
|
||||
{
|
||||
skillComponent->CalculateBehavior(499, 6095, LWOOBJID_EMPTY);
|
||||
}
|
||||
|
||||
self->AddTimer("TickTime", 1);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user