I released a custom script mainly because it did everything I wanted it to do and more to my surprise! The AI is fantastic! The only thing that urks me is the fact I can't get it to spawn gold. It spawns all the other loot but the gold. What am I missing? Oh, the spaces need to be there or the script behaves very differently. I'm including the script file below. For some reason, the paste is showing up inaccurately and could cause the script if saved from copying to run wrong.

Code:
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.Gumps;
using Server.Network;
using Server.ContextMenus;

namespace Server.Mobiles
{
	[CorpseName( "a Melted Puddle" )]
	public class TheIcyHoarder : BaseMount
	{
		[Constructable]
		public TheIcyHoarder() : this( "a ice hoarder" )
		{
		}

		public override bool SubdueBeforeTame{ get{ return true; } } // Must be beaten into submission
        public override bool HasBreath
        {
            get
            {
                return true;
            }
        }// fire breath enabled


		[Constructable]
		public TheIcyHoarder( string name ) : base( name, 0xA2, 0xA2, AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 )
		{
			this.Hue = 0x509;
                this.BaseSoundID = 655;

			SetStr( 100 );
			SetDex( 110 );
			SetInt( 130 );

	                this.SetHits(600, 1000);
		 
			SetStam( 110 );
			SetMana( 500 );

			SetDamage( 20, 30 );

			SetDamageType( ResistanceType.Physical, 100 );

			SetResistance( ResistanceType.Physical, 50, 60 );
			SetResistance( ResistanceType.Fire, 50, 55 );
			
			SetResistance( ResistanceType.Poison, 25, 30 );
			SetResistance( ResistanceType.Energy, 25, 30 );

			SetSkill( SkillName.Wrestling, 70.1, 75.0 );
			SetSkill( SkillName.Tactics, 50.0 );
	  this.SetSkill(SkillName.EvalInt, 75.1, 120.0);
                       this.SetSkill(SkillName.Magery, 75.1, 120.0);
                       this.SetSkill(SkillName.MagicResist, 60.1, 75.0);
                       this.SetSkill(SkillName.Tactics, 60.1, 80.0);
           	     this.SetSkill(SkillName.Wrestling, 60.1, 80.0);
       		     this.Fame = 22500;
       		     this.Karma = -22500;

			Tamable = true;
			ControlSlots = 2;
			MinTameSkill = 90.0;

			Container pack = Backpack;

			if ( pack != null )
				pack.Delete();

			pack = new StrongBackpack();
			pack.Movable = false;

			AddItem( pack );
		}
public override void GenerateLoot()
        {
		 this.AddLoot(LootPack.FilthyRich, 3);
              this.AddLoot(LootPack.Rich, 2);
                 this.AddLoot(LootPack.MedScrolls);
                 this.AddLoot(LootPack.Gems, 5);
		 this.PackItem(new GargoylesPickaxe());
		 this.PackItem(new TreasureMap(5, Map.Felucca));
		 this.PackItem(new TreasureMap(6, Map.Felucca));
		 this.PackItem(new TreasureMap(5, Map.Trammel));
	 	 this.PackItem(new TreasureMap(6, Map.Trammel));
		
        }


        private DateTime m_NextPickup;

		public override void OnThink()
		{
			base.OnThink();

			if ( DateTime.Now < m_NextPickup )
				return;

			m_NextPickup = DateTime.Now + TimeSpan.FromSeconds( Utility.RandomMinMax( 0, 0 ) );

			Container pack = this.Backpack;

			if ( pack == null )
				return;

			ArrayList list = new ArrayList();

			foreach ( Item item in this.GetItemsInRange( 3 ) )
			{
				if ( item.Movable && item.Stackable )
					list.Add( item );
			}

			int pickedUp = 0;

			for ( int i = 0; i < list.Count; ++i )
			{
				Item item = (Item)list[i];

				if ( !pack.CheckHold( this, item, false, true ) )
					return;

				bool rejected;
				LRReason reject;

				NextActionTime = Core.TickCount;

				Lift( item, item.Amount, out rejected, out reject );

				if ( rejected )
					continue;

				Drop( this, Point3D.Zero );

				if ( ++pickedUp == 3 )
					break;
         }
	             
      }
      
		#region Pack Animal Methods
		public override bool OnBeforeDeath()
		{
			if ( !base.OnBeforeDeath() )
				return false;

			PackAnimal.CombineBackpacks( this );

			return true;
		}


