21
Archiwum / [G2NK] Revisioned
« dnia: 2020-07-27, 11:44 »No to najwidoczniej muszę to dopisać do TODONiech stracę.
Kod: [Zaznacz]
// Remove key on open chest:
// 0x00726500 protected: virtual void __thiscall oCMobContainer::Open(class oCNpc *)
// 0x0071A430 protected: virtual void __thiscall oCMobDoor::Open(class oCNpc *)
void __fastcall hOpen_Container(oCMobContainer*, void*, oCNpc*);
void __fastcall hOpen_Door(oCMobDoor*, void*, oCNpc*);
CInvoke<void(__thiscall*)(oCMobContainer*, oCNpc*)> pOben_Container(0x00726500, hOpen_Container, IVK_AUTO);
CInvoke<void(__thiscall*)(oCMobDoor*, oCNpc*)> pOpen_Door(0x0071A430, hOpen_Door, IVK_AUTO);
void __fastcall hOpen_Container(oCMobContainer* _this, void*, oCNpc* npc)
{
pOben_Container(_this, npc);
if (!_this->locked && !_this->keyInstance.IsEmpty())
if (oCItem* key = npc->IsInInv(_this->keyInstance, 1))
npc->RemoveFromInv(key, key->amount);
}
void __fastcall hOpen_Door(oCMobDoor* _this, void*, oCNpc* npc)
{
pOpen_Door(_this, npc);
if (!_this->locked && !_this->keyInstance.IsEmpty())
if (oCItem* key = npc->IsInInv(_this->keyInstance, 1))
npc->RemoveFromInv(key, key->amount);
}