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 12-08-2005, 11:39 AM   #1 (permalink)
Forum Expert
 
milt's Avatar
 
Join Date: Nov 2003
Location: Lancaster, PA
Age: 20
Posts: 1,606
Send a message via AIM to milt Send a message via Yahoo to milt Send a message via Skype™ to milt
Default [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.
Attached Files
File Type: zip GlobalReplace.zip (1.3 KB, 108 views)
__________________
--Milt, AKA Pokey
milt is offline  
Old 12-08-2005, 11:46 AM   #2 (permalink)
Forum Expert
 
Join Date: Oct 2002
Location: Germany (american though)
Age: 33
Posts: 957
Default

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
Jarrod is offline  
Old 12-08-2005, 12:32 PM   #3 (permalink)
Forum Novice
 
alambik's Avatar
 
Join Date: Apr 2003
Age: 32
Posts: 248
Default

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;
alambik is offline  
Old 12-08-2005, 12:41 PM   #4 (permalink)
Forum Expert
 
Join Date: Oct 2002
Location: Germany (american though)
Age: 33
Posts: 957
Default

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.

Last edited by Jarrod; 12-08-2005 at 12:50 PM.
Jarrod is offline  
Old 12-08-2005, 02:47 PM   #5 (permalink)
Forum Expert
 
milt's Avatar
 
Join Date: Nov 2003
Location: Lancaster, PA
Age: 20
Posts: 1,606
Send a message via AIM to milt Send a message via Yahoo to milt Send a message via Skype™ to milt
Default

Quote:
Originally Posted by Jarrod
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
__________________
--Milt, AKA Pokey

Last edited by milt; 12-08-2005 at 02:54 PM.
milt is offline  
Old 12-08-2005, 05:07 PM   #6 (permalink)
Forum Expert
 
Join Date: Jan 2004
Location: England
Age: 20
Posts: 442
Default

Hi milt, the name's tobyjug

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.
tobyjug is offline  
Old 12-08-2005, 05:18 PM   #7 (permalink)
Forum Expert
 
milt's Avatar
 
Join Date: Nov 2003
Location: Lancaster, PA
Age: 20
Posts: 1,606
Send a message via AIM to milt Send a message via Yahoo to milt Send a message via Skype™ to milt
Default

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
__________________
--Milt, AKA Pokey
milt is offline  
Old 12-08-2005, 07:08 PM   #8 (permalink)
Account Terminated
 
Join Date: Apr 2004
Location: Titusville PA
Age: 26
Posts: 975
Default

Will this work by type alone or is this capable of going by item name or would that be considered the same?
evil lord kirby is offline  
Old 12-08-2005, 07:12 PM   #9 (permalink)
 
Join Date: Oct 2002
Age: 23
Posts: 4,689
Default

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
XxSP1DERxX is offline  
Old 12-08-2005, 09:24 PM   #10 (permalink)
Forum Expert
 
milt's Avatar
 
Join Date: Nov 2003
Location: Lancaster, PA
Age: 20
Posts: 1,606
Send a message via AIM to milt Send a message via Yahoo to milt Send a message via Skype™ to milt
Default

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.
__________________
--Milt, AKA Pokey
milt 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