DarkflameServer/dScripts/PropertyFXDamage.cpp

19 lines
596 B
C++
Raw Normal View History

#include "PropertyFXDamage.h"
#include "DestroyableComponent.h"
#include "SkillComponent.h"
2022-07-28 13:39:57 +00:00
void PropertyFXDamage::OnCollisionPhantom(Entity* self, Entity* target) {
if (target == nullptr)
return;
2022-07-28 13:39:57 +00:00
auto* skills = self->GetComponent<SkillComponent>();
auto* targetStats = target->GetComponent<DestroyableComponent>();
2022-07-28 13:39:57 +00:00
if (skills != nullptr && targetStats != nullptr) {
auto targetFactions = targetStats->GetFactionIDs();
if (std::find(targetFactions.begin(), targetFactions.end(), 1) != targetFactions.end()) {
skills->CalculateBehavior(11386, 692, target->GetObjectID());
}
}
}