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!

[GlobalReplace

milt

Knight
[GlobalReplace

Description:
Global replace is a command for administrators to replace all the items in the world of one type, to another. For example, say I would like to replace every longsword in the world with a broadsword. This command can do such. It will also detect stackable items, and also to see if the item is equipped to the person, so it will replace the item exactly where it was found.

Disclaimer:
This script is not recommended for large servers with lots of items. If a monster has loot, it will replace its loot with whatever. Remember, please use this at your own discression, it will replace every item.

Usage:
Go in game and type [GlobalReplace <itemtoreplace> <itemtotakeplace>

Ex.- [globalreplace longsword broadsword

Installation:
Just drop it somewhere into your scripts folder.

Special Thanks:
KillerBeeZ for the idea.
 

Attachments

  • GlobalReplace.zip
    1.3 KB · Views: 122

Jarrod

Sorceror
Will this also handle "dumb" requests like

[globalreplace longsword goldeningot

?
as the goldeningot not an equippable item, would it drop into the backpack, and what would it do to NPC vendors?

just wondering ;)

**edit**

forgot to say,
Thank you for the contribution
 

alambik

Sorceror
in the "cloning" code part, I suggest you to add after
Code:
				Item o = (Item)f;
all the Item attributes that may be specificaly altered as Hue, Name, Movable... Else, some decoration items should decay for example, or not be like the personalized aspect. Should be very careful with such command, right.

Example:
Code:
				Item o = (Item)f;
				o.Name=item.Name;
				o.Hue=item.Hue;
				o.Movable=item.Movable;
				o.ItemID=item.ItemID;
 

Jarrod

Sorceror
eventually, LootType would also be a good prop to copy to the new item.

**Edit**
You could also use this to intentionlly remove unwanted things..

i.e. if someone claims that someone is running around with a blessed broadsword, and you are certain there should be NO blessed broadswords in game, you could intentionally modify the script to take care of that.

[globalreplace broadsword broadsword

(and in the script)
o.LootType = LootType.Regular

and voila, you have 0 blessed broadswords on the server.
 

milt

Knight
Jarrod said:
Will this also handle "dumb" requests like

[globalreplace longsword goldeningot

?
as the goldeningot not an equippable item, would it drop into the backpack, and what would it do to NPC vendors?

Yup, it will handle 'dumb' requests :) It will just put them in the backpack. Hmm well I saw that this guy (I think his name is tobyjub) has a Global Interface command, this script and his would make a great combination together. Might be cool to combine them
 
Hi milt, the name's tobyjug :D

Yeh i saw a request in my thread about adding a find and replace feature to my global interface and no sooner had I read that then I saw this post, this looks like a nice addition good job.
I think that this and my global interface could be quite a powerful combo to sort out all the Items in the world. But not running my own shard or working on one I just thought it would be interesting and did not know if it would be very useful. Had some good feedback though so I'm happy.
 

milt

Knight
If you would like, we could add this to yours. It wouldn't be hard at all. I've yet to try out your system, because I do not have UO where I am. But from what it sounds like, you can search for items. When you search, does it bring up a list of the items and locations? It would be neat if we could add a button there to replace those items, and an input bar to type in the name of the object to replace it with. Hey man, if you are interested, let me know and we can do this :)
 

Kamron

Knight
I always wondered if replacement can be done using [batch

now I have a question, how come you didn't make a replace function, and then make it accessible using the modifiers? That would make more sense to me... :p
 

milt

Knight
Not sure... I was originally not going to name it globalreplace, but then at the last minute I couldn't think of a good name for it, so I just did that. I guess that's not a bad idea, Spider.
 
Top