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!

[RunUO 2.0 RC1] Summoning Brazier from Deceit (OSI style)

Summoning Brazier from Deceit (OSI style)

Credits:
The packetinfo is taken from SpyUO.
Description:
A copy of the brazier in Deceit from OSI.
The spawning creatures might be off tho, you can set them in the Type[] of the script.
Istallation:
Plug and play - right-click&save-as the cs or create a new cs file and put in:
Code:
using System;
using Server.Mobiles;
using Server.Network;

namespace Server.Items
{
	public class DeceitBrazier : Brazier
	{
		private Type[] m_SpawnTypes = new Type[]
			{
				typeof( FireSteed ), typeof( FireSteed ), typeof( FireSteed ), // additional fire steed entries to increase chance
				typeof( Bogle ), typeof( BoneKnight ), typeof( EarthElemental ),
				typeof( Ettin ), typeof( GazerLarva ), typeof( Ghoul ),
				typeof( Golem ), typeof( HeadlessOne ), typeof( Mummy ),
				typeof( Ogre ), typeof( OgreLord ), typeof( RottingCorpse ),
				typeof( Sewerrat ), typeof( Skeleton ), typeof( Slime ),
				typeof( Zombie ), typeof( AirElemental ), typeof( DreadSpider ),
				typeof( Efreet ), typeof( Lich ), typeof( Nightmare ),
				typeof( PoisonElemental ), typeof( GiantBlackWidow ), typeof( SilverSerpent ),
				typeof( ToxicElemental ), typeof( Alligator ), typeof( BloodElemental ),
				typeof( BoneMagi ), typeof( Cyclops ), typeof( Daemon ),
				typeof( DireWolf ), typeof( Dragon ), typeof( Drake ),
				typeof( ElderGazer ), typeof( FireElemental ), typeof( FireGargoyle ),
				typeof( FireSteed ), typeof( Gargoyle ), typeof( Gazer ),
				typeof( GiantRat ), typeof( GiantSerpent ), typeof( GiantSpider ),
				typeof( Harpy ), typeof( HellHound ), typeof( Imp ),
				typeof( PredatorHellCat ), typeof( LavaLizard ), typeof( LavaSerpent ),
				typeof( LavaSnake ), typeof( Lizardman ), typeof( Mongbat ),
				typeof( StrongMongbat ), typeof( Orc ), typeof( OrcBomber ),
				typeof( OrcBrute ), typeof( OrcCaptain ), typeof( OrcishLord ),
				typeof( OrcishMage ), typeof( Ratman ), typeof( RatmanArcher ),
				typeof( RatmanMage ), typeof( Scorpion ), typeof( Shade ),
				typeof( SkeletalMage ), typeof( HellCat ), typeof( Snake ),
				typeof( Spectre ), typeof( StoneGargoyle ), typeof( StoneHarpy ),
				typeof( Titan ), typeof( Troll ), typeof( Wraith ), typeof( Wyvern ),
				typeof( LichLord ), typeof( SkeletalKnight )
			};

		private DateTime m_NextSummon;

		[Constructable]
		public DeceitBrazier()
		{
		}

		public override bool HandlesOnMovement{ get{ return true; } }

		public override void OnMovement( Mobile m, Point3D oldLocation )
		{
			if ( DateTime.Now > m_NextSummon && m.Player && !(m.AccessLevel > AccessLevel.Player && m.Hidden) && m.InRange( this, 2 ) && !PointsInRange( oldLocation.X, oldLocation.Y, X, Y, 2 ) )
				PublicOverheadMessage( MessageType.Regular, 0x3B2, 500761 ); // Heed this warning well, and use this brazier at your own peril.

			base.OnMovement( m, oldLocation );
		}

		public static bool PointsInRange( int px, int py, int qx, int qy, int distance )
		{
			return !(Math.Abs( px - qx ) > distance || Math.Abs( py - qy ) > distance);
		}

		public override void OnDoubleClick( Mobile from )
		{
			if ( DateTime.Now > m_NextSummon && from.InRange( this, 2 ) )
				BrazierSummon();
			else
				PublicOverheadMessage( MessageType.Regular, 0x3B2, 500760 ); // The brazier fizzes and pops, but nothing seems to happen.
		}

		public void BrazierSummon()
		{
			Mobile summon = Activator.CreateInstance( m_SpawnTypes[Utility.Random(m_SpawnTypes.Length)] ) as Mobile;
			Point3D point = new Point3D( X - 4, Y, Z );
			summon.MoveToWorld( point, Map );
			summon.Paralyze( TimeSpan.FromSeconds( 2 ) );

			GraphicalEffects.SendGraphicalEffect( point, Map, EffectType.FixedXYZ, 0x3709, 2, 56, true, false );

			m_NextSummon = DateTime.Now + TimeSpan.FromMinutes( 15 );
		}

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

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

			writer.WriteEncodedInt( 0 ); // version

			writer.Write( (DateTime) m_NextSummon );
		}

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

			int version = reader.ReadEncodedInt();

			m_NextSummon = reader.ReadDateTime();
		}
	}

	public static class GraphicalEffects
	{
		public static void SendGraphicalEffect( Point3D origin, Map map, EffectType type, int graphic, int speed, int duration, bool fixedDirection, bool explode )
		{
			if ( map != null )
			{
				IPooledEnumerable eable = map.GetClientsInRange( origin );

				Packet p = new GraphicalEffect( type, Serial.Zero, Serial.Zero, graphic, origin, origin, speed, duration, fixedDirection, explode );
				p.Acquire();

				foreach ( NetState state in eable )
				{
					state.Mobile.ProcessDelta();

					state.Send( p );
				}

				p.Release();

				eable.Free();
			}
		}
	}

	public sealed class GraphicalEffect : Packet
	{
		public GraphicalEffect( EffectType type, Serial from, Serial to, int graphic, Point3D fromPoint, Point3D toPoint, int speed, int duration, bool fixedDirection, bool explode ) : base( 0x70, 28 )
		{
			m_Stream.Write( (byte) type );
			m_Stream.Write( (int) from );
			m_Stream.Write( (int) to );
			m_Stream.Write( (short) graphic );
			m_Stream.Write( (short) fromPoint.X );
			m_Stream.Write( (short) fromPoint.Y );
			m_Stream.Write( (sbyte) fromPoint.Z );
			m_Stream.Write( (short) toPoint.X );
			m_Stream.Write( (short) toPoint.Y );
			m_Stream.Write( (sbyte) toPoint.Z );
			m_Stream.Write( (byte) speed );
			m_Stream.Write( (byte) duration );

			m_Stream.Write( (byte) 0 );
			m_Stream.Write( (byte) 0 );

			m_Stream.Write( (bool) fixedDirection );
			m_Stream.Write( (bool) explode );
		}
	}
}

Changelog:
From 1.0b to 1.0c - fixed that any monster could make the brazier warning pop up.
To Version 1.0b - fixed message didn't pop up.
 

Attachments

  • DeceitBrazier.cs
    5.4 KB · Views: 285
A

Allmight

Guest
Sweet. I was about to make this one myself, but now you saved me the time :)

About the monsters. The brazier is capable of spawning EVERY monster that is naturally occuring in the faccet it is located on, Trammel/Felucca. Lost Lands not included. There is a description of it here...

http://uo.stratics.com/content/atlas/deceit.php

Have not checked the whole list, maybe thats what you done already. Just wanted to mention it.
 
Hehe, maybe I should have added credits to Erica. She was the person I pestered to know which monsters get spawned. I left the nightmare in tho, ppl can remove it if they don't think it's appropriate.
 
Top