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!

Help

Phantom

Knight
TMSTKSBK said:
Well then you have a problem.

You don't know where to start.

Maybe Phantom'll give us some ideas.

I'm flattered, but I wouldn't say that's necessarily true...I'm probably in the 70th percentile on this forum knowledge-wise. :)

P=800th!

You know more then you think you do.
 
Here's a challenge for you Phantom...

Alright, now that I have the BaseHire script, I need to combine it with a BaseJhelom file I made so that my training warriors could buy/sell weapons and bandies as well as resurrect players when they die. I could use some help on combining the two if it's alright. I'll post the BaseJhelom script if needed.
 

TMSTKSBK

Lord
Post it post it post it...

I need to see what the crap I'm dealing with here...before I can offer suggestions/code...
 
Code:
using System;
using System.Collections;
using Server;
using Server.Misc;
using Server.Items;
using Server.Gumps;

namespace Server.Mobiles
{
	public abstract class BaseJhelom : BaseVendor
	{
		private ArrayList m_SBInfos = new ArrayList();
		protected override ArrayList SBInfos{ get { return m_SBInfos; } }

		public override bool IsActiveVendor{ get{ return true; } }
		public override bool IsInvulnerable{ get{ return false; } }

		public override void InitSBInfo()
		{
			SBInfos.Add( new SBJhelom() );
		}

		public BaseJhelom() : base( null )
		{
			if ( !IsInvulnerable )
			{
				AI = AIType.AI_Melee;
				ActiveSpeed = 0.2;
				PassiveSpeed = 0.8;
				RangePerception = BaseCreature.DefaultRangePerception;
				FightMode = FightMode.Agressor;
			}

			SpeechHue = 0;

			SetHits( 137, 203 );

			Hue = Utility.RandomSkinHue();

			SetDamage( 12, 19 );

			SetDamageType( ResistanceType.Physical, 80 );
			SetDamageType( ResistanceType.Energy, 5 );
			SetDamageType( ResistanceType.Poison, 5 );
			SetDamageType( ResistanceType.Cold, 5 );
			SetDamageType( ResistanceType.Fire, 5 );

			SetResistance( ResistanceType.Physical, 80, 90 );
			SetResistance( ResistanceType.Fire, 80, 90 );
			SetResistance( ResistanceType.Cold, 80, 90 );
			SetResistance( ResistanceType.Poison, 80, 90 );
			SetResistance( ResistanceType.Energy, 80, 90 );

			SetSkill( SkillName.MagicResist, 20.0, 30.0 );
			SetSkill( SkillName.Tactics, 20.0, 30.0 );
			SetSkill( SkillName.Wrestling, 20.0, 30.0 );
			SetSkill( SkillName.Fencing, 20.0, 30.0 );
			SetSkill( SkillName.Anatomy, 20.0, 30.0 );
			SetSkill( SkillName.Healing, 20.0, 30.0 );
			SetSkill( SkillName.Parry, 20.0, 30.0 );
			SetSkill( SkillName.Magery, 20.0, 30.0 );
			SetSkill( SkillName.EvalInt, 20.0, 30.0 );
			SetSkill( SkillName.Focus, 20.0, 30.0 );
			SetSkill( SkillName.Meditation, 20.0, 30.0 );
			SetSkill( SkillName.Inscribe, 20.0, 30.0 );
			SetSkill( SkillName.Swords, 20.0, 30.0 );
			SetSkill( SkillName.Macing, 20.0, 30.0 );
			SetSkill( SkillName.SpiritSpeak, 20.0, 30.0 );
			SetSkill( SkillName.DetectHidden, 20.0, 30.0 );
			SetSkill( SkillName.Hiding, 20.0, 30.0 );
			SetSkill( SkillName.Poisoning, 20.0, 30.0 );
			SetSkill( SkillName.Ninjitsu, 20.0, 30.0 );
			SetSkill( SkillName.Bushido, 20.0, 30.0 );
			SetSkill( SkillName.Necromancy, 20.0, 30.0 );
			SetSkill( SkillName.Chivalry, 20.0, 30.0 );
			SetSkill( SkillName.Archery, 20.0, 30.0 );

			VirtualArmor = 25;

			Fame = 500;
			Karma = -500;

			PackItem( new Bandage( Utility.RandomMinMax( 15, 20 ) ) );
		}

