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

Lua World Light

Nesaj

New Member
Joined
Apr 10, 2008
Messages
126
Reaction score
0
Is there a way to change the World Light?
Something like "setWorldLight()" or a command to change the tibia time (day/night).
 
Ye, the 2 lights (world light and player light) would conflict and it would be impossible to achieve night light color.

You can only change player light in lua (doSetCreatureLight), and not the world light.
 
Well, idk the version that this was implemented but you can see that there is a diference between day and night on tibia (the light on floors 7+).
 
In fact yes with source edit it is possible and easy to it is very easy to set up (all in game.h and game.cpp). Depending what you need you may just adjust the these vars ( lightHourDelta, lightHour, SUNRISE, SUNSET) to change the lenght of day/night and these constants ( LIGHT_LEVEL_DAY, LIGHT_LEVEL_NIGHT) for the light level. In the project I'm coding for we needed variable light level depending on event and variable lenght for day/night so I added custom lua function. It works and doesn't affect the player "internallight" as Cykotitan mentionned. It's also easy to add a global event to this so you may use it as trigger in lua code.

(I gave you all the needed information so don't ask for a tutorial, if you do a little work on your side you'll be able to implement this in your ot too)
 
Back
Top