• 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+ light facc / premium

PuszekLDZ

https://tibia74.eu
Joined
Jan 2, 2020
Messages
428
Solutions
2
Reaction score
109
Location
Lodz
Twitch
puszekgamer
hio
i am working on premium light
and got an issue with code for default char light

i added in function onLogin(player)
LUA:
    local condition = Condition(CONDITION_LIGHT)
    condition:setParameter(CONDITION_PARAM_LIGHT_LEVEL, 6)
    condition:setParameter(CONDITION_PARAM_LIGHT_COLOR, 215)
    condition:setParameter(CONDITION_PARAM_TICKS, -1)

and my code for accounts is


LUA:
    if not player:isPremium() then   
    loginStr4 = string.format("test premium-facc")
    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, loginStr4)
    end
    
    if player:isPremium() then   
    loginStr4 = string.format("test premium-pacc")
    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, loginStr4)
    player:addCondition(condition)
    end

it works like I login - light starts to fall till it ends.. in like a 4-5 ticks...
i tried to change
condition:setParameter(CONDITION_PARAM_TICKS, -1) to
condition:setParameter(CONDITION_PARAM_TICKS, (6 * 60 + 10) * 1000)
to test - but that one dosnt even work...

any clue?
 
it works with subid
but is that counter does affect engine a lot?

LUA:
    if not player:isPremium() then   
    loginStr4 = string.format("test premium-facc")
    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, loginStr4)
    end
    
    local pacc_light = createConditionObject(CONDITION_LIGHT)
    setConditionParam(pacc_light, CONDITION_PARAM_TICKS, (6 * 60 + 10) * 10000)
    setConditionParam(pacc_light, CONDITION_PARAM_LIGHT_LEVEL, 5)
    setConditionParam(pacc_light, CONDITION_PARAM_LIGHT_COLOR, 215)
    setConditionParam(pacc_light, CONDITION_PARAM_SUBID, 90)
    
    if player:isPremium() then   
    loginStr4 = string.format("test premium-pacc")
    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, loginStr4)
    player:addCondition(pacc_light)
    end
 
Back
Top