		public virtual bool HealsYoungPlayers{ get{ return true; } }

		public virtual bool CheckResurrect( Mobile m )
		{
			return true;
		}

		private DateTime m_NextResurrect;
		private static TimeSpan ResurrectDelay = TimeSpan.FromSeconds( 1.0 );

		public virtual void OfferResurrection( Mobile m )
		{
			Direction = GetDirectionTo( m );
			Say( 501224 ); // Thou hast strayed from the path of virtue, but thou still deservest a second chance.

			m.PlaySound( 0x214 );
			m.FixedEffect( 0x376A, 10, 16 );

			m.CloseGump( typeof( ResurrectGump ) );
			m.SendGump( new ResurrectGump( m, ResurrectMessage.Healer ) );
		}

		public virtual void OfferHeal( PlayerMobile m )
		{
			Direction = GetDirectionTo( m );

			if ( m.CheckYoungHealTime() )
			{
				Say( 501229 ); // You look like you need some healing my child.

				m.PlaySound( 0x1F2 );
				m.FixedEffect( 0x376A, 9, 32 );

				m.Hits = m.HitsMax;
			}
			else
			{
				Say( 501228 ); // I can do no more for you at this time.
			}
		}

		public override void OnMovement( Mobile m, Point3D oldLocation )
		{
			if ( !m.Frozen && DateTime.Now >= m_NextResurrect && InRange( m, 4 ) && !InRange( oldLocation, 4 ) && InLOS( m ) )
			{
				if ( !m.Alive )
				{
					m_NextResurrect = DateTime.Now + ResurrectDelay;

					if ( m.Map == null || !m.Map.CanFit( m.Location, 16, false, false ) )
					{
						m.SendLocalizedMessage( 502391 ); // Thou can not be resurrected there!
					}
					else if ( CheckResurrect( m ) )
					{
						OfferResurrection( m );
					}
				}
				else if ( this.HealsYoungPlayers && m.Hits < m.HitsMax && m is PlayerMobile && ((PlayerMobile)m).Young )
				{
					OfferHeal( (PlayerMobile) m );
				}
			}
		}

		public BaseJhelom( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			if ( !IsInvulnerable )
			{
				AI = AIType.AI_Melee;
				ActiveSpeed = 0.2;
				PassiveSpeed = 0.8;
				RangePerception = BaseCreature.DefaultRangePerception;
				FightMode = FightMode.Agressor;
			}
		}
	}
}
 

Phantom

Knight
WanderingRage said:
Alright, now that I have the BaseHire script, I need to combine it with a BaseJhelom file I made so that my training warriors could buy/sell weapons and bandies as well as resurrect players when they die. I could use some help on combining the two if it's alright. I'll post the BaseJhelom script if needed.

Why don't you just modify the following system:

http://www.runuo.com/forum/showthread.php?t=50626

It has the Jhelom hireables you wanted. I found it, with about 1 minute of effort using the search function..
 
Yeah, that probably would be easiest, but I have about 4 different scripts that are needed to make my Jhelom system work. It's more complicated than just a Mobils script. I'm not that stupid. I HAD thought of that.
 

Phantom

Knight
WanderingRage said:
Yeah, that probably would be easiest, but I have about 4 different scripts that are needed to make my Jhelom system work. It's more complicated than just a Mobils script. I'm not that stupid. I HAD thought of that.

Well thats exactly where Packer898 got that code.
 
Just nevermind Phantom. This is why I told you right off that I didn't want your help. All I need now is some help with combining the scripts.
 

Phantom

Knight
WanderingRage said:
Just nevermind Phantom. This is why I told you right off that I didn't want your help. All I need now is some help with combining the scripts.

You must have added the post with the code, I didn't see it till now.
 

Packer898

Knight
I didnt think it was from a neruns script but it might be. No notes on the author in the scripts so dunno who the original author is... regardless i use it on my shard and it works great. =)-
 

Phantom

Knight
Packer898 said:
I didnt think it was from a neruns script but it might be. No notes on the author in the scripts so dunno who the original author is... regardless i use it on my shard and it works great. =)-

Since its not a default script, and thats the only thread in the submission thread with it, and I know you didn't write it yourself.

I think by doing the math, I am right.
 

Packer898

Knight
Code:
	public abstract class BaseJhelom : BaseHire

Phantom- Hell no I didnt write it myself its way WAY to complicated for me still. Hopefully you not inferring that I was trying to take credit for something I didnt do... I wasnt. And I only stated that i was unaware who the original author was but from a quick glance at the link you posted I dont believe it was nerun. Might be deeper in the thread though. Dunno.

If I wrote it tho it would have my tag on the top of it. =)-
 

Phantom

Knight
Packer898 said:
Code:
	public abstract class BaseJhelom : BaseHire

Phantom- Hell no I didnt write it myself its way WAY to complicated for me still. Hopefully you not inferring that I was trying to take credit for something I didnt do... I wasnt. And I only stated that i was unaware who the original author was but from a quick glance at the link you posted I dont believe it was nerun. Might be deeper in the thread though. Dunno.

If I wrote it tho it would have my tag on the top of it. =)-

Nerun's Distor does have this same script, It also has one the original author wants.

The hireables system is based on the same code, he remembers from over a year ago.
 
That would work, but I still get some errors since I added some lines about resurrecting the players when they die and about allowing the Jhelom warriors to sell weapons and stuff. Here are the errors:

Scripts: Compiling C# scripts...failed (6 errors, 0 warnings)
- Error: Scripts\Custom\Jhelom Training\BaseJhelom.cs: CS0115: (line 13, column
32) 'Server.Mobiles.BaseJhelom.SBInfos': no suitable method found to override
- Error: Scripts\Custom\Jhelom Training\BaseJhelom.cs: CS0115: (line 15, column
24) 'Server.Mobiles.BaseJhelom.IsActiveVendor': no suitable method found to ove
rride
- Error: Scripts\Custom\Jhelom Training\BaseJhelom.cs: CS0115: (line 16, column
24) 'Server.Mobiles.BaseJhelom.IsInvulnerable': no suitable method found to ove
rride
- Error: Scripts\Custom\Jhelom Training\BaseJhelom.cs: CS0115: (line 18, column
24) 'Server.Mobiles.BaseJhelom.InitSBInfo()': no suitable method found to overr
ide
- Error: Scripts\Custom\Jhelom Training\Jhelom Fighting Pit Warrior.cs: CS0115:
(line 205, column 24) 'Server.Mobiles.Warrior.InitSBInfo()': no suitable method
found to override
- Error: Scripts\Custom\Jhelom Training\Jhelom Fighting Pit Warrior.cs: CS0115:
(line 210, column 24) 'Server.Mobiles.Warrior.CheckResurrect(Server.Mobile)': n
o suitable method found to override
 

Phantom

Knight
You need to add those properties and methods to your script in order to use them.

You should use WinMerge to merge your code with the working system ( if you don't want to just use the working system ).
 

Phantom

Knight
WanderingRage said:
I can't figure out how to work this WinMerger thing...

You load one file, then you load the other file, and you compare the two scripts.

The program also has its own documentation.
 

Murzin

Knight
what i would do, is embed the "hire" timer check inside the on-think and if its in combat or in a dungeon, delete, otherwise clear command and owner and control master and flag as innocent.
 
Top