RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

[RunUO 2+] daat99's Master Looter + Ledger system

Lokai

Knight
I will add my "welcome back" to the list also.

daat99, good to see you in action once again!
 

daat99

Moderator
Staff member
Thank you :)
Good to see so many of the old good coders that are still around here :)
 

Alyssa Dark

Sorceror
find this in MasterLooterBackpack.cs , around line 21 on mine, v1.03 :
Code:
 GoldLedger = true; //enables the gold ledger

change it to false and then the gold ledger portion isn't visible or usable
 

daat99

Moderator
Staff member
Everything in this system is intended to be enabled/disabled.

The default behavior can be set (usually in Utils file) and for every global setting a deed can be added to enable it.

For example you can disable the gold/token ledgers by default and sell the token/gold ledger deeds to your players.

Once the players use the deed (in their pack with the master looter) that option will be enabled for their specific master looter.

The currently in testing version will enable the shard owner to disable the bags "keep items on death" blessed behavior (the bag itself will still be blessed).

That will be enabled by default but for the shard owners that wants to set it to disabled a deed will be added so they could sell it to players.
 

daat99

Moderator
Staff member
That is the behavior of version 1.03.
1.04 will grant the owner the ability to choose if he wants the items to remain in the looter or not.
 

Maldren

Wanderer
Oh wow i did not think anyone was still doing this.. I just got back after a very long break as well. I just got a hankering for some UO and here i am. BTW this is Rancid77 not many here will remember me but hopefully some do. Looking forward to checking this out once all my stuff is back up and running
 

daat99

Moderator
Staff member
I'll update the FAQ later today with how to do that (I'll also post it here).

Thanks for a very useful question :)
 

daat99

Moderator
Staff member
Add this line and then add "looter" to the backpack.
Daat99MasterLooterSystem.MasterLooterBackpack looter = new Daat99MasterLooterSystem.MasterLooterBackpack();
 

GhostRiderGrey

Sorceror
Avachel, I think you can add
PHP:
using Daat99MasterLooterSystem;
at the top of CharacterCreation.cs and then use your line of
PHP:
PackItem( new MasterLooterBackpack() );
down below. Tried that here and it appears to be working fine.
 

daat99

Moderator
Staff member
That will work but with a cost.
Every time he'll compile his server the character creation file will check if my file was changed and recompile itself again.

In the long run it'll waste a lot of cpu on useless compilation.

The line of code I posted will avoid the "using" part and those won't require recompilation so much.
 

GhostRiderGrey

Sorceror
Thanks for the explanation daat99, ill go back and try and add your suggested code ( I could not get it to work the first time I tried).
 

daat99

Moderator
Staff member
Maybe I had a typo, can you post the error you get with this please:
Daat99MasterLooterSystem.MasterLooterBackpack looter = new Daat99MasterLooterSystem.MasterLooterBackpack();
 

GhostRiderGrey

Sorceror
Is this what the code should look like when fully together?
Code:
Daat99MasterLooterSystem.MasterLooterBackpack looter = new Daat99MasterLooterSystem.MasterLooterBackpack();
            PackItem(new looter());
or this?
Code:
Daat99MasterLooterSystem.MasterLooterBackpack looter = new Daat99MasterLooterSystem.MasterLooterBackpack();
            {
                PackItem(new looter());
            }
 

GhostRiderGrey

Sorceror
When using either of those, it flags me on new looter and asks tells me "The type or namespace "looter" could not be found (are you missing a using directive or assembly reference)". Thats what lead me to adding the using reference a the top of the file.
 

GhostRiderGrey

Sorceror
Could this be used as well with no "using" cpu hit?
Code:
PackItem(new Daat99MasterLooterSystem.MasterLooterBackpack());
Tested and it seems to be working.
 

GhostRiderGrey

Sorceror
Also noticed a graphical glitch on page 3 of a default loot backpack. Double arrow at the bottom of the gump.

 

daat99

Moderator
Staff member
Could this be used as well with no "using" cpu hit?
Code:
PackItem(new Daat99MasterLooterSystem.MasterLooterBackpack());
Tested and it seems to be working.
This will work, let me explain:
Code:
Daat99MasterLooterSystem.MasterLooterBackpack looter = new Daat99MasterLooterSystem.MasterLooterBackpack();
First we declare a type of the item we want:
Daat99MasterLooterSystem.MasterLooterBackpack looter = new Daat99MasterLooterSystem.MasterLooterBackpack();
Then we create a variable of that type and give it a name:
Daat99MasterLooterSystem.MasterLooterBackpack looter = new Daat99MasterLooterSystem.MasterLooterBackpack();
After that we tell the compiler that we want to assign something to it:
Daat99MasterLooterSystem.MasterLooterBackpack looter = new Daat99MasterLooterSystem.MasterLooterBackpack();
We also tell the compiler that we want to create a new object:
Daat99MasterLooterSystem.MasterLooterBackpack looter = new Daat99MasterLooterSystem.MasterLooterBackpack();
We tell the compiler the type of the object we want to create:
Daat99MasterLooterSystem.MasterLooterBackpack looter = new Daat99MasterLooterSystem.MasterLooterBackpack();
And last we tell the compiler to create it without any special "information" (parameters):
Daat99MasterLooterSystem.MasterLooterBackpack looter = new Daat99MasterLooterSystem.MasterLooterBackpack();

At this point we have a Master Looter Backpack object stored in a variable called "looter" and we can use it like this:
Code:
looter.GoldLedger = false;
looter.Name = "I'm a new looter and I won't hold gold for my owner";
PackItem( looter );

Using the code you posted is the same thing except you can't do anything with the looter because you don't know what it is.

In my code the owner can change stuff on the looter based on the new player settings (gargoyles get GoldLedger, Humans and elves can't... etc).
 
Top