• 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+ GM/GOD Light issue

Hayvosh

Member
Joined
Feb 7, 2019
Messages
32
Solutions
2
Reaction score
7
Location
Sweden
Hello,

I am running latest nekiro 1.5 dowgrade with 7.72 client.
What I've noticed that the GM characters mainly has no "character light".
In real tibia back in the days the GMs always had a default "utevo gran lux" sized~ blue tinted light around them.
Not sure if this is supported on TFS 1.5, or if it is, where and how do I add it?

Regards,
 

ralke

(҂ ͠❛ ෴ ͡❛)ᕤ
Joined
Dec 17, 2011
Messages
964
Solutions
23
Reaction score
494
Location
Santiago - Chile

At ProtocolGame::AddCreature function located on protocolgame.cpp

Change
C++:
msg.addByte(player->isAccessPlayer() ? 0xFF : lightInfo.level);

To
C++:
msg.addByte(lightInfo.level);
 
OP
OP
Hayvosh

Hayvosh

Member
Joined
Feb 7, 2019
Messages
32
Solutions
2
Reaction score
7
Location
Sweden

At ProtocolGame::AddCreature function located on protocolgame.cpp

Change
C++:
msg.addByte(player->isAccessPlayer() ? 0xFF : lightInfo.level);

To
C++:
msg.addByte(lightInfo.level);
I've seen that post, it was to remove the light. But from what I can see in the code, I alredy have the correct code as I use unmodified source from nekiro. Is it maybe somewhere else to modify?
 

ralke

(҂ ͠❛ ෴ ͡❛)ᕤ
Joined
Dec 17, 2011
Messages
964
Solutions
23
Reaction score
494
Location
Santiago - Chile
Try this too, go to void ProtocolGame::AddWorldLight(NetworkMessage& msg, LightInfo lightInfo) at protocolgame.cpp and search for
C++:
msg.addByte((player->isAccessPlayer() ? 0xFF : lightInfo.level));

Change that line for
C++:
msg.addByte(lightInfo.level);

1641688673386.png


It will work perfectly ;)
1641700334027.png
 
Last edited:
OP
OP
Hayvosh

Hayvosh

Member
Joined
Feb 7, 2019
Messages
32
Solutions
2
Reaction score
7
Location
Sweden
s so that people have to buy spells? The spell npcs are all there and ready to use but i cant see an option in either config to turn learn spells on.


leave empty array here

Try this too, go to void ProtocolGame::AddWorldLight(NetworkMessage& msg, LightInfo lightInfo) at protocolgame.cpp and search for
C++:
msg.addByte((player->isAccessPlayer() ? 0xFF : lightInfo.level));

Change that line for
C++:
msg.addByte(lightInfo.level);

View attachment 64529


It will work perfectly ;)

I tried your code but there is no ligh when using GM character :

1641731392157.png

It's all black, just to clarify.. I DO want light, but the light from RL tibia, where GM has a big natural character light with that slight blueish tone too it.
 

Evil Puncker

I know nothing
TFS Developer
Joined
May 30, 2009
Messages
8,112
Solutions
218
Reaction score
4,030
It's all black, just to clarify.. I DO want light, but the light from RL tibia, where GM has a big natural character light with that slight blueish tone too it.
change:
msg.addByte(player->isAccessPlayer() ? 0xFF : lightInfo.level);
to:
msg.addByte(player->isAccessPlayer() ? 215 : lightInfo.level);

change:
msg.addByte(lightInfo.color);
to:
msg.addByte(player->isAccessPlayer() ? 8 : lightInfo.color);


in all applicable places and recompile, change 215 and 8 to your liking
 
OP
OP
Hayvosh

Hayvosh

Member
Joined
Feb 7, 2019
Messages
32
Solutions
2
Reaction score
7
Location
Sweden
change:
msg.addByte(player->isAccessPlayer() ? 0xFF : lightInfo.level);
to:
msg.addByte(player->isAccessPlayer() ? 215 : lightInfo.level);

change:
msg.addByte(lightInfo.color);
to:
msg.addByte(player->isAccessPlayer() ? 8 : lightInfo.color);


