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.0 RC1] Xanthos Claim System

X

Xanthos

Guest
Xanthos Claim System

Claim System version 2.1, 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 disallowing its use when other players are within a ceratin radius. The system comes with a special gold bag that looted/scavenged gold is placed into 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 of gold, silver and loot bags, players can keep in their packs, that looted/scavenge gold silver and loot are placed into automatically
  • 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
  • Each player can set the types of the items that their loot bag will collect. Using the -t option a gump will be presented allowing them to add or remove item types from the list of those collected.
All configurable options can be managed in an xml file with no changes to code, including:
  • Grab command enable/disable
  • Claim command enable/disable
  • defualt item classes to be looted/scavenged into the loot bag 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 loot type of the loot, silver and gold bags (blessed or regular)
  • Whether silver in the player's pack is aggregated into the silver bag
  • The minimum reward value for low fame mobs
Commands:
  • [Claim
  • [CL
  • [Grab
  • [GR
Installation

Unzip the Xanthos folder into your customs folder. Copy ClaimConfig.xml to your RunUO\Data folder if you wish to modify configuration parameters.

Requirements

Requires the Xanthos Utilities package.

Caveats

You may use or modify this system in any way you desire, however I ask that you leave the original headers in the source files if you re-write or redistribute the sources in any way.
- Xanthos

Changes


Version 2.0
  • Made the system compatible with RunUO 2.0
  • System commands now provide help when -? is used
  • Each Loot Bag can be configured, in-game by players, as to what item types it will collect. This is done with the -t option to either the [Claim or [Grab command.
Version 2.1
  • Fixed a null reference exception in serialization of types to loot.
 

Attachments

  • Claim System 2.1.zip
    34.6 KB · Views: 1,868

dracana

Sorceror
Great job Xanthos as always!! My players were actually requesting the ability to pick their own types of loot to grab, but I never had time to work on it! Thanx for saving the day :)
 

Thistle

Wanderer
You have to post the error messages.

Looks like "ClaimConfig.xml" contains the list of allowable items to use the "claim" command on.
 

Gaea

Sorceror
what do i change...

I love the sys, I only have one problem...how can i make it so that players can claim gold carried by the mob only...not the extra gold? If I kill a rat, i get 100 gp plus whatever amount it carried.

This is too much for my shard, for instance, one player made 50k in just over 1/2 hour. Is there an easy way to turn the extra gold off?
 

Ruined1

Wanderer
Also a possible flaw too. I don't know how it could happen... but if they do a [grab in town and a blue corpse is near by... most shards... theyre screwed. Not to hard to fix unless this is already implemented in which case ( this.post = !Read && ignorethis ) =P

if ( corpse != criminal && m_Owner.Region == IsGuarded )

=P my mastery of C# -.-
 

xxx007xxx

Sorceror
Gaea said:
Is there a way to fix my problem 2 posts up?
its seem to be Award Gold,

Code:
public static void AwardGold( Mobile from, Corpse corpse, Container goldBag )
		{
			BaseCreature mob = corpse.Owner as BaseCreature;
			int mobBasis = ( mob == null ? ClaimConfig.MinimumReward : mob.Fame + Math.Abs( mob.Karma ) );
			int playerBasis = ( from.Fame + Math.Abs( from.Karma ) );
			int amount = Math.Max( (int)((mobBasis + playerBasis) / 1.5) / ClaimConfig.FameDivisor, ClaimConfig.MinimumReward );
			DropGold( from, new Gold( amount ), goldBag );
		}


so if we look up in the file you will see ClaimCorpse you will find AwardGold


Code:
public static bool ClaimCorpse( Mobile from, Corpse corpse, ClaimOption option )
		{
			if ( null == corpse || corpse.Owner == from )
				return false;

			Container goldBag = GetGoldBag( from );
			Container silverBag = GetSilverBag( from );
			Container lootBag = GetLootBag( from );

			if ( ClaimConfig.AggregateSilver )
				AggregateSilver( from, silverBag );

			if ( ClaimOption.Carve == option && !(corpse.Owner is PlayerMobile) )
				corpse.Carve( from, null );

			LootCorpse( from, corpse, option, goldBag, silverBag, lootBag );
			AwardGold( from, corpse, goldBag );
			corpse.Delete();

			return true;
		}

edit = //AwardGold( from, corpse, goldBag );
the extra gold should not be drop in the player bag.
 
X

Xanthos

Guest
I think you meant if you comment the line. That seems like a good workaround for now - I will add a config option for this in the next release.
 

wgherrick

Wanderer
server crash

my players love your claim sys and i just changed over to 2.0
I added the claim sys and all compiled just fine.
when I added bags to the game and saved it crashed my server. came back to see if anyone had same problem and read install instructioins again. I had cut and pasted claimconfig.xml to data thought that was prob so put it back into original folder and copeid it to data still crashed. help pls. this is from console
RunUO - [www.runuo.com] Version 2.0, Build 2357.32527
Core: Running on .NET Framework Version 2.0.50727
Scripts: Compiling C# scripts...done (0 errors, 0 warnings)
Scripts: Compiling VB.NET scripts...no files found.
Scripts: Verifying...done (2944 items, 779 mobiles)
Regions: Loading...done
World: Loading...done (128036 items, 2436 mobiles) (7.30 seconds)
Reports: Stats: Loading...done
Reports: Staff: Loading...done
Xanthos.Utilities.ConfigParser attempting to load Data/ClaimConfig.xml...
Xanthos.Utilities.ConfigParser success!
Address: 127.0.0.1:2593
Address: 192.168.0.102:2593
Cleanup: Detected 12 inaccessible items, including 3 bank boxes, removing..
Cleanup: Detected 138 hair and facial hair items being worn, converting to their
virtual counterparts..

Reports: Stats: Save started
Reports: Stats: Save complete
Reports: Staff: Save started
Reports: Staff: Save complete
Reports: Stats: Render started
Reports: Stats: Render complete
Reports: Staff: Render started
Reports: Staff: Render complete
Client: 193.217.81.142: Connected. [3 Online]
Client: 193.217.81.142: Disconnected. [2 Online]
Core: Using standard save strategy
World: Saving...Error:
System.NullReferenceException: Object reference not set to an instance of an obj
ect.
at Xanthos.Claim.LootBag.Serialize(GenericWriter writer)
at Server.StandardSaveStrategy.SaveItems(SaveMetrics metrics)
at Server.StandardSaveStrategy.Save(SaveMetrics metrics)
at Server.World.Save(Boolean message)
at Server.World.Save()
at Server.Misc.AutoSave.Save()
at Server.Commands.CommandHandlers.Save_OnCommand(CommandEventArgs e)
at Server.Commands.CommandSystem.Handle(Mobile from, String text, MessageType
type)
at Server.Mobile.DoSpeech(String text, Int32[] keywords, MessageType type, In
t32 hue)
at Server.Mobiles.PlayerMobile.DoSpeech(String text, Int32[] keywords, Messag
eType type, Int32 hue)
at Server.Network.PacketHandlers.UnicodeSpeech(NetState state, PacketReader p
vSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)
Crash: Backing up...done
Crash: Generating report...done
Crash: Restarting...done


this is my crash log
Server Crash Report
===================

RunUO Version 2.0, Build 2357.32527
Operating System: Microsoft Windows NT 5.1.2600 Service Pack 2
.NET Framework: 2.0.50727.42
Time: 11/12/2006 2:53:22 AM
Mobiles: 2435
Items: 127910
Clients:
- Count: 1
+ ****: (account = ****) (mobile = 0x5 '***')

Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Xanthos.Claim.LootBag.Serialize(GenericWriter writer)
at Server.StandardSaveStrategy.SaveItems(SaveMetrics metrics)
at Server.StandardSaveStrategy.Save(SaveMetrics metrics)
at Server.World.Save(Boolean message)
at Server.World.Save()
at Server.Misc.AutoSave.Save()
at Server.Commands.CommandHandlers.Save_OnCommand(CommandEventArgs e)
at Server.Commands.CommandSystem.Handle(Mobile from, String text, MessageType type)
at Server.Mobile.DoSpeech(String text, Int32[] keywords, MessageType type, Int32 hue)
at Server.Mobiles.PlayerMobile.DoSpeech(String text, Int32[] keywords, MessageType type, Int32 hue)
at Server.Network.PacketHandlers.UnicodeSpeech(NetState state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)
 
X

Xanthos

Guest
Issue is resolved in version 2.1 - bad type names resulted in null references in the type array. The array is now pruned to remove nulls before serializing the array.
 

Broadside

Wanderer
I found that players use this as an exploit at champs. Its hard to keep an eye on them at all times in this case i was wondering if there was a way to disable corpse claiming if its champ spawn?
 

Rocko Wang

Wanderer
Broadside said:
I found that players use this as an exploit at champs. Its hard to keep an eye on them at all times in this case i was wondering if there was a way to disable corpse claiming if its champ spawn?

Do something like this

Code:
public static bool ChampionSpawnInRange( Mobile from, int range )
{
	foreach ( Item item in from.GetObjectsInRange( range ) )
	{
		if ( item is ChampionSpawn )
			return true;
	}
	return false;
}
It is possible to tag each mob and their corpse spawned in a champion spawn, but too much work than just use this function to check if there is a champion spawn site in a fixed range and if true, disallow claim. This wouldn't differentiate a mob not spawned by the champion spawn but somehow killed near the site, but close enough.
 

Rocko Wang

Wanderer
Broadside said:
With no set champion region one would have to add a range area for such a thing would they not?

Just set the range to whatever number you feel appropriate when you call the function I made up previously.
A more general way to address people claiming too many corpse too fast, if that is ever an issue to you for something other than champion spawn, is to set an upperlimit of how many corpse a player can claim per minute or something, or give a penalty of say stamina for per claim to natually limit how fast someone can claim. In extreme cases, someone cast earthquake in a heavy spawn low level mob area, then use this command to make a profit? You never know.
 

VertiAdmin

Wanderer
ok, I have 2 questions...

1) I'm on a 1.0 shard. i wanna use this system, is there somehting i have to do to convert it down to 1.0?

2) will this script grab player corpses? cause we used 1 script and it grabbed a player corpse and he lost his armor, this isn't a pvp shard...
<or a way for admin to shut it off>

Thanks to who can answer these...
 
X

Xanthos

Guest
1) Post in the script support forum for questions on porting 2.0 code to 1.0.

2) The package can be configured to allow or disallow looting of player corpses. Facet rules are honored so innocent, non-guilded players in trammel cannot be looted for instance. I would consider the loss you mention a bug and fix it for you if it happened with this package.
 
Top