2021-12-05 17:54:36 +00:00
|
|
|
#include "SkillEventBehavior.h"
|
|
|
|
#include "BehaviorBranchContext.h"
|
|
|
|
#include "BehaviorContext.h"
|
|
|
|
#include "EntityManager.h"
|
|
|
|
#include "CppScripts.h"
|
|
|
|
|
|
|
|
void SkillEventBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitStream, BehaviorBranchContext branch) {
|
|
|
|
auto* target = EntityManager::Instance()->GetEntity(branch.target);
|
|
|
|
auto* caster = EntityManager::Instance()->GetEntity(context->originator);
|
|
|
|
|
|
|
|
if (caster != nullptr && target != nullptr && this->m_effectHandle != nullptr && !this->m_effectHandle->empty()) {
|
2023-06-14 03:01:51 +00:00
|
|
|
target->GetScript()->OnSkillEventFired(target, caster, *this->m_effectHandle);
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SkillEventBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* bitStream, BehaviorBranchContext branch) {
|
|
|
|
auto* target = EntityManager::Instance()->GetEntity(branch.target);
|
|
|
|
auto* caster = EntityManager::Instance()->GetEntity(context->originator);
|
|
|
|
|
|
|
|
if (caster != nullptr && target != nullptr && this->m_effectHandle != nullptr && !this->m_effectHandle->empty()) {
|
2023-06-14 03:01:51 +00:00
|
|
|
target->GetScript()->OnSkillEventFired(target, caster, *this->m_effectHandle);
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
}
|