Go Back   RunUO - Ultima Online Emulation > RunUO > Custom Script Release Archive

Custom Script Release Archive This is a pre-script database archive of what our users had released.

 
 
Thread Tools Display Modes
Old 01-30-2006, 02:53 AM   #1 (permalink)
Xanthos
Guest
 
Posts: n/a
Default Xanthos [Claim System

Claim System 1.6 by Xanthos

Introduction
The Claim System rewards users for helping keep item count down thereby reducing lag. As corpses are claimed, the player is given the looted items as well as a gold reward based on the fame of the mob. The system also helps make looting corpses and scavenging items from the ground less tedius by automating the tasks. The system can be configured to keep looting of player corpses and competing for loot a social activity by disabling its commands in the presence of other players. The system comes with a special gold bag that looted/scavenged gold is placed into automatically. The bag can be dropped on an Arya.Savings.SavingsAccount (packaged with the Auction system) and all gold within will be deposited into the account; saving the tedium of dragging piles of gold to the account. The system honors the notoriety system and will not loot high fame mobs for which rights have not been earned. A player is always free to loot by hand those corpses that the system will not loot. The system requires no modifications to the standard distro files.

Features
  • A [claim command that enables targeted selection of corpses to loot
  • Cursor retargets after each corpse is claimed allowing rapid claiming of multiple corpses
  • A [grab command that enables area wide looting and item scavenging
  • All configurable options can be managed in an xml file with no changes to code, including:
  • Grab command enable/disable
  • Claim command enable/disable
  • Item classes to be looted/scavenged by the commands
  • The radius that is scavenged by the grab command
  • The proximity to other players (excluding guild mates, allies and party members) at which the commands auto disable
  • Whether player corpses can be looted/scavenged by the commands
  • The magnitude of the reward for each corpse claimed
  • The minimum reward value for low fame mobs
  • Whether or not the bags are blessed
  • Whether or not to aggregate silver in the player's pack into the silver bag.
  • Gold, silver and loot bags, players can keep in their packs, that looted/scavenged gold is placed into automatically. The bag can be dropped onto an Arya.Savings.SavingsAccount and its contents will be deposited into the account.
  • When possible stackable items are stacked as they are moved to the player's pack or gold bag
  • Corpses of bonded pets cannot be looted/scavenged, preventing a possible exploit
Installation
Unzip the Xanthos folder into your customs folder. Copy ClaimConfig.xml to your Data folder if you wish to modify configuration parameters.

Acknowlegements
All original code by Xanthos; inspried by an idea implemented by Daat99.

Changes

Version 1.6
  • Items in house secures can no longer be obtained with [grab.
  • The player's fame & karma are considered in the reward - the larger they are the better the reward.
Version 1.5
  • A player can no longer claim/grab the player's corpse thereby potentially destroying items.
Version 1.4
Note that there are new configuration parameters in ClaimConfig.xml.
  • Added a silver bag to collect faction silver. Based on a config setting, any additional silver in the player's pack is also moved into the silver bag upon using the claim or grab commands.
  • Added a loot bag to collect loot.
  • Bag loot status (blessed/regular) is configured in the xml file.
  • Removed a warning.
Version 1.3
  • Added shorter versions of the commands.
  • Added an option to carve a corpse and collect the hides/feathers/wool/scales using the claim command.
Version 1.2
  • Inivisible staff no longer block grab and claim commands.
  • Subclasses of the Types in the LootTypes array are now looted.
Version 1.1
  • Fixed a null pointer reference countered when claiming corpses of mobs killed before the sever was taken off-line.
Attached Files
File Type: zip Utilities 1.2.zip (6.8 KB, 384 views)
File Type: zip Claim 1.6.zip (9.0 KB, 332 views)

Last edited by Xanthos; 03-23-2006 at 12:41 AM.
 
Old 01-30-2006, 02:53 AM   #2 (permalink)
Xanthos
Guest
 
Posts: n/a
Default

this space intentionally left blank.
 
Old 01-30-2006, 04:21 PM   #3 (permalink)
Forum Master
 
Joeku's Avatar
 
Join Date: Feb 2005
Location: ShatteredSosaria.com
Posts: 9,261
Default

Sounds delicious. You've earned a big pat on the back!
Joeku is offline  
Old 01-30-2006, 11:13 PM   #4 (permalink)
Forum Expert
 
Join Date: Oct 2004
Location: San Diego, CA
Age: 39
Posts: 281
Send a message via AIM to dracana Send a message via MSN to dracana
Default

Great job, looks great!

Just wondering... I saw that the award calculation had a Minimum Award parameter, is there a max award parameter as well? Thought that would make sense for those monsters that have 20k plus fame and only drop 500 gold. Without a max and a divisor at 100, the award would be more than the loot Just a thought if it's not there already

Thanks again Xanthos, keep it up!
dracana is offline  
Old 01-31-2006, 03:27 AM   #5 (permalink)
Xanthos
Guest
 
Posts: n/a
Default

I guess choosing a good maximum value could be a problem since what would be best in the case you mentioned is to tie the reward to the gold the mob gives - I can't think of a good way to to that.
 
Old 02-03-2006, 11:14 PM   #6 (permalink)
Forum Expert
 
Join Date: Oct 2004
Location: San Diego, CA
Age: 39
Posts: 281
Send a message via AIM to dracana Send a message via MSN to dracana
Default award bug

Just wanted to let you know that there is a small bug in the AwardGold routine. Here is the scenario...

1. Players kill mobiles.
2. Shard is restarted.
3. When shard is back up, player enters dungeon to claim bodies.
4. Shard crashes.

The problem is in almost every [claim script that I have used, that awards gold based on the fame of the corpses owner. When the shard is restarted, the Owner prop on corpses is nulled, thus when the players claim after restart, the shard crashes with a NullReferenceException error. This is easily fixed with a check if corpse.Owner == null, before you check corpse.Owner.Fame, I did something along these lines...
Code:
int corpseFame;

if(null == corpse.Owner)
    corpseFame = 1000; //to give the something!
else
    corpseFame = corpse.Owner.Fame;
Now use corpseFame in the award amount calculation.

Hope this helps
dracana is offline  
Old 02-04-2006, 06:28 AM   #7 (permalink)
Xanthos
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by dracana
Just wanted to let you know that there is a small bug in the AwardGold routine. Here is the scenario...

1. Players kill mobiles.
2. Shard is restarted.
3. When shard is back up, player enters dungeon to claim bodies.
4. Shard crashes.

The problem is in almost every [claim script that I have used, that awards gold based on the fame of the corpses owner. When the shard is restarted, the Owner prop on corpses is nulled, thus when the players claim after restart, the shard crashes with a NullReferenceException error. This is easily fixed with a check if corpse.Owner == null, before you check corpse.Owner.Fame, I did something along these lines...
Code:
int corpseFame;

if(null == corpse.Owner)
    corpseFame = 1000; //to give the something!
else
    corpseFame = corpse.Owner.Fame;
Now use corpseFame in the award amount calculation.

Hope this helps
Thanks Dracna - ill post the fix with the next release, shortly
 
Old 02-06-2006, 02:19 AM   #8 (permalink)
Xanthos
Guest
 
Posts: n/a
Default

New version uploaded.
 
Old 02-06-2006, 05:37 AM   #9 (permalink)
Forum Expert
 
Join Date: Oct 2002
Location: Germany (american though)
Age: 33
Posts: 957
Default

Very nice addition for any shard for PvM players.

Last edited by Jarrod; 02-06-2006 at 06:03 AM.
Jarrod is offline  
Old 02-10-2006, 05:48 AM   #10 (permalink)
Account Terminated
 
Join Date: Feb 2006
Posts: 9
Default

It's a nice script, but I run into a mysterious behavior: I can claim/grab bodies as desired, however I only get the reward, the corpses are not looted. After having done much debugging (yeah, I just LOVE guessing types of variables and Console.WriteLine-ing to show them... does C# have anything like print_r in PHP?), I've closed down on the suggestion that it is a ConfigParser issue. It seems to parse arrays in a way which this Claim System does not expect... Any plans to fix it?
Dmitri is offline  
Old 02-10-2006, 05:54 AM   #11 (permalink)
Forum Expert
 
Join Date: Oct 2002
Location: Germany (american though)
Age: 33
Posts: 957
Default

Quote:
Originally Posted by Dmitri
It's a nice script, but I run into a mysterious behavior: I can claim/grab bodies as desired, however I only get the reward, the corpses are not looted. After having done much debugging (yeah, I just LOVE guessing types of variables and Console.WriteLine-ing to show them... does C# have anything like print_r in PHP?), I've closed down on the suggestion that it is a ConfigParser issue. It seems to parse arrays in a way which this Claim System does not expect... Any plans to fix it?
check ClaimConfix.xml (this has to be in your DATA folder btw)


<!-- List the item classes to claim/grab -->
<TypesToLoot type="array">

Jewel will not work, I have modified the code to grab BaseJewel instead as default, regardless of what the config says.

in claimconfig.cs around line 72
else if ( ((IList)(ClaimConfig.TypesToLoot)).Contains( item.GetType()) || ( ClaimConfig.LootArtifacts && Misc.IsArtifact( item ) || item is BaseJewel ))
items.Add( item );
other items should be .grabbed fine, you just have to be specific.

Last edited by Jarrod; 02-10-2006 at 06:00 AM.
Jarrod is offline  
Old 02-10-2006, 06:52 AM   #12 (permalink)
Account Terminated
 
Join Date: Feb 2006
Posts: 9
Default

Well, I've done some more debugging and seem to have closed down on the error. Take a look at ConfigParser.cs, line 437:

Code:
                                        array[ i ] = Type.GetType( ChildElements[ i ].Text );
This conversion fails. I've inserted a debug output statement after that line:
Code:
                                        Console.WriteLine("--->" + ChildElements[ i ].Text + "<--->" + Type.GetType( ChildElements[ i ].Text) + "<--");
And, guess how the output looks like?
Code:
Xanthos.Utilities.ConfigParser attempting to load Data/ClaimConfig.xml...
Xanthos.Utilities.ConfigParser success!
--->Server.Items.Gold<---><--
--->Server.Items.Bandage<---><--
--->Server.Items.Arrow<---><--
--->Server.Items.Jewel<---><--
So, GetType just does not find the type....
Dmitri is offline  
Old 02-10-2006, 06:56 AM   #13 (permalink)
Forum Expert
 
Greystar's Avatar
 
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 35
Posts: 3,848
Default

Quote:
Originally Posted by Dmitri
Well, I've done some more debugging and seem to have closed down on the error. Take a look at ConfigParser.cs, line 437:

Code:
                                        array[ i ] = Type.GetType( ChildElements[ i ].Text );
This conversion fails. I've inserted a debug output statement after that line:
Code:
                                        Console.WriteLine("--->" + ChildElements[ i ].Text + "<--->" + Type.GetType( ChildElements[ i ].Text) + "<--");
And, guess how the output looks like?
Code:
Xanthos.Utilities.ConfigParser attempting to load Data/ClaimConfig.xml...
Xanthos.Utilities.ConfigParser success!
--->Server.Items.Gold<---><--
--->Server.Items.Bandage<---><--
--->Server.Items.Arrow<---><--
--->Server.Items.Jewel<---><--
So, GetType just does not find the type....
what about changing Jewel to BaseJewel in the ClaimConfig?
__________________
Quote:
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.
Killable Guards (GS Version)
Just a Simple Staff Tool
You can leave me messages.
Ernest Gary Gygax - Quote "I would like the world to remember me as the guy who really enjoyed playing games and sharing his knowledge and his fun pastimes with everybody else."
Greystar is offline  
Old 02-10-2006, 07:10 AM   #14 (permalink)
Account Terminated
 
Join Date: Feb 2006
Posts: 9
Default

This would address another issue, I think. However, I gave it a try:

Code:
Xanthos.Utilities.ConfigParser attempting to load Data/ClaimConfig.xml...
Xanthos.Utilities.ConfigParser success!
--->Server.Items.Gold<---><--
--->Server.Items.Bandage<---><--
--->Server.Items.Arrow<---><--
--->Server.Items.BaseJewel<---><--
I've inserted "using Server.Items" in the header... No result. When I change "GetType(string)" into "GetType(string,bool)" (i.e. throw the exceptions, do not ignore them), the error handler catches one...
Dmitri is offline  
Old 02-10-2006, 08:05 AM   #15 (permalink)
Forum Expert
 
Greystar's Avatar
 
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 35
Posts: 3,848
Default

Quote:
Originally Posted by Dmitri
This would address another issue, I think. However, I gave it a try:

Code:
Xanthos.Utilities.ConfigParser attempting to load Data/ClaimConfig.xml...
Xanthos.Utilities.ConfigParser success!
--->Server.Items.Gold<---><--
--->Server.Items.Bandage<---><--
--->Server.Items.Arrow<---><--
--->Server.Items.BaseJewel<---><--
I've inserted "using Server.Items" in the header... No result. When I change "GetType(string)" into "GetType(string,bool)" (i.e. throw the exceptions, do not ignore them), the error handler catches one...
Was just a thought.
__________________
Quote:
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.
Killable Guards (GS Version)
Just a Simple Staff Tool
You can leave me messages.
Ernest Gary Gygax - Quote "I would like the world to remember me as the guy who really enjoyed playing games and sharing his knowledge and his fun pastimes with everybody else."
Greystar is offline  
Old 02-10-2006, 11:55 AM   #16 (permalink)
Account Terminated
 
Join Date: Feb 2006
Posts: 9
Default

Okay, I've given up my attempt to figure out, why that GetType function does not work as desired.
I've patched the scripts to firstly work with the string values (and therefore not to care if GetType functions...) and secondly - not to treat anyone with AccessLevel > Player as a blocking Mobile. You don't want a hidden GM to be spotted due to blocked grab&claim, do you?

If Xanthos gives his permission, I will post the updated versions here.
Dmitri is offline  
Old 02-10-2006, 07:28 PM   #17 (permalink)
Forum Master
 
Lord_Greywolf's Avatar
 
Join Date: Dec 2005
Posts: 7,279
Send a message via Yahoo to Lord_Greywolf
Default

just to let you know also - i did not notice it at 1st - but only the gold goes in the gold bag - the rest goes in your pack - so the jewels may be coming up in there - but you are not noticing them being in your pack
Lord_Greywolf is offline  
Old 02-11-2006, 02:27 AM   #18 (permalink)
Account Terminated
 
Join Date: Feb 2006
Posts: 9
Default

Nono, they didn't go anywhere, trust me. Now they do
Dmitri is offline  
Old 02-11-2006, 03:36 AM   #19 (permalink)
Xanthos
Guest
 
Posts: n/a
Default

Mystery solved. There is nothing wrong with the ConfigParser. The code was doing an exact match on the Types. It now looks for Types and their derived types. Rings for instance are derived from BaseJewel and will now be looted whereas before they were failing the exact match test.

I also implemented Dmitri's suggestion to not block the grab when invisible staff are within the block range.
 
Old 02-12-2006, 12:18 AM   #20 (permalink)
Forum Novice
 
xxx007xxx's Avatar
 
Join Date: Dec 2005
Location: Quebec
Age: 21
Posts: 174
Send a message via MSN to xxx007xxx
Default [claims for screen

Claim system is relly good but im not sure player will claim all monster one by one.
Maby add claim all screen.
__________________
Monster Creation V3.9
╔╗╔═╦╗
║╚╣║║╚╗
╚═╩═╩═╝
♠♣♥♦
xxx007xxx is offline  
Old 02-12-2006, 01:09 AM   #21 (permalink)
 
Join Date: Sep 2005
Location: Roxboro, NC, USA
Age: 32
Posts: 139
Default

xxx007xxx There are 2 commands [claim and [grab

[claim is for one by one.
[grab is for all lootable on screen within a setting range.
dashiznit_76 is offline  
Old 02-14-2006, 04:14 PM   #22 (permalink)
Forum Newbie
 
Join Date: May 2004
Age: 31
Posts: 27
Default

Two quick questions.

Does this system auto-carve a corpse?

Also does it let you set a loot bag?
Castel is offline  
Old 02-14-2006, 05:19 PM   #23 (permalink)
Forum Expert
 
Johabius's Avatar
 
Join Date: Dec 2004
Location: Kansas, USA
Age: 38
Posts: 4,964
Send a message via ICQ to Johabius Send a message via Yahoo to Johabius
Default

I don't think it does...if you want to be able to do that you might want to try a 3rd party tool like Easy UO
I hope it's okay to post the link...if not, can a mod let me know and I'll remove it
__________________
In some cases stupid makes you win-Radwen
Johabius is offline  
Old 02-14-2006, 05:22 PM   #24 (permalink)
RunUO Forum Moderator
 
daat99's Avatar
 
Join Date: Dec 2004
Location: Israel
Age: 27
Posts: 8,163
Send a message via ICQ to daat99 Send a message via AIM to daat99
Default

Quote:
Originally Posted by Castel
Two quick questions.

Does this system auto-carve a corpse?

Also does it let you set a loot bag?
This can be done inside the script if you know how.
If you want to do it yourself you can get started and post in the script support forum for help.
__________________
I always try to help
Sometimes, I don't know how....

My Web Page
Forum Rules
-------------------------------------------------------------
Extensive OWLTR System | Token System | World Teleporters
-------------------------------------------------------------
daat99 is offline  
Old 02-14-2006, 05:25 PM   #25 (permalink)
Forum Expert
 
Johabius's Avatar
 
Join Date: Dec 2004
Location: Kansas, USA
Age: 38
Posts: 4,964
Send a message via ICQ to Johabius Send a message via Yahoo to Johabius
Default

Ahhh thanks daat...wasn't aware that you could modify the script to do that. Still much learning I have to do
__________________
In some cases stupid makes you win-Radwen
Johabius is offline  
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5