| 430 | |
| 431 | |
| 432 | void CustomFunctionLibrary::OnStatusHitEnter(esv::Status * status) |
| 433 | { |
| 434 | auto statusHit = static_cast<esv::StatusHit *>(status); |
| 435 | if (statusHit->DamageInfo.EffectFlags & HitFlag::HF_NoEvents) { |
| 436 | return; |
| 437 | } |
| 438 | |
| 439 | auto target = FindGameObjectByHandle(status->TargetCIHandle); |
| 440 | if (target == nullptr) { |
| 441 | OsiError("Status has no target?"); |
| 442 | return; |
| 443 | } |
| 444 | |
| 445 | char const * sourceGuid = "NULL_00000000-0000-0000-0000-000000000000"; |
| 446 | auto source = FindCharacterByHandle(status->StatusSourceHandle); |
| 447 | if (source != nullptr) { |
| 448 | sourceGuid = source->GetGuid()->Str; |
| 449 | } |
| 450 | |
| 451 | auto eventArgs = OsiArgumentDesc::Create(OsiArgumentValue{ ValueType::GuidString, target->GetGuid()->Str }); |
| 452 | eventArgs->Add(OsiArgumentValue{ ValueType::GuidString, sourceGuid }); |
| 453 | eventArgs->Add(OsiArgumentValue{ (int32_t)statusHit->DamageInfo.TotalDamageDone }); |
| 454 | eventArgs->Add(OsiArgumentValue{ (int64_t)status->StatusHandle }); |
| 455 | |
| 456 | gOsirisProxy->GetCustomFunctionInjector().ThrowEvent(HitEventHandle, eventArgs); |
| 457 | |
| 458 | delete eventArgs; |
| 459 | } |
| 460 | |
| 461 | |
| 462 | void CustomFunctionLibrary::OnStatusHealEnter(esv::Status * status) |
nothing calls this directly
no test coverage detected