		public override bool IsSnoop( Mobile from )
		{
			if ( PackAnimal.CheckAccess( this, from ) )
				return false;

			return base.IsSnoop( from );
		}

		public override bool OnDragDrop( Mobile from, Item item )
		{
			if ( CheckFeed( from, item ) )
				return true;

			if ( PackAnimal.CheckAccess( this, from ) )
			{
				AddToBackpack( item );
				return true;
			}

			return base.OnDragDrop( from, item );
		}

		public override bool CheckNonlocalDrop( Mobile from, Item item, Item target )
		{
			return PackAnimal.CheckAccess( this, from );
		}

		public override bool CheckNonlocalLift( Mobile from, Item item )
		{
			return PackAnimal.CheckAccess( this, from );
		}
            
                public override void OnDoubleClick( Mobile from )
		{
			PackAnimal.TryPackOpen( this, from );
		}

		public override void GetContextMenuEntries( Mobile from, List<ContextMenuEntry> list )
		{
			base.GetContextMenuEntries( from, list );

			PackAnimal.GetContextMenuEntries( this, from, list );
		}
		#endregion

                public TheIcyHoarder( 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();
		}
	}
}
.
 

Attachments

  • TheIcyHoarder.cs
    5 KB · Views: 1
Last edited:
Greed, Thanks so much for the info! Added the gold finally, then made some tweaks, its going to be very hard to kill, let alone tame =) My next step is making it EVO compatable. One last question. This might solve another issue too that't been irking me. I tested the IcyHoarder in Ishnar where it spawns a Paragon version and noticed several high level monsters that should spawn chests don't. I checked the paragon.cs file and ParagonChest.cs file and see no reference to who the chests spawn on and who they don't. Makes me wonder if its in the core. Anyway, how would one go about spawning a chest? I can do it in game manually where I have to type [add ParagonChest Nameforchest 1-5. 1-5 is the level of chest. Which reminds me, I'll upload the file below. I modified the ParagonChest.cs script to spawn many different rare colored chests. It runs with no errors. If you use it, it has to be copied over the ParagonChest.cs file already there. Putting it in customs generates lots of errors otherwise.
 

Attachments

  • ParagonChest.cs
    7.8 KB · Views: 3
Last edited:
Think it's something to do with this line in Paragon.cs

Code:
        public static double ChestChance = .10;// Chance that a paragon will carry a paragon chest
Big oops, forgot that was the file I changed to spawn more chests when I made the modifications for different hued chests. Got to include it. The issue I'm having, and others as well, is not all the high level Paragons are spawning chests. I ran a test at 100% spawn rate, and monsters like the Gargoyle Guardian aren't spawning them. Was looking for a script line to add them to the Paragons that are getting overlooked. I think the issue is in the core as both the ParagonChest.CS and Paragon.CS don't list any monster Ids which makes me believe its in the core itself that decides what monsters get them. I can understand why they would not spawn on something like a Paragon scorpian, but a monster like a Paragon Gargoyle Gardian should.
 
Ahh okay I see, well to add a paragon chest to a specific mobile you could add this code to the particular mobile in question using the OnDeath method:

Code:
        public override void OnDeath( Container c )
        {
            base.OnDeath( c );

            if (IsParagon)
            c.DropItem( new ParagonChest( Name, TreasureMapLevel ) );

        }

I've attached an example using your Icy Hoarder.

Now as for a check based upon the difficulty of the mobile that is a bit more tricky but definitely doable as well.

Edit - On further inspection it appears there is a bit of this, but not much. In BaseCreature.cs in the OnBeforeDeath method it checks for the treasurelevel aka treasure map level of a mobile. This would probably be a good spot to add some other checks for difficulty of a mobile e.g. strength, intelligence, magery,etc.
This is exactly what I been looking for! Can now fix the ones missing chests. Thanks again!

How do I go about telling it to spawn the map at level 5 or 6? Its showing level 0 and the few attempts I tried setting it to 5 or 6 keeps giving me errors.
 
Last edited:
Add this to the specific mobiles and then just change the 5 to w/e ^__^

Code:
        public override int TreasureMapLevel
        {
            get
            {
                return 5;
            }
        }
Took several attempts but finally got the code where no errors happen and runs like a charm.Thanks again!
 
Back