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!

BaseQuest System

Fury

Wanderer
BaseQuest System (Updated to 1.0)

Summary:
Naturalist, Ambitious, Matriarch, Christmas
Quest


Description:
Updated for Runuo 1.0 support... added checks so both systems can coexist.. you cant start a basequest while on a runuo quest and vise-versa.... Quests altered to use runuos plantsystem.

Full Quests using Shadoze BaseQuest. Christmas quest description in a thread below.. only reposting this one cause shadoze asked me to. Also a command added [QuestCleanup to remove any misc quest objects in the world.. which should only happen if say a player gets deleted while on a quest. Improved the ants acid spitting, fixed a crash with the bag of sending and ill post my modifications to stealing.cs for any who want it as stealing should revoke your friendship with the ants.


Installation:
Modify your existing playermobile using instructions included. You will also need to make minor alterations to PlantHue.cs and QuestSystem.cs as indicated in the readme. Go to folder Mobiles/Monster/Ants and delete the Ants folder.. go to folder Items/Food and delete Beverage.cs Drop all scripts into a custom folder.
 

Attachments

  • FullBaseQuests2.3.zip
    71.9 KB · Views: 1,827
C

cscroop

Guest
ok, I have installed this and it is working fine except for one thing.

In the naturalist quest there is code to lay out the nest regions. When entering these regions the player is supposed to be get a message saying they begin to study the nest, assuming they are on the SolenHiveStudy quest. However, nothing happens at all. The player accepts the quest from the naturalist and then goes to the nests and nothing.

Any ideas. I have made no changes to the quest code at all.
 

Fury

Wanderer
Check that you are on the right map.. or change the script to what map you want. I believe the default map is set to Trammel.
 

Fury

Wanderer
Stealing.cs

Code:
using System;
using Server;
using Server.Mobiles;
using Server.Targeting;
using Server.Items;
using Server.Network;

namespace Server.SkillHandlers
{
	public class Stealing
	{
		public static void Initialize()
		{
			SkillInfo.Table[33].Callback = new SkillUseCallback( OnUse );
		}

		public static readonly bool ClassicMode = false;
		public static readonly bool SuspendOnMurder = false;

		public static bool IsInGuild( Mobile m )
		{
			return ( m is PlayerMobile && ((PlayerMobile)m).NpcGuild == NpcGuild.ThievesGuild );
		}

		public static bool IsInnocentTo( Mobile from, Mobile to )
		{
			return ( Notoriety.Compute( from, (Mobile)to ) == Notoriety.Innocent );
		}

		private class StealingTarget : Target
		{
			private Mobile m_Thief;

			public StealingTarget( Mobile thief ) : base ( 1, false, TargetFlags.None )
			{
				m_Thief = thief;

				AllowNonlocal = true;
			}

			private Item TryStealItem( Item toSteal, ref bool caught )
			{
				Item stolen = null;

				object root = toSteal.RootParent;

				if ( !IsEmptyHanded( m_Thief ) )
				{
					m_Thief.SendLocalizedMessage( 1005584 ); // Both hands must be free to steal.
				}
				else if ( root is Mobile && ((Mobile)root).Player && IsInnocentTo( m_Thief, (Mobile)root ) && !IsInGuild( m_Thief ) )
				{
					m_Thief.SendLocalizedMessage( 1005596 ); // You must be in the thieves guild to steal from other players.
				}
				else if ( SuspendOnMurder && root is Mobile && ((Mobile)root).Player && IsInGuild( m_Thief ) && m_Thief.Kills > 0 )
				{
					m_Thief.SendLocalizedMessage( 502706 ); // You are currently suspended from the thieves guild.
				}
				else if ( root is BaseVendor && ((BaseVendor)root).IsInvulnerable )
				{
					m_Thief.SendLocalizedMessage( 1005598 ); // You can't steal from shopkeepers.
				}
				else if ( root is PlayerVendor )
				{
					m_Thief.SendLocalizedMessage( 502709 ); // You can't steal from vendors.
				}
				else if ( !m_Thief.CanSee( toSteal ) )
				{
					m_Thief.SendLocalizedMessage( 500237 ); // Target can not be seen.
				}
				else if ( toSteal.Parent == null || !toSteal.Movable || toSteal.LootType == LootType.Newbied || toSteal.CheckBlessed( root ) )
				{
					m_Thief.SendLocalizedMessage( 502710 ); // You can't steal that!
				}
				else if ( !m_Thief.InRange( toSteal.GetWorldLocation(), 1 ) )
				{
					m_Thief.SendLocalizedMessage( 502703 ); // You must be standing next to an item to steal it.
				}
				else if ( toSteal.Parent is Mobile )
				{
					m_Thief.SendLocalizedMessage( 1005585 ); // You cannot steal items which are equiped.
				}
				else if ( root == m_Thief )
				{
					m_Thief.SendLocalizedMessage( 502704 ); // You catch yourself red-handed.
				}
				else if ( root is Mobile && ((Mobile)root).AccessLevel > AccessLevel.Player )
				{
					m_Thief.SendLocalizedMessage( 502710 ); // You can't steal that!
				}
				else if ( root is Mobile && !m_Thief.CanBeHarmful( (Mobile)root ) )
				{
				}
				else
				{
					double w = toSteal.Weight + toSteal.TotalWeight;

					if ( w > 10 )
					{
						m_Thief.SendMessage( "That is too heavy to steal." );
					}
					else
					{
						if ( toSteal.Stackable && toSteal.Amount > 1 )
						{
							int maxAmount = (int)((m_Thief.Skills[SkillName.Stealing].Value / 10.0) / toSteal.Weight);

							if ( maxAmount < 1 )
								maxAmount = 1;
							else if ( maxAmount > toSteal.Amount )
								maxAmount = toSteal.Amount;

							int amount = Utility.RandomMinMax( 1, maxAmount );

							if ( amount >= toSteal.Amount )
							{
								int pileWeight = (int)Math.Ceiling( toSteal.Weight * toSteal.Amount );
								pileWeight *= 10;

								if ( m_Thief.CheckTargetSkill( SkillName.Stealing, toSteal, pileWeight - 22.5, pileWeight + 27.5 ) )
									stolen = toSteal;
							}
							else
							{
								int pileWeight = (int)Math.Ceiling( toSteal.Weight * amount );
								pileWeight *= 10;

								if ( m_Thief.CheckTargetSkill( SkillName.Stealing, toSteal, pileWeight - 22.5, pileWeight + 27.5 ) )
								{
									stolen = toSteal.Dupe( amount );
									toSteal.Amount -= amount;
								}
							}
						}
						else
						{
							int iw = (int)Math.Ceiling( w );
							iw *= 10;

							if ( m_Thief.CheckTargetSkill( SkillName.Stealing, toSteal, iw - 22.5, iw + 27.5 ) )
								stolen = toSteal;
						}

						if ( stolen != null )
							m_Thief.SendLocalizedMessage( 502724 ); // You succesfully steal the item.
						else
							m_Thief.SendLocalizedMessage( 502723 ); // You fail to steal the item.

						caught = ( m_Thief.Skills[SkillName.Stealing].Value < Utility.Random( 150 ) );
					}
				}

				return stolen;
			}

			protected override void OnTarget( Mobile from, object target )
			{
				from.RevealingAction();

				Item stolen = null;
				object root = null;
				bool caught = false;

				if ( target is Item )
				{
					root = ((Item)target).RootParent;
					stolen = TryStealItem( (Item)target, ref caught );
				} 
				else if ( target is Mobile )
				{
					PlayerMobile theif = from as PlayerMobile;

					if( theif.SolenFriendship == SolenFriend.Red )
					{
						if( target is RedSolenQueen || target is RedSolenWarrior || target is RedSolenWorker || target is RedSolenInfiltratorQueen || target is RedSolenInfiltratorWarrior )
							theif.SolenFriendship = SolenFriend.None;
					}

					if( theif.SolenFriendship == SolenFriend.Black )
					{
						if( target is BlackSolenQueen || target is BlackSolenWarrior || target is BlackSolenWorker || target is BlackSolenInfiltratorQueen || target is BlackSolenInfiltratorWarrior )
							theif.SolenFriendship = SolenFriend.None;
					}

					Container pack = ((Mobile)target).Backpack;

					if ( pack != null && pack.Items.Count > 0 )
					{
						int randomIndex = Utility.Random( pack.Items.Count );

						root = target;
						stolen = TryStealItem( (Item) pack.Items[randomIndex], ref caught );
					}
				} 
				else 
				{
					m_Thief.SendLocalizedMessage( 502710 ); // You can't steal that!
				}

				if ( stolen != null )
					from.AddToBackpack( stolen );

				if ( caught )
				{
					if ( root == null )
					{
						m_Thief.CriminalAction( false );
					}
					else if ( root is Corpse && ((Corpse)root).IsCriminalAction( m_Thief ) )
					{
						m_Thief.CriminalAction( false );
					}
					else if ( root is Mobile )
					{
						Mobile mobRoot = (Mobile)root;

						if ( !IsInGuild( mobRoot ) && IsInnocentTo( m_Thief, mobRoot ) )
							m_Thief.CriminalAction( false );

						string message = String.Format( "You notice {0} trying to steal from {1}.", m_Thief.Name, mobRoot.Name );

						foreach ( NetState ns in m_Thief.GetClientsInRange( 8 ) )
						{
							if ( ns != m_Thief.NetState )
								ns.Mobile.SendMessage( message );
						}
					}
				}
				else if ( root is Corpse && ((Corpse)root).IsCriminalAction( m_Thief ) )
				{
					m_Thief.CriminalAction( false );
				}

				if ( root is Mobile && ((Mobile)root).Player && m_Thief is PlayerMobile && IsInnocentTo( m_Thief, (Mobile)root ) && !IsInGuild( (Mobile)root ) )
				{
					PlayerMobile pm = (PlayerMobile)m_Thief;

					pm.PermaFlags.Add( (Mobile)root );
					pm.Delta( MobileDelta.Noto );
				}
			}
		}

		public static bool IsEmptyHanded( Mobile from )
		{
			if ( from.FindItemOnLayer( Layer.OneHanded ) != null )
				return false;

			if ( from.FindItemOnLayer( Layer.TwoHanded ) != null )
				return false;

			return true;
		}

		public static TimeSpan OnUse( Mobile m )
		{
			if ( !IsEmptyHanded( m ) )
			{
				m.SendLocalizedMessage( 1005584 ); // Both hands must be free to steal.
			}
			else
			{
				m.Target = new Stealing.StealingTarget( m );
				m.RevealingAction();

				m.SendLocalizedMessage( 502698 ); // Which item do you want to steal?
			}

			return TimeSpan.FromSeconds( 10.0 );
		}
	}
}
 

cward

Wanderer
tenderheart said:
how or where do i install this so it will work case i put in in coustom folder and it didnt let me start sever :confused:

Theres a file called Readme.txt in the Quest folder, it has your answers.
 

vaghabundo

Wanderer
victoria error

Tru said:
heres the Victoria portion of the Doom gauntlet converted for furys base quest system (ie the 1000 daemon bones to Victoria to summon the BoneDaemon to get the gold skull) the BoneDaemon is named DoomBonedaemon so you can leave the distro one and this includes my version of the gold skull
Btw I didnt write this I just converted it from the other base quest system and added some stuff..
VictoriaQuest



Hi :)

Can you give me a litle help please in fixing this error i get?

error:

Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
- Error: Scripts\Customs\Quests\VictoriaQuest\VictoriasQuest.cs: CS0246: (line 20, column 26) The type or namespace name 'dovPlayerMobile' could not be found (are you missing a using directive or an assembly reference?)
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.​


thank you!
 

tobagin

Sorceror
public override Boolean LogCompletedObjectives{ get{ return false; } }

LogCompletedObjectives does not exist in the BaseQuest!?!?!

I get an error in this whem I add the VictoriasQuest
 
error

yea uh when i added the quest system u said we needed UOT's plant growing system right? well i added it and when i started up my server it worked fine i did quests and all then i left to go do stuff and i took shard down, i came back and booted shard up and it said like

World: Loading...An error was encountered while loading a saved object
- Type: Server.Mobiles.PlayerMobile
- Serial: 0x00000001
Delete the object? <y/n>
y
Delete all objects of that type? <y/n>
y
After pressing return an exception will be thrown and the server will terminate

Error:
System.Exception: Load failed <items=False, mobiles=True, guilds=False, Regions=False, type=Server.Mobiles.PlayerMobile, serial=0x00000001> ---> System.ArguementOutOfRangeException: capacity was less than the current size.
Parameter name: capacity
at System.Collections.ArrayList..ctor<Int32 capacity>
at Server.Mobile.Deserialization<GenericReader reader>
at Server.Mobiles.PlayerMobile.Deserialize<GenericReader reader>
at ServerWorld.Load<>
--- End of inner exception stack trace ---
at ServerWorld.Load<>
at Server.ScriptCompiler.Compile<Boolean debug>
at Server.Core.Main<String[] args>
This exception is fatal, press return to exit

after i get that i try restarting my server and it works but if i restart my server no matter if i do quest or noti will get that error, any help would be appriciated. Thanks =/
s0ulshad0w355
 

Mortis

Knight
Small bug.

Bracelet of Binding allows players to do jail breaks.

Also lets player go to a player in jail.

I did this to fix it.

In the GoToTwin method

Code:
				if ( from.Region is Server.Regions.Jail )// Added to stop jail breaks.
				{
					from.SendLocalizedMessage( 1041530, "", 0x35 ); // You'll need a better jailbreak plan then that!
			              }
				else if ( ((Mobile)twin.Parent).Region is Server.Regions.Jail )// Added to stop players from going to a player in jail.
				{
					from.SendMessage(  0x35, "The Bracelet glows black. The bracelet's target is in jail" ); 
			              }

As.
Code:
		public virtual void GoToTwin( Mobile from, BraceletOfBinding braceletofbinding ) 
		{ 
			if ( braceletofbinding.Charges > 0 ) 
			{ 
				Item twin = braceletofbinding.Bound; 
          
				if ( twin == null || !(twin.Parent is Mobile) ) 
				{ 
					from.SendLocalizedMessage( 1054006 ); 
				} 
				if ( from.Region is Server.Regions.Jail )// Added to stop jail breaks.
				{
					from.SendLocalizedMessage( 1041530, "", 0x35 ); // You'll need a better jailbreak plan then that!
			              }
				else if ( ((Mobile)twin.Parent).Region is Server.Regions.Jail )// Added to stop players from going to a player in jail.
				{
					from.SendMessage(  0x35, "The Bracelet glows black. The bracelet's target is in jail" ); 
			              }
				else if ( ((Mobile)twin.Parent).Map != from.Map ) 
				{ 
					from.SendLocalizedMessage( 1054014 ); 
				} 
				else 
				{ 
					from.SendLocalizedMessage( 1054015 ); 
					Effects.SendLocationParticles( EffectItem.Create( from.Location, from.Map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 2023 ); 
					from.Location = ((Mobile)twin.Parent).Location; 
					from.PlaySound( 0x1FC ); 
					braceletofbinding.Charges--; 
				} 
			} 
			else 
			{ 
				from.SendLocalizedMessage( 1054005 ); 
			} 
		}

Of course you could use the localizeation message here.

Code:
				else if ( ((Mobile)twin.Parent).Region is Server.Regions.Jail )// Added to stop players from going to a player in jail.
				{
					from.SendLocalizedMessage( 1054006 ); //The bracelet emits a red glow. The bracelet's twin is not available for transport.
			              }

I used a string. Saying the player with the other bracelet is in jail.
 
ok, i tried changing the GoToTwin method to what you posted, if that was what i was supposed to do... and im still getting a similar error except instead of 0x00000001 its 0x00000003 so.. i dunno once again any help would be appriciated :confused: possible some of my other custom scripts could interfere with this maybe? sorry if im a complete idiot if the problem is obvious
 

Mortis

Knight
s0ulshad0w355 said:
ok, i tried changing the GoToTwin method to what you posted, if that was what i was supposed to do... and im still getting a similar error except instead of 0x00000001 its 0x00000003 so.. i dunno once again any help would be appriciated :confused: possible some of my other custom scripts could interfere with this maybe? sorry if im a complete idiot if the problem is obvious

Your problem is with serialization/deserializeation in PlayerMobile.cs.

With the PlantSystem addition.

The bug I posted was for those who allready have it working properly.

Maybe you should post you PlayerMobile.cs and the edits you have made to it here. Easier to help you that way.
 
Top