Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef BGSEquipSlot * (* _GetEitherHandSlot)();
- _GetEitherHandSlot GetEitherHandSlot = (_GetEitherHandSlot)0x0054BD70;
- typedef BGSEquipSlot * (* _GetRightHandSlot)();
- _GetRightHandSlot GetRightHandSlot = (_GetRightHandSlot)0x0054BD40;
- typedef BGSEquipSlot * (* _GetLeftHandSlot)();
- _GetLeftHandSlot GetLeftHandSlot = (_GetLeftHandSlot)0x0049D0D0;
- typedef UInt8 (__stdcall * _HasItemInHand)(Character * actor, TESForm * baseForm, BGSEquipSlot * equipSlot);
- _HasItemInHand HasItemInHand = (_HasItemInHand)0x006EDC60;
- typedef BGSEquipType * (* _GetEquipType)(TESForm * baseForm);
- _GetEquipType GetEquipType = (_GetEquipType)0x0044AE60;
- class EquipManager
- {
- public:
- virtual ~EquipManager();
- MEMBER_FN_PREFIX(EquipManager);
- DEFINE_MEMBER_FN(doEquipItem, void, 0x006EEEB0, Character * actor, TESForm * baseForm, BaseExtraList * extraData, UInt32 unkFlag1, BGSEquipSlot * equipSlot, UInt8 bEquipSound, UInt8 bNoRemove, UInt8 bShowMsg, UInt8 unkFlag3);
- static EquipManager * GetSingleton(void)
- {
- return *((EquipManager **)0x012E51AC);
- }
- };
- // Papyrus EquipItem 8DCCA0
- // Inventory EquipItem 6EF2F0
- // Has3D (TESForm::Unk_27)
- BGSEquipSlot * equipSlot = NULL;
- BGSEquipSlot * destinationSlot = GetLeftHandSlot();
- TESForm * ironMace = LookupFormByID(0x13982);
- BGSEquipType * equipType = GetEquipType(ironMace);
- if(equipType) {
- equipSlot = equipType->GetEquipSlot();
- }
- bool has3D = ironMace->Has3D();
- UInt8 hasEquip = HasItemInHand(actor, ironMace, equipSlot);
- bool eitherHand = (equipSlot == GetEitherHandSlot());
- // Conditions to check:
- // - Form isn't None
- // - Form has 3D
- // - Form is in Container
- // - If player has this exact item equip already, skip enchant
- if(has3D)
- CALL_MEMBER_FN(EquipManager::GetSingleton(), doEquipItem)(actor, ironMace, NULL, 1, destinationSlot, 0, 0, 0, 0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement