#include "UnionAfx.h"
namespace Gothic_I_Classic {
static void __fastcall Npc_Unarchive(oCNpc* _this, void* vt, zCArchiver& ar);
static CInvoke <void(__thiscall*)(oCNpc*, zCArchiver&)> pNpc_Unarchive(0x006A31E0, Npc_Unarchive, Union.GetEngineVersion() == TEngineVersion::Engine_G1 ? IVK_AUTO : IVK_DISABLED);
static void __fastcall Npc_Unarchive(oCNpc* _this, void* vt, zCArchiver& ar)
{
pNpc_Unarchive(_this, ar);
if (_this && (_this->guild == NPC_GIL_GOBBO || _this->guild == NPC_GIL_SKELETON) && _this->attribute[NPC_ATR_HITPOINTS] == 0)
{
zCModel* pModel = _this->GetModel();
if (!pModel) return;
zCModelNodeInst* pNodeInst = pModel->SearchNode(NPC_NODE_RIGHTHAND);
if (!pNodeInst) return;
pModel->SetNodeVisual(pNodeInst, NULL, FALSE);
}
}
}
namespace Gothic_I_Addon {
static void __fastcall Npc_Unarchive(oCNpc* _this, void* vt, zCArchiver& ar);
static CInvoke <void(__thiscall*)(oCNpc*, zCArchiver&)> pNpc_Unarchive(0x006D5AD0, Npc_Unarchive, Union.GetEngineVersion() == TEngineVersion::Engine_G1A ? IVK_AUTO : IVK_DISABLED);
static void __fastcall Npc_Unarchive(oCNpc* _this, void* vt, zCArchiver& ar)
{
pNpc_Unarchive(_this, ar);
if (_this && (_this->guild == NPC_GIL_GOBBO || _this->guild == NPC_GIL_SKELETON) && _this->attribute[NPC_ATR_HITPOINTS] == 0)
{
zCModel* pModel = _this->GetModel();
if (!pModel)
return;
zCModelNodeInst* pNodeInst = pModel->SearchNode(NPC_NODE_RIGHTHAND);
if (!pNodeInst)
return;
pModel->SetNodeVisual(pNodeInst, NULL, FALSE);
}
}
}
namespace Gothic_II_Classic {
static void __fastcall Npc_Unarchive(oCNpc* _this, void* vt, zCArchiver& ar);
static CInvoke <void(__thiscall*)(oCNpc*, zCArchiver&)> pNpc_Unarchive(0x006E8790, Npc_Unarchive, Union.GetEngineVersion() == TEngineVersion::Engine_G2 ? IVK_AUTO : IVK_DISABLED);
static void __fastcall Npc_Unarchive(oCNpc* _this, void* vt, zCArchiver& ar)
{
pNpc_Unarchive(_this, ar);
if (_this && (_this->guild == NPC_GIL_GOBBO || _this->guild == NPC_GIL_GOBBO_SKELETON || _this->guild == NPC_GIL_SUMMONED_GOBBO_SKELETON) && _this->attribute[NPC_ATR_HITPOINTS] == 0)
{
zCModel* pModel = _this->GetModel();
if (!pModel)
return;
zCModelNodeInst* pNodeInst = NULL;
for(int i = 0; i < pModel->nodeList.GetNum(); i++)
{
if (pModel->nodeList[i]->protoNode)
{
string nodeName = pModel->nodeList[i]->protoNode->nodeName;
if (nodeName.Compare(NPC_NODE_RIGHTHAND))
{
pNodeInst = pModel->nodeList[i];
break;
}
}
}
if (!pNodeInst)
return;
pModel->SetNodeVisual(pNodeInst, NULL, FALSE);
}
}
}
namespace Gothic_II_Addon {
static void __fastcall Npc_Unarchive(oCNpc* _this, void* vt, zCArchiver& ar);
static CInvoke <void(__thiscall*)(oCNpc*, zCArchiver&)> pNpc_Unarchive(0x00747230, Npc_Unarchive, Union.GetEngineVersion() == TEngineVersion::Engine_G2A ? IVK_AUTO : IVK_DISABLED);
static void __fastcall Npc_Unarchive(oCNpc* _this, void* vt, zCArchiver& ar)
{
pNpc_Unarchive(_this, ar);
if (_this && (_this->guild == NPC_GIL_GOBBO || _this->guild == NPC_GIL_GOBBO_SKELETON || _this->guild == NPC_GIL_SUMMONED_GOBBO_SKELETON) && _this->attribute[NPC_ATR_HITPOINTS] == 0)
{
zCModel* pModel = _this->GetModel();
if (!pModel)
return;
zCModelNodeInst* pNodeInst = pModel->SearchNode(NPC_NODE_RIGHTHAND);
if (!pNodeInst)
return;
pModel->SetNodeVisual(pNodeInst, NULL, FALSE);
}
}
}