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

Method OnStatusHealEnter

OsiInterface/Functions/StatusFunctions.cpp:462–486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

460
461
462 void CustomFunctionLibrary::OnStatusHealEnter(esv::Status * status)
463 {
464 auto statusHeal = static_cast<esv::StatusHeal *>(status);
465
466 auto target = FindCharacterByHandle(status->TargetCIHandle);
467 if (target == nullptr) {
468 OsiError("Status has no target?");
469 return;
470 }
471
472 char const * sourceGuid = "NULL_00000000-0000-0000-0000-000000000000";
473 auto source = FindCharacterByHandle(status->StatusSourceHandle);
474 if (source != nullptr) {
475 sourceGuid = source->GetGuid()->Str;
476 }
477
478 auto eventArgs = OsiArgumentDesc::Create(OsiArgumentValue{ ValueType::GuidString, target->GetGuid()->Str });
479 eventArgs->Add(OsiArgumentValue{ ValueType::GuidString, sourceGuid });
480 eventArgs->Add(OsiArgumentValue{ (int32_t)statusHeal->HealAmount });
481 eventArgs->Add(OsiArgumentValue{ (int64_t)status->StatusHandle });
482
483 gOsirisProxy->GetCustomFunctionInjector().ThrowEvent(HealEventHandle, eventArgs);
484
485 delete eventArgs;
486 }
487
488
489 void CustomFunctionLibrary::OnCharacterHit(esv::Character__Hit wrappedHit, esv::Character * self, CDivinityStats_Character * attackerStats,

Callers

nothing calls this directly

Calls 3

FindCharacterByHandleFunction · 0.85
ThrowEventMethod · 0.80
AddMethod · 0.45

Tested by

no test coverage detected