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!

[claim your kills and reduce lag ;)

mark01970

Wanderer
daat99 said:
If you think about any improvments please let me know ;)
.

Well, you asked if we thought about any improvements to let you know.

How about making the [claim script automatically pull gold and gems off of a corpse? ..or better still, make it customizable so it will automatically pull whatever the admin sets in a config file.

I've been trying to come up with this on my own, but am still learning and can not track down the variables that are used for target corpse items.

Thanks,
Mark
 

daat99

Moderator
Staff member
mark01970 said:
Well, you asked if we thought about any improvements to let you know.

How about making the [claim script automatically pull gold and gems off of a corpse? ..or better still, make it customizable so it will automatically pull whatever the admin sets in a config file.

I've been trying to come up with this on my own, but am still learning and can not track down the variables that are used for target corpse items.

Thanks,
Mark
That's something that will require this simple script to be transformed into a script package.
I'm not willing to do that at this stage.
If you serius about doing it tho you can start by checking the items inside the corpse (you target the corpse.. ischildof...).
That's the most I can help you in this thread, if you need more assistance please try something and post in the apropriate forum.
 

A_Li_N

Knight
Config:
Code:
...
Type[] types = new Type[n]{ Type1, Type2, Typen };
...

Claim:
Code:
...
ArrayList list = new ArrayList( Corpse.Items.Count );
foreach( Item i in Corpse.Items )
{
   if( Config.Types.Contains( i.GetType() ) )
      list.Add( i );
}
for( int i = 0; i < list.Count; i++ )
   from.Backpack.AddItem( i );   
...

Or something to that extent :)
 

daat99

Moderator
Staff member
A_Li_N said:
Config:
Code:
...
Type[] types = new Type[n]{ Type1, Type2, Typen };
...

Claim:
Code:
...
foreach( Item i in Corpse.Items )
{
   if( Config.Types.Contains( i.GetType() ) )
      from.Backpack.AddItem( i );
}
...

Or something to that extent :)
Hmm, that's interesting.
I'll try to work on it later on when I get some free time.
ThanX for your info A_Li_N ;)
 

chocomog

Wanderer
Fantastic script. I was thinking and wondering how hard would it be to make this work with the forensic skill? If they had higher forensic they would get a increase in the reward.
 

A_Li_N

Knight
chocomog said:
Fantastic script. I was thinking and wondering how hard would it be to make this work with the forensic skill? If they had higher forensic they would get a increase in the reward.
Shouldn't be extremely hard...Find where it calculates the amount of reward and put a skill check in there for the Forensics skill.
 

daat99

Moderator
Staff member
paulusmaximus said:
i put it in scripts\customs

load the shard up

try [claim
says its not a valid command
You probably placed it in the wrong directory.
If you had this script inside your scripts folder and than did a restart than it would allow you to use the [claim command.
 

tomm_60421

Wanderer
What about making it so you dont have to target the corpse you can just [claim and it will pick up any of you kills within a 3-5 tile radius or something like that....personaly I think that would be awsome then
 

Arcanagirl

Wanderer
tomm_60421 said:
What about making it so you dont have to target the corpse you can just [claim and it will pick up any of you kills within a 3-5 tile radius or something like that....personaly I think that would be awsome then

This can easily be done. I have a script that is similar to daats thats claims corpses nearby and you dont have to target a corpse. it checks for items and corpses, now I havent looked at daats claim script so I cant forsure tell you how to add that into his to make it to your liking. But I think you should try to script it yourself, cause knowing Daat he is very busy person. And I wouldnt post any mods to daats claim script or the other cleanup script without daats permission.

But as I said it is possible to do that and has been done by someone else who I think modded Daats script a bit or mabe its custom not sure.

If you want this Daat you can use this if it helps you any. Part of a code.

IPooledEnumerable eable = from.Map.GetItemsInRange(from.Location, 3);

ArrayList Other = new ArrayList();

foreach (Item check in eable)
{
if (check != null)
{

if (check is Corpse)
{
Other.Add(check);
}
}
}

eable.Free();

foreach (Item check in Other)
{
Corpse c = (Corpse)check;

if ((c.Owner is PlayerMobile)) { from.SendMessage("Hey, don't try to trick me, EVER!!!"); return; }

else
 

Murzin

Knight
arcana that looks like a modified version of my [grab script.

the first incarnation of this claim script was a merger of my [grab and a [red script. then he changed it so you have to target each individual corpse.

if you want to do something like this which is based off my old [grab script you must be sure to fix the memory leak in it.
 

daat99

Moderator
Staff member
tomm_60421 said:
What about making it so you dont have to target the corpse you can just [claim and it will pick up any of you kills within a 3-5 tile radius or something like that....personaly I think that would be awsome then
That'll require a bit of a rewrite to the script (which I don't realy have time to do atm).
You'll have to remove the target class and instead use a "foreach item in range" loop (based on the players location).
Just calculate the reward for each corpse and add it up before you give the gold to the players.
 
Top