Page 1 of 1

Light Level

Posted: Wed Aug 26, 2009 12:29 pm
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?

Re: Light Level

Posted: Wed Aug 26, 2009 12:44 pm
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

Re: Light Level

Posted: Wed Aug 26, 2009 2:59 pm
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

Re: Light Level

Posted: Thu Aug 27, 2009 9:45 am
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. :(

Re: Light Level

Posted: Sun May 30, 2010 11:33 am
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 :(

Re: Light Level

Posted: Sun May 30, 2010 12:49 pm
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.

Re: Light Level

Posted: Sun May 30, 2010 11:13 pm
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:

Re: Light Level

Posted: Mon May 31, 2010 11:08 am
by atreiu
,light cant prevent to SendInstaResDialog( char ); O_o