适用版本:全版本通用
更新时间:2024-12-16
文章编辑:雪舞
函数名称:LuaFnEquipLock
注册函数:LuaFnEquipLock
功能说明:对指定背包位置的装备进行刻铭
参数说明: ***付费内容***
相关函数:
检查道具是否被锁定:LuaFnLockCheck
IDA伪代码(地址:827BGA0):
int __cdecl LuaFnTbl::LuaFnEquipLock(lua_State *L)
{
int i; // ebx
long double v2; // fst7
Scene_3 *Scene; // ebx
Item *Item; // eax
const Item *v6; // esi
_ITEM *m_pItem; // eax
const _ITEM *v8; // eax
ItemContainer *Container; // eax
Packet *v10; // eax
int *v11; // eax
int v12; // edx
Packet *const v13; // eax
double v14; // [esp-Ch] [ebp-524h]
Obj_Human *pHuman; // [esp+Ch] [ebp-50Ch]
unsigned int itemIndex1; // [esp+10h] [ebp-508h]
unsigned int selfId; // [esp+14h] [ebp-504h]
SceneID_t sceneId; // [esp+18h] [ebp-500h]
Packets::GCItemInfo Msg; // [esp+30h] [ebp-4E8h] BYREF
CHAR msg[1048]; // [esp+100h] [ebp-418h] BYREF
for ( i = 1; i <= 3; ++i )
{
if ( L )
{
if ( lua_isnumber((lua_State_0 *)L, i) == 1 )
continue;
sub_804AC20(msg, 512, "ERROR: [%s]Param %d is illegal!", "LuaFnEquipLock", i);
}
else
{
sub_804AC20(msg, 512, "ERROR: [%s] Lua_State==NULL!", "LuaFnEquipLock");
}
CacheLog(3, msg);
}
sceneId = (__int16)lua_tonumber((lua_State_0 *)L, 1);
selfId = (int)lua_tonumber((lua_State_0 *)L, 2);
v2 = lua_tonumber((lua_State_0 *)L, 3);
itemIndex1 = (__int64)v2;
Scene = SceneManager::GetScene((SceneManager_1 *const)sceneId, SceneID);
if ( !Scene )
__assertex__(
"./Script/LuaFnTbl_Ability.h",
0x17B1u,
"int LuaFnTbl::LuaFnEquipLock(lua_State*)",
"pScene",
"Scene ID ErrorLuaFnEquipLock");
if ( ThreadValueManager::GetCurrentThreadID() != Scene->m_ThreadID )
__assertex__(
"./Script/LuaFnTbl_Ability.h",
0x17B1u,
"int LuaFnTbl::LuaFnEquipLock(lua_State*)",
"ThreadValueManager::GetCurrentThreadID()==pScene->m_ThreadID",
"ThreadValueManager::GetCurrentThreadID()==pScene->m_ThreadIDLuaFnEquipLock");
if ( selfId > 0x752F || (pHuman = (Obj_Human *)Scene->m_pObjManager->m_pObj[selfId]) == 0 )
__assertex__(
"./Script/LuaFnTbl_Ability.h",
0x17B1u,
"int LuaFnTbl::LuaFnEquipLock(lua_State*)",
"pObj",
"selfId ErrorLuaFnEquipLock");
if ( (*((int (__cdecl **)(Obj_Human *))pHuman->_vptr_Obj + 2))(pHuman) == 1 )
{
if ( !Obj_Human::IsCanLogic(pHuman) )
__assertex__(
"./Script/LuaFnTbl_Ability.h",
0x17B1u,
"int LuaFnTbl::LuaFnEquipLock(lua_State*)",
"pHuman->IsCanLogic()",
"IsCanLogic() test return falseLuaFnEquipLock");
Item = HumanItemLogic::GetItem(pHuman, (__int64)v2);
v6 = Item;
if ( !Item || Item::IsEmpty(Item) )
goto LABEL_25;
m_pItem = v6->m_pItem;
if ( !m_pItem )
__assert__("./Item/Item.inl", 0x2Du, "UCHAR Item::GetItemClass() const", "m_pItem");
if ( GetSerialClass(m_pItem->m_ItemIndex) != 1 || v6->m_bLock )
{
LABEL_25:
HIDWORD(v14) = -1073741824;
}
else
{
v8 = v6->m_pItem;
if ( !v8 )
__assert__("./Item/Item.inl", 0x250u, Item::GetItemLock(void)const::__PRETTY_FUNCTION__, "m_pItem");
if ( _ITEM::GetItemLock(v8) )
{
HIDWORD(v14) = -1073217536;
}
else
{
Container = HumanItemLogic::GetContainer(pHuman, itemIndex1);
v10 = (Packet *)ItemOperator::SetItemLock(&stru_CA04220, Container, itemIndex1);
if ( v10 )
{
Packet::Packet(v10);
Msg._vptr_Packet = (int (**)(...))off_841DB08;
Msg.m_ITEM.m_ItemGUID.m_Serial = 0;
Msg.m_ITEM.m_ItemGUID.m_Server = 0;
Msg.m_ITEM.m_ItemGUID.m_World = 0;
sub_804AD50((int)&Msg.m_ITEM, 0, 176);
Msg.m_ClientID = 0;
Item::SaveValueTo(v6, &Msg.m_ITEM);
Msg.m_BagIndex = (__int64)v2;
v11 = *(int **)&pHuman->m_PlayerID;
v12 = *v11;
Msg.m_nsNull = 0;
(*(void (__cdecl **)(int *, Packets::GCItemInfo *))(v12 + 12))(v11, &Msg);
lua_pushnumber((lua_State_0 *)L, 0.0);
Msg._vptr_Packet = (int (**)(...))off_841DB08;
Packet::~Packet(v13);
return 1;
}
HIDWORD(v14) = -1074790400;
}
}
LODWORD(v14) = 0;
lua_pushnumber((lua_State_0 *)L, v14);
}
else
{
lua_pushnumber((lua_State_0 *)L, -1.0);
}
return 1;
}
剩余 21% 内容需要支付 5.00
金币 后可完整阅读
支持付费阅读,激励作者创作更好的作品。