MCPcopy Create free account
hub / github.com/Norbyte/ositools / OnStatusHitEnter

Method OnStatusHitEnter

OsiInterface/Functions/StatusFunctions.cpp:432–459  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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)

Callers

nothing calls this directly

Calls 4

FindGameObjectByHandleFunction · 0.85
FindCharacterByHandleFunction · 0.85
ThrowEventMethod · 0.80
AddMethod · 0.45

Tested by

no test coverage detected