适用版本:全版本通用
更新时间:2024-12-16
文章编辑:雪舞
函数名称:LuaFnLockCheck
注册函数:LuaFnLockCheck
功能说明:对指定背包位置的道具是否被锁定、刻铭
参数说明: ***付费内容***
IDA伪代码(地址:827B750):
int __cdecl LuaFnTbl::LuaFnLockCheck(lua_State *L)
{
int i; // ebx
unsigned int v2; // esi
long double v3; // fst7
Scene_3 *Scene; // ebx
Obj_Human *v5; // esi
Item *Item; // eax
Item *v8; // ebx
const _ITEM *m_pItem; // eax
int Money; // ebx
SceneManager_1 *const v11; // [esp-10h] [ebp-458h]
double v12; // [esp-Ch] [ebp-454h]
UINT uBagIndex[2]; // [esp+8h] [ebp-440h]
CHAR msg[1048]; // [esp+30h] [ebp-418h] BYREF
for ( i = 1; i <= 4; ++i )
{
if ( L )
{
if ( lua_isnumber((lua_State_0 *)L, i) == 1 )
continue;
sub_804AC20(msg, 512, "ERROR: [%s]Param %d is illegal!", "LuaFnLockCheck", i);
}
else
{
sub_804AC20(msg, 512, "ERROR: [%s] Lua_State==NULL!", "LuaFnLockCheck");
}
CacheLog(3, msg);
}
lua_tonumber((lua_State_0 *)L, 1);
v2 = (int)lua_tonumber((lua_State_0 *)L, 2);
*(_QWORD *)uBagIndex = (__int64)lua_tonumber((lua_State_0 *)L, 3);
v3 = lua_tonumber((lua_State_0 *)L, 4);
Scene = SceneManager::GetScene(v11, SceneID);
if ( !Scene )
__assertex__(
"./Script/LuaFnTbl_Ability.h",
0x1721u,
"int LuaFnTbl::LuaFnLockCheck(lua_State*)",
"pScene",
"Scene ID ErrorLuaFnLockCheck");
if ( ThreadValueManager::GetCurrentThreadID() != Scene->m_ThreadID )
__assertex__(
"./Script/LuaFnTbl_Ability.h",
0x1721u,
"int LuaFnTbl::LuaFnLockCheck(lua_State*)",
"ThreadValueManager::GetCurrentThreadID()==pScene->m_ThreadID",
"ThreadValueManager::GetCurrentThreadID()==pScene->m_ThreadIDLuaFnLockCheck");
if ( v2 > 0x752F || (v5 = (Obj_Human *)Scene->m_pObjManager->m_pObj[v2]) == 0 )
__assertex__(
"./Script/LuaFnTbl_Ability.h",
0x1721u,
"int LuaFnTbl::LuaFnLockCheck(lua_State*)",
"pObj",
"selfId ErrorLuaFnLockCheck");
if ( (*((int (__cdecl **)(Obj_Human *))v5->_vptr_Obj + 2))(v5) == 1 )
{
if ( !Obj_Human::IsCanLogic(v5) )
__assertex__(
"./Script/LuaFnTbl_Ability.h",
0x1721u,
"int LuaFnTbl::LuaFnLockCheck(lua_State*)",
"pHuman->IsCanLogic()",
"IsCanLogic() test return falseLuaFnLockCheck");
Item = HumanItemLogic::GetItem(v5, uBagIndex[0]);
v8 = Item;
if ( !Item || Item::IsEmpty(Item) || v8->m_bLock )
{
HIDWORD(v12) = -1073741824;
}
else
{
m_pItem = v8->m_pItem;
if ( !m_pItem )
__assert__("./Item/Item.inl", 0x250u, Item::GetItemLock(void)const::__PRETTY_FUNCTION__, "m_pItem");
if ( _ITEM::GetItemLock(m_pItem) )
{
HIDWORD(v12) = -1073217536;
}
else
{
Money = Obj_Human::GetMoney(v5);
if ( Money + Obj_Human::GetMoneyJZ(v5) >= (unsigned int)(__int64)v3 )
HIDWORD(v12) = 0;
else
HIDWORD(v12) = -1072693248;
}
}
LODWORD(v12) = 0;
lua_pushnumber((lua_State_0 *)L, v12);
}
else
{
lua_pushnumber((lua_State_0 *)L, -1.0);
}
return 1;
}
相关函数:
装备刻铭:LuaFnEquipLock
剩余 27% 内容需要支付 10.00
金币 后可完整阅读
支持付费阅读,激励作者创作更好的作品。