Light Level

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
Pachacuti
Apprentice Poster
Posts: 51
Joined: Fri Jun 12, 2009 8:57 am

Light Level

Post by Pachacuti »

Hello guys... I'm here to ask for some help again.

I wanted to create a item that could change the light levels, but not everyone's light level, only a player light level. Something like a "blind" status.

I tried to search for some functions but found nothing.

Anyone?
User avatar
ELSoft
Journeyman Poster
Posts: 61
Joined: Sun Jun 18, 2006 7:45 pm

Re: Light Level

Post by ELSoft »

Perhaps this

http://docs.polserver.com/pol098/objref.php#UObject
facing Desc: facing or the object (meaningful for mobiles and light-emitting items) range 0-127
Tomi
POL Developer
Posts: 478
Joined: Tue Feb 21, 2006 5:08 pm

Re: Light Level

Post by Tomi »

ELSoft facing is only changing the light for items with lightsource tiledata flag. And for them its changing it according to light graphics in light.mul.

For mobiles facing only change the direction the face.


Pachacuti look at the character objref and method .setlightlevel, that is the one used to change a single person lightlevels.

or if you want you can also create a custom function for it ( cant remember what was wrong with that method why I did this )

Code: Select all

function SetLightLevel( character, light_level )

	var light_level_packet := CreatePacket( 0x4F, 2 );

	light_level_packet.SetInt8( 1, CInt( light_level ) );

	light_level_packet.SendPacket( character );

endfunction
LightLevel 30 = Dark & LightLevel 0 = DayLight
Pachacuti
Apprentice Poster
Posts: 51
Joined: Fri Jun 12, 2009 8:57 am

Re: Light Level

Post by Pachacuti »

Oh Tomi, Thanks! That is exatelly what I needed.

BUT, I still got a problem.

I wanted this script to create a "blind" status, where the player would be unnable to see. But the max dark I can set, isn't dark enough. :(
User avatar
atreiu
Grandmaster Poster
Posts: 151
Joined: Mon May 24, 2010 1:08 pm

Re: Light Level

Post by atreiu »

0x1F - Black
Max normal val = 0x1F

Guys i have another question == how to create lightlevel for MobileRef and avoid ,light from inject?
,light from inject can ignore Packet: 0x4F :(
Tomi
POL Developer
Posts: 478
Joined: Tue Feb 21, 2006 5:08 pm

Re: Light Level

Post by Tomi »

injection ignores both 0x4E and 0x4F ( both lightlevel packets )

because how OSI made the lightlevels working in UO they works this way

Server -> Client
- Tells what lightlevel should be changed to.
Client
- Just changes the lightlevel.

Thats the problem, the client is never responding to the server what lightlevel its using. ( Complain OSI about this if you dont like :D )

3 solutions for this problem

1: use a dissambeler to change the client to use some other packet cmd than 0x4E or 4F for lightlevels and hope people from injection doesnt packetlog ( NOT SECURE )
2: use a dissambeler to change the client to respond what lightlevel its using.
3: Custom client and make it work however you want


This is just 1 of many crappy things how OSI has made systems and stuff working in their client.


And just as a small note: Injection is not the only program out there to make the client ignore these packets ( Razor and EasyUO does it too ) And to be more exact about this, is just a damn 1 byte hex editing in the client to do this.
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am

Re: Light Level

Post by xeon »

Yes, it's just a one-byte hex, but
- you've to maintain that fix across client ugprades
- it's not secure

Damn OSI :deadhorse:
User avatar
atreiu
Grandmaster Poster
Posts: 151
Joined: Mon May 24, 2010 1:08 pm

Re: Light Level

Post by atreiu »

,light cant prevent to SendInstaResDialog( char ); O_o
Post Reply