|
21 | 21 | #include <Services/PapyrusService.h> |
22 | 22 |
|
23 | 23 | #include <Forms/ActorValueInfo.h> |
| 24 | +#include <Forms/TESRace.h> |
24 | 25 |
|
25 | 26 | #include <Effects/ValueModifierEffect.h> |
26 | 27 |
|
@@ -579,12 +580,58 @@ void Actor::Reset() noexcept |
579 | 580 | s_pReset(this, 0, nullptr); |
580 | 581 | } |
581 | 582 |
|
| 583 | +bool Actor::PlayIdle(TESIdleForm* apIdle) noexcept |
| 584 | +{ |
| 585 | + PAPYRUS_FUNCTION(bool, Actor, PlayIdle, TESIdleForm*); |
| 586 | + return s_pPlayIdle(this, apIdle); |
| 587 | +} |
| 588 | + |
582 | 589 | void Actor::Respawn() noexcept |
583 | 590 | { |
584 | 591 | Resurrect(false); |
585 | 592 | Reset(); |
586 | 593 | } |
587 | 594 |
|
| 595 | +bool Actor::IsVampireLord() const noexcept |
| 596 | +{ |
| 597 | + return race && race->formID == 0x200283A; |
| 598 | +} |
| 599 | + |
| 600 | +extern thread_local bool g_forceAnimation; |
| 601 | + |
| 602 | +void Actor::FixVampireLordModel() noexcept |
| 603 | +{ |
| 604 | + TESBoundObject* pObject = Cast<TESBoundObject>(TESForm::GetById(0x2011a84)); |
| 605 | + if (!pObject) |
| 606 | + return; |
| 607 | + |
| 608 | + { |
| 609 | + ScopedInventoryOverride _; |
| 610 | + AddObjectToContainer(pObject, nullptr, 1, nullptr); |
| 611 | + } |
| 612 | + |
| 613 | + EquipManager::Get()->Equip(this, pObject, nullptr, 1, nullptr, false, true, false, false); |
| 614 | + |
| 615 | + g_forceAnimation = true; |
| 616 | + |
| 617 | + BSFixedString str("isLevitating"); |
| 618 | + uint32_t isLevitating = GetAnimationVariableInt(&str); |
| 619 | + spdlog::critical("isLevitating {}", isLevitating); |
| 620 | + |
| 621 | + // By default, a loaded vampire lord is not levitating. |
| 622 | + if (isLevitating) |
| 623 | + { |
| 624 | + BSFixedString levitation("LevitationToggle"); |
| 625 | + SendAnimationEvent(&levitation); |
| 626 | + } |
| 627 | + |
| 628 | + // TODO: weapon draw code does not seem to take care of this |
| 629 | + //BSFixedString weapEquip("WeapEquip"); |
| 630 | + //SendAnimationEvent(&weapEquip); |
| 631 | + |
| 632 | + g_forceAnimation = false; |
| 633 | +} |
| 634 | + |
588 | 635 | TP_THIS_FUNCTION(TForceState, void, Actor, const NiPoint3&, float, float, TESObjectCELL*, TESWorldSpace*, bool); |
589 | 636 | static TForceState* RealForceState = nullptr; |
590 | 637 |
|
|
0 commit comments