in all applicable places and recompile, change 215 and 8 to your liking
I tried this, and what it seems to do is make all the unlit areas that blueish tint.
But what I am looking for is basically like if the GM charcters had an unlimited magic lightwand equipped, this makes the light visible to other players as well. And not have the whole "full" map light up :)
 

Evil Puncker

I know nothing
TFS Developer
Joined
May 30, 2009
Messages
8,112
Solutions
218
Reaction score
4,030
I tried this, and what it seems to do is make all the unlit areas that blueish tint.
But what I am looking for is basically like if the GM charcters had an unlimited magic lightwand equipped, this makes the light visible to other players as well. And not have the whole "full" map light up :)
don't edit the worldAddLight function
 
OP
OP
Hayvosh

Hayvosh

Member
Joined
Feb 7, 2019
Messages
32
Solutions
2
Reaction score
7
Location
Sweden
don't edit the worldAddLight function
Ok, so this would be correct then?

Lua:
void ProtocolGame::AddWorldLight(NetworkMessage& msg, LightInfo lightInfo)
{
    msg.addByte(0x82);
    msg.addByte(player->isAccessPlayer() ? 0xFF : lightInfo.level);
    msg.addByte(lightInfo.color);
}

void ProtocolGame::AddCreatureLight(NetworkMessage& msg, const Creature* creature)
{
    LightInfo lightInfo = creature->getCreatureLight();

    msg.addByte(0x8D);
    msg.add<uint32_t>(creature->getID());
    msg.addByte(player->isAccessPlayer() ? 210 : lightInfo.level);
    msg.addByte(player->isAccessPlayer() ? 8 : lightInfo.color);
}

With a fresh compile of the above, I still get this :

1641749697158.png


Here's the source I am using TFS-1.5-Downgrades/protocolgame.cpp at 7.72 · nekiro/TFS-1.5-Downgrades (https://github.com/nekiro/TFS-1.5-Downgrades/blob/7.72/src/protocolgame.cpp)
 
Last edited:
OP
OP
Hayvosh

Hayvosh

Member
Joined
Feb 7, 2019
Messages
32
Solutions
2
Reaction score
7
Location
Sweden
Just a followup on this issue, I found something strange.
The GM light works sometimes and sometimes it does not?

For instance, if I use stairs/rope to go up or down a level the light dissapears and stops working?
But this does not happen all the time, only sometimes. Very strange.
And some times when I login there is no light at all on the character (GM character), and if I relog it comes back.

I've included the relevant code, and I've branched of nekiros branch here TFS-1.5-Downgrades/protocolgame.cpp at 7.72 · Hayvosh/TFS-1.5-Downgrades (https://github.com/Hayvosh/TFS-1.5-Downgrades/blob/7.72/src/protocolgame.cpp)

At rows 3076-3078
Lua:
    LightInfo lightInfo = creature->getCreatureLight();
    msg.addByte(lightInfo.level);
    msg.addByte(lightInfo.color);

And rows 3200-3215

Lua:
void ProtocolGame::AddWorldLight(NetworkMessage& msg, LightInfo lightInfo)
{
    msg.addByte(0x82);
    msg.addByte(lightInfo.level);
    msg.addByte(lightInfo.color);
}

void ProtocolGame::AddCreatureLight(NetworkMessage& msg, const Creature* creature)
{
    LightInfo lightInfo = creature->getCreatureLight();

    msg.addByte(0x8D);
    msg.add<uint32_t>(creature->getID());
    msg.addByte(player->isAccessPlayer() ? 8 : lightInfo.level);
    msg.addByte(player->isAccessPlayer() ? 209 : lightInfo.color);
}

Is it something very obvious I am missing here?
Been going through this code a few times, but cant really find the culprit
 
OP
OP
Hayvosh

Hayvosh

Member
Joined
Feb 7, 2019
Messages
32
Solutions
2
Reaction score
7
Location
Sweden
Just noticed that if I do for instance "utevo lux" with a GM character the light will stay on forever.. UNTIL I change floor, when I for instance change floor the light goes out completly on the character. This is very strange
 
Top