|
||
|
|||||||
| Script Support Get support for modifying RunUO Scripts, or writing your own! |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#26 (permalink) | |
|
Twisted Intel
|
it will compile, it will pick your trash, beyond that it is untested.
__________________
Two roads diverged in a wood, and I- I took the one less traveled by, And that has made all the difference. - Robert Frost Yes I am a damn Trammie! - Silver Wolfe If You do not have anything good to say, say nothing at all. - Unknown _______________________________ Quote:
|
|
|
|
|
|
|
#28 (permalink) | |
|
Forum Expert
Join Date: Jan 2003
Location: California
Age: 39
Posts: 3,260
|
Quote:
|
|
|
|
|
|
|
#29 (permalink) |
|
Forum Expert
Join Date: Oct 2002
Location: Naples,FL
Age: 32
Posts: 1,552
|
I like this idea too but I wanted a more friendly look to it and with a bit more control over what it deletes. So here's some mods I made, getting rid of some useless code and adding an exemption list so, if for example you spawn reagents on your shard you don't want this guy deleting them every 5 seconds. Skills and looks are based on the brigand.
[code:1]using System; using System.Collections; using Server.Items; using Server.ContextMenus; using Server.Misc; using Server.Network; namespace Server.Mobiles { [CorpseName( "a trash collector corpse" )] public class TrashCollector : BaseCreature { [Constructable] public TrashCollector() : base( AIType.AI_Animal, FightMode.Agressor, 10, 1, 0.2, 0.4 ) { SpeechHue = Utility.RandomDyedHue(); Title = "the trash collector"; Hue = Utility.RandomSkinHue(); if ( this.Female = Utility.RandomBool() ) { Body = 0x191; Name = NameList.RandomName( "female" ); AddItem( new Skirt( Utility.RandomNeutralHue() ) ); } else { Body = 0x190; Name = NameList.RandomName( "male" ); AddItem( new ShortPants( Utility.RandomNeutralHue() ) ); } SetStr( 86, 100 ); SetDex( 81, 95 ); SetInt( 61, 75 ); SetDamage( 10, 23 ); SetSkill( SkillName.Fencing, 66.0, 97.5 ); SetSkill( SkillName.Macing, 65.0, 87.5 ); SetSkill( SkillName.MagicResist, 25.0, 47.5 ); SetSkill( SkillName.Swords, 65.0, 87.5 ); SetSkill( SkillName.Tactics, 65.0, 87.5 ); SetSkill( SkillName.Wrestling, 15.0, 37.5 ); Fame = 1000; Karma = 1000; AddItem( new Boots( Utility.RandomNeutralHue() ) ); AddItem( new FancyShirt()); AddItem( new Bandana()); switch ( Utility.Random( 7 )) { case 0: AddItem( new Longsword() ); break; case 1: AddItem( new Cutlass() ); break; case 2: AddItem( new Broadsword() ); break; case 3: AddItem( new Axe() ); break; case 4: AddItem( new Club() ); break; case 5: AddItem( new Dagger() ); break; case 6: AddItem( new Spear() ); break; } Item hair = new Item( Utility.RandomList( 0x203B, 0x2049, 0x2048, 0x204A ) ); hair.Hue = Utility.RandomNondyedHue(); hair.Layer = Layer.Hair; hair.Movable = false; AddItem( hair ); PackGold( 25, 75 ); } private DateTime m_NextPickup; public override void OnThink() { base.OnThink(); if ( DateTime.Now < m_NextPickup ) return; m_NextPickup = DateTime.Now + TimeSpan.FromSeconds( 2.5 + (2.5 * Utility.RandomDouble()) ); ArrayList Trash = new ArrayList(); foreach ( Item item in this.GetItemsInRange( 2 ) ) { if ( item.Movable ) Trash.Add(item); } Type[] exemptlist = new Type[]{ typeof(MandrakeRoot), typeof(Ginseng), typeof(AxeOfTheHeavens)}; //Short example list bool TrashIt = true; for (int i = 0; i < Trash.Count; i++) { for (int j = 0; j < exemptlist.Length; j++) { if ( (Trash[i]).GetType() == exemptlist[j] ) TrashIt = false; } if (TrashIt) ((Item)Trash[i]).Delete(); TrashIt = true; } } public TrashCollector( Serial serial ) : base( serial ) { } public override void Serialize( GenericWriter writer ) { base.Serialize( writer ); writer.Write( (int) 0 ); } public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); } } }[/code:1] |
|
|
|
|
|
#31 (permalink) |
|
Forum Expert
Join Date: Oct 2002
Location: Naples,FL
Age: 32
Posts: 1,552
|
If you're using the one I just posted, copy it to a .cs file and place it anywhere in your scripts folder. Restart the server and then you can either add them manually[code:1][Add TrashCollector [/code:1]or add TrashCollector to a spawner.
|
|
|
|
|
|
#32 (permalink) |
|
Forum Novice
|
i did exactly what u said its in its own .cs file and its in my customs and im trying to [add TrashCollector
doesnt seem to work not even on a spawner? i get no errors at all just wont add i have to be doing somthing wrong? maybe it shouldnt go in my customs maybe in mobils? |
|
|
|
|
|
#33 (permalink) |
|
Forum Expert
Join Date: Oct 2002
Location: Naples,FL
Age: 32
Posts: 1,552
|
If you're saving thru notepad make sure you save it as all files and not .txt (in file type). Or it will save it as name.cs.txt and with the default windows setting you won't see the .txt extension.
|
|
|
|
|
|
#35 (permalink) |
|
woohoo, i was gonna attempt to do this over the weekend and was afraid with my limited skills i wouldnt' be able to...
thanks guys billabong, make sure that what is written for the class in the code is what you're trying to add.. the name of the cs file isnt' necessarily what you type to add it, it's the class name within the code itself
__________________
What I like, you may not; What you like, I may not; everything has it's place |
|
|
|
|
|
|
#37 (permalink) |
|
i got a small problem i think this was one of the greatest idea ever and will save us from lag....so thanx for coming up wif it...however i got a small problem players on my shard keep killing them and i dnt know were in the script i have 2 change 2 make them immortal or more like a banker were it cannot be attacked???how i do that?
|
|
|
|
|
|
|
#45 (permalink) |
|
Master of the Internet
|
Then you should have said that.
What you would need to do is look at how they made it so that he won't pick up reagents. You will need to add exceptions for each item that he's not supposed to pick up.
__________________
Paranoia is what happens when you finally have all of the facts. |
|
|
|
|
|
#47 (permalink) |
|
Join Date: Oct 2003
Location: Colorado
Age: 29
Posts: 808
|
any chance someone could repost this?
the pasted script has crap in it from the forums such as where quotes are supposed to be, I can change those myself but i dont know what this {if ( item.Movable && item.Stackable )}is suppose to be etc. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|