• 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!

LightColor, LightLevel and setCondition

desalib

New Member
Joined
Jul 4, 2010
Messages
30
Reaction score
0
Hi,

I would like to know what range those 2 variable has and if possible how to know which color will result from the lightcolor.
215 is the base value for utevo lux and it seem white/yellow, 29 seem to be blueish.

On what this color are based?

I want to know if it's possible to set an light condition like utevo lux but outsite of oncastspell and docombat.

Something like:

Code:
local condition = createConditionObject(CONDITION_LIGHT)
setConditionParam(condition, CONDITION_PARAM_LIGHT_LEVEL, 6)
setConditionParam(condition, CONDITION_PARAM_LIGHT_COLOR, 29)
setConditionParam(condition, CONDITION_PARAM_TICKS, (6 * 60 + 10) * 1000)

onlogin(cid)

setplayercondition(cid, condition)
 
Light colours are in Tibia client hexes from 00 to FF, therefore values 0, 255 in lua scripts should be correct.
Light level is... range of light on ambient 0%, I think.

why do you want to bypass condition? It's pretty awesome, especially when you make NPCs.

on top of your lua script(action, movement, creaturescript, whatever):
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

local condition = createConditionObject(CONDITION_LIGHT)
setConditionParam(condition, CONDITION_PARAM_LIGHT_LEVEL, 6)
setConditionParam(condition, CONDITION_PARAM_LIGHT_COLOR, 215)
setConditionParam(condition, CONDITION_PARAM_TICKS, (6 * 60 + 10) * 1000)
setCombatCondition(combat, condition)

you call it this way:
Lua:
doAddCondition(cid, condition)

or, if above doesn't work:
Lua:
addEvent(doAddCondition, 150, cid, condition)

in case you wanted to do it without conditions here are some new lua functions:
getPlayerLight(cid)
getWorldLight()
doSetCreatureLight(cid, lightLevel, lightColor, time)

also, if you set -1 in time it should last till player toggle it somehow
 
Last edited:
Thanks you for the infos.

But if I call the doaddcondition with settings then I call it again with differnet settings will it overtwrite the last setting?
If i set for exemple a light level to 7 then i set it back to 0 or 1 will it overwrite the 7 or as 7 is higher it will stay?

Only need this then I rep+ you.
 
Back
Top