Go Back   RunUO - Ultima Online Emulation > RunUO > RunUO Post Archive

RunUO Post Archive The Archvie

Reply
 
Thread Tools Display Modes
Old 07-19-2004, 09:11 PM   #1 (permalink)
 
Join Date: Aug 2003
Posts: 271
Send a message via AIM to Zidane4056
Default Customized Loot

I know it took ME a long time to figure out how to give my monsters loot with whatever properties I want, so here is how to do it:

For example, I am going to add a newbied longsword with HitDispel 50% to this monster's pack.

1) Find the section of the mobile's .cs file where it defines the loot (You will see a bunch of lines starting with "PackItem")

2) Right up above (or below; doesn't matter as long as it's in the same bracket) all the PackItem lines, I would put this:
Code:
// Begin Custom Longsword
Longsword A = new Longsword();
A.LootType = LootType.Newbied;
A.WeaponAttributes.HitDispel = 50;
//End Custom Longsword

PackItem( A );
Note that when you see "A" alone up there you can replace it with whatever you want (no numbers though). So to make it more logical if you were putting it on a slime's corpse you could replace all instances of "A" above with "SlimeLongsword". Just make you replace EVERY OCCURENCE of it. Also, keep in mind that if you have more than one customized piece of loot per monster that each item must have a DIFFERENT NAME!!!

3) Save the file, recompile, enjoy,



TO MAKE IT RANDOMIZED IF THE MONSTER DROPS THE ITEM

EDIT: Fixed a problem with Utility.Random

1) Take a look at David's post on how to use Utility.Random if you don't already know how.

2) To make a one in 5 chance for it to have the above longsword, add this to the loot section:
-UPDATED: Longsword will now only be constructed on case 0 of the random thingymabob. This is simply more effecient in scripting -
Code:
switch ( Utility.Random( 4 ) ) 
{
case 0:
{
// Begin Custom Longsword
Longsword A = new Longsword();
A.LootType = LootType.Newbied;
A.Attributes.HitDispel = 50;
//End Custom Longsword

PackItem( A ); break;
}
}


Any questions or errors when using this feel free to PM me
Zidane4056 is offline   Reply With Quote
Reply

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 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5