• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 1.X+ hasConditon funtion request.

CesarZ

Well-Known Member
Joined
Sep 20, 2012
Messages
268
Solutions
4
Reaction score
63
i know everyone has different global.lua. can anybody search for hasCondition in their global.lua and send me the function. please and thanks
from

function

to

end

if not check you compat.lua thanks
 
Don't see it in global or lib

but in luascript.cpp it shows
creature:hasCondition(conditionType[, subId = 0])
Code:
int LuaScriptInterface::luaCreatureHasCondition(lua_State* L)
{
    // creature:hasCondition(conditionType[, subId = 0])
    Creature* creature = getUserdata<Creature>(L, 1);
    if (!creature) {
        lua_pushnil(L);
        return 1;
    }

    ConditionType_t conditionType = getNumber<ConditionType_t>(L, 2);
    uint32_t subId = getNumber<uint32_t>(L, 3, 0);
    pushBoolean(L, creature->hasCondition(conditionType, subId));
    return 1;
}
 
Don't see it in global or lib

but in luascript.cpp it shows
creature:hasCondition(conditionType[, subId = 0])
Code:
int LuaScriptInterface::luaCreatureHasCondition(lua_State* L)
{
    // creature:hasCondition(conditionType[, subId = 0])
    Creature* creature = getUserdata<Creature>(L, 1);
    if (!creature) {
        lua_pushnil(L);
        return 1;
    }

    ConditionType_t conditionType = getNumber<ConditionType_t>(L, 2);
    uint32_t subId = getNumber<uint32_t>(L, 3, 0);
    pushBoolean(L, creature->hasCondition(conditionType, subId));
    return 1;
}
What TFS you using? i need TFS 1.0 you got Compat.lua?
 
Extract it from the lastest TFS and add it into your actual TFS (Idk if 1.0 had it). Or just use it as the user above pointed out.
 
Back
Top