Elfu

Initiate
Maybe someone can help me with that -> For roleplay purposes I need to change HouseSign. GM and house owner should see "Owner: xxxx" in HouseSign property list but other players shouldnt.

Since "public override void GetProperties(ObjectPropertyList list)" doesn't give me any "Mobile from" that I can check for ownership/access level I don't know how to handle that... ;/

Any ideas ?
 
AFAIK that will need some core modification, the way RunUO is coded prevents you pass the Mobile reference to GetProperties() method
You can track the code-flow to Item.OPLPacket which is a property that stores the OPL packet (so the server will not rebuild it for every single player every time) and properties does not receive arguments.

You can translate Item.OPLPacket into method (and its references untill you reach GetProperties(...)) which can receive the mobile reference but that may have some performance and reliability issues since the server will rebuild the OPL packet every time for every mobile it will send
 
Instead of overriding the OPL, you could override the OnSingleClick method. That passes the Mobile, and would show the information you need depending on who clicks it.
 
OnSingleClick is not used in AOS shards.

To support that in OPL you indeed need core changes. Mobile caches the OPL packet when it's generated and GetProperties method is not called again until you call InvalidateProperties. If you want different OPL's based on viewer access level, you would need to:
1. Cache a different packet for each AccessLevel (f.i. use a Dictionary<AccessLevel, OPLPacket>)
2. Add a new overload for GetProperties method that takes an AccessLevel parameter, and make the old implementation call the new one with AccessLevel = player (or the default of your choice).
3. Implement your custom logic based on AccessLevel param.
4. Profit.
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back