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] Cleric Spells

oiii88

Sorceror
Well I thought I had it fixed and working. But using the version Tru posted. It will not bring up the gump for any player after a single use of it...

IE: New player logs in uses command " I pray to the gods" and gets the spell gump. But once they close it the gods will no longer listen to them.. Everytime after this it says "The gods refuse to listen" Ive adjusted karma levels on players since this system uses karma ... But it does not even help. Anyone got a clue what might be up?
 
I got a crash issue with the banish evil spell. It isnt the same one you posted about a slayer something or other though. Mine was when I casted it, and clicked on myself, it crashed.

Code:
Server Crash Report
===================

RunUO Version 2.0, Build 2864.17588
Operating System: Microsoft Windows NT 5.1.2600 Service Pack 2
.NET Framework: 2.0.50727.832
Time: 1/5/2008 12:29:04 PM
Mobiles: 2908
Items: 134081
Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
   at Server.Spells.Custom.BanishEvilSpell.Target(Mobile m)
   at Server.Spells.Custom.BanishEvilSpell.InternalTarget.OnTarget(Mobile from, Object o)
   at Server.Targeting.Target.Invoke(Mobile from, Object targeted)
   at Server.Network.PacketHandlers.TargetResponse(NetState state, PacketReader pvSrc)
   at Server.Network.MessagePump.HandleReceive(NetState ns)
   at Server.Network.MessagePump.Slice()
   at Server.Core.Main(String[] args)

If there is a fix I am missing for this can you please point it out. Running on 3 hours of sleep because I couldnt quit thinking about my dang shard lol.
 

Ednyved

Sorceror
I'm attaching my version of BanishEvil, a slightly modified version of Tru's updates for 187, which has a couple changes. The slayer issue is fixed (it now looks for exorcism, not daemon), and there's a special little bit of protection I've put in against using the spell on the Dark Father. When a player targets the Dark Father with this spell, the DF says, "Your pitiful prayer amuses me, mortal! Consider it answered!" and hits the player with a white flamestrike for damage.

It has given us no crashes since the changes. Hope it can help both you and others interested in using this spell set, as well.

Thanks again to Tru, who got the entire set working for 187.
 

Attachments

  • BanishEvil.cs
    3.1 KB · Views: 97
Well I think it worked cause so far so good, I logged in and cast it, and clicked on myself just like before and no crash, I actually got a little message at the bottom of the screen saying that basicly I couldnt click that on myself. So Thank you so much. Plus karma headed your way.
 

Vythic

Sorceror
Yay!

This is exactly the script I was looking for.

One big question. What the hell is Piety, where is your current level of it listed, and how do you raise it?
I don't see it in the skill listing, and not in [props on my character either.

EDIT:

I searched and found out piety is just tithing points. Was hoping for a new skill.
Well, bad news, as soon as I cast one of these spells, it crashed my server.

Anyone have this working for runUO 2.0, latest svn?
 

M_0_h

Page
Vythic;821406 said:
I searched and found out piety is just tithing points. Was hoping for a new skill.
Well, bad news, as soon as I cast one of these spells, it crashed my server.

Anyone have this working for runUO 2.0, latest svn?

Posting the crash log would help for a start ;)
 

wildman1920

Wanderer
i got this script downloaded and everything compiled fine, but when i try to use the commande "i pray to the gods" just like the instructions say in order to pull up the gump it tells me "the gods will not listen to you" i have my tithing points maxxed, karma maxxed, fame maxxed, str dex int, maxxed, and all my skills maxed, not sure what else i need to do. here is my speech.cs which is the command script which is suppose to have the spells gump pop up.

Code:
using System;
using System.Collections;
using Server.Mobiles;
using Server.Gumps;
using Server.Targeting;
using Server.Items;
using Server.Prompts;

namespace Server
{
	public class ClericCommands
	{
		public static void Initialize()
		{
			EventSink.Speech += new SpeechEventHandler( Speech_Event );
		}

		public static void Speech_Event( SpeechEventArgs e )
		{
			if ( e.Speech.ToLower().IndexOf( "i pray to the gods" ) != -1 )
			{
				if ( !e.Mobile.CheckAlive() )
	
				{
                                   e.Mobile.SendMessage( "You begin praying to the Gods for help..." );
			           if (e.Mobile.Karma < 250 && e.Mobile.Str < 10 && e.Mobile.Skills[SkillName.Necromancy].Base<=0.1)
                                     e.Mobile.SendMessage( "You lack the Strentgh of Conviction to plead with the Gods!" );
                                     else
                                     e.Mobile.SendMessage( "The Gods grant you the gift of life at the cost of Karma and Strength!" );
				     e.Mobile.Karma = e.Mobile.Karma - 200;
				     e.Mobile.SendMessage( "You lost 200 Karma." );
                                     e.Mobile.Str = e.Mobile.Str-1;
                                     e.Mobile.SendMessage( "You lost 1 Strength Point." );
				     e.Mobile.Resurrect();
				}
                                else if(e.Mobile.Skills[SkillName.Necromancy].Base>=0.1)
                                {
                                e.Mobile.SendMessage( "The Gods will not listen to you!" );
                                }
				else
				{
                                        e.Mobile.CloseGump( typeof ( ClericGump ) );
					e.Mobile.SendGump( new ClericGump( e.Mobile ) );
				}
			}
                        if ( e.Speech.ToLower().IndexOf( "i summon the spirits of the underworld" ) != -1 )
			{
				e.Mobile.SendMessage( "You cry havoc of past sins to the underworld..." );
                           if (e.Mobile.Karma > -250 && e.Mobile.Str < 10)
                           {
                                e.Mobile.SendMessage( "You lack the essence to trade your soul for life!" );
                           }
			   else if ( !(e.Mobile.Alive) )
			   {
				e.Mobile.SendMessage( "The unerworld grants you the gift of life at the cost of Karma and Strength!" );
				e.Mobile.Karma = e.Mobile.Karma + 250;
                                e.Mobile.SendMessage( "You gain 200 Karma." );
				e.Mobile.Str = e.Mobile.Str-1;
				e.Mobile.SendMessage( "You lost 1 Strength Point." );
				e.Mobile.Resurrect();
			   }
			   else
                           {
                                e.Mobile.SendMessage( "You aren't dead fool!" );
                           }
		       }
		}
	}
}
 

Warloxx

Sorceror
if your Necro is to high it will tell you that...

Code:
 else if(e.Mobile.Skills[SkillName.Necromancy].Base>=0.1)
 

Devinc07

Sorceror
im getting an error when compiling. anyone know how to fix it?

RunUO - [www.runuo.com] Version 2.1, Build 3641.39010
Core: Running on .NET Framework Version 2.0.50727
Core: Optimizing for 2 processors
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
Errors:
+ Customs/Cleric Spells 2 0/AngelicFaith.cs:
CS0117: Line 75: 'Server.Items.DisguiseGump' does not contain a definition f
or 'IsDisguised'
CS0117: Line 105: 'Server.Items.DisguiseGump' does not contain a definition
for 'IsDisguised'
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
 

Warloxx

Sorceror
I don't remeber all I did to make this system work but here is my "AngelicFaith.cs" script.

Code:
using System;
using System.Collections;
using Server.Targeting;
using Server.Network;
using Server.Mobiles;
using Server.Items;
using Server.Spells.Seventh;
using Server.Gumps;

namespace Server.Spells.Custom
{
	public class AngelicFaithSpell : ClericSpell
	{
		private static SpellInfo m_Info = new SpellInfo(
				"Angelic Faith", "Angelus Terum",
				//SpellCircle.Eighth,
				212,
				9041
			);

		public override int RequiredTithing{ get{ return 100; } }
		public override double RequiredSkill{ get{ return 80.0; } }
                public override int RequiredMana { get { return 0; } }
                public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds( 0.25 ); } }
                
		private static Hashtable m_Table = new Hashtable();

		public AngelicFaithSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
		{
		}

		public static bool HasEffect( Mobile m )
		{
			return ( m_Table[m] != null );
		}

		public static void RemoveEffect( Mobile m )
		{
			object[] mods = (object[])m_Table[m];

			if ( mods != null )
			{
				m.RemoveStatMod( ((StatMod)mods[0]).Name );
				m.RemoveStatMod( ((StatMod)mods[1]).Name );
				m.RemoveStatMod( ((StatMod)mods[2]).Name );
				m.RemoveSkillMod( (SkillMod)mods[3] );
				m.RemoveSkillMod( (SkillMod)mods[4] );
				m.RemoveSkillMod( (SkillMod)mods[5] );
			}

			m_Table.Remove( m );

			m.EndAction( typeof( AngelicFaithSpell ) );

			m.BodyMod = 0;
		}

		public override bool CheckCast()
		{
			if ( !base.CheckCast() )
			{
				return false;
			}
			else if ( !Caster.CanBeginAction( typeof( AngelicFaithSpell ) ) )
			{
				Caster.SendLocalizedMessage( 1005559 );
				return false;
			}
                        else if( Caster.BodyMod != 0 )
			//else if ( Necromancy.TransformationSpell.UnderTransformation( Caster ) )
			{
				Caster.SendMessage( "You cannot transform while in that form." );
				return false;
			}
			else if ( DisguiseTimers.IsDisguised( Caster ) )
			{
				Caster.SendMessage( "You cannot transform while disguised." );
				return false;
			}
			else if ( Caster.BodyMod == 183 || Caster.BodyMod == 184 )
			{
				Caster.SendMessage( "You cannot transform while wearing body paint." );
				return false;
			}
			else if ( !Caster.CanBeginAction( typeof( PolymorphSpell ) ) )
			{
				Caster.SendMessage( "You cannot transform while polymorphed." );
				return false;
			}

			return true;
		}		

		public override void OnCast()
		{
			if ( !Caster.CanBeginAction( typeof( AngelicFaithSpell ) ) )
			{
				Caster.SendLocalizedMessage( 1005559 );
			}
                        else if( Caster.BodyMod != 0 )
			//else if ( Necromancy.TransformationSpell.UnderTransformation( Caster ) )
			{
				Caster.SendMessage( "You cannot transform while in that form." );
			}
			else if ( DisguiseTimers.IsDisguised( Caster ) )
			{
				Caster.SendMessage( "You cannot transform while disguised." );
			}
			else if ( Caster.BodyMod == 183 || Caster.BodyMod == 184 )
			{
				Caster.SendMessage( "You cannot transform while wearing body paint." );
			}
			else if ( !Caster.CanBeginAction( typeof( PolymorphSpell ) ) )
			{
				Caster.SendMessage( "You cannot transform while polymorphed." );
			}
			else if ( CheckSequence() )
			{
				object[] mods = new object[]
				{
					new StatMod( StatType.Str, "[Cleric] Str Offset", 20, TimeSpan.Zero ),
					new StatMod( StatType.Dex, "[Cleric] Dex Offset", 20, TimeSpan.Zero ),
					new StatMod( StatType.Int, "[Cleric] Int Offset", 20, TimeSpan.Zero ),
					new DefaultSkillMod( SkillName.Macing, true, 20 ),
					new DefaultSkillMod( SkillName.Healing, true, 20 ),
					new DefaultSkillMod( SkillName.Anatomy, true, 20 )
				};

				m_Table[Caster] = mods;

				Caster.AddStatMod( (StatMod)mods[0] );
				Caster.AddStatMod( (StatMod)mods[1] );
				Caster.AddStatMod( (StatMod)mods[2] );
				Caster.AddSkillMod( (SkillMod)mods[3] );
				Caster.AddSkillMod( (SkillMod)mods[4] );
				Caster.AddSkillMod( (SkillMod)mods[5] );

				double span = 10.0 * DivineFocusSpell.GetScalar( Caster );
				new InternalTimer( Caster, TimeSpan.FromMinutes( (int)span ) ).Start();

				IMount mount = Caster.Mount;

				if ( mount != null )
					mount.Rider = null;

				Caster.BodyMod = 123;
				Caster.BeginAction( typeof( AngelicFaithSpell ) );
				Caster.PlaySound( 0x165 );
				Caster.FixedParticles( 0x3728, 1, 13, 0x480, 92, 3, EffectLayer.Head );
			}
		}


		private class InternalTimer : Timer
		{
			private Mobile m_Owner;
			private DateTime m_Expire;

			public InternalTimer( Mobile owner, TimeSpan duration ) : base( TimeSpan.Zero, TimeSpan.FromSeconds( 0.1 ) )
			{
				m_Owner = owner;
				m_Expire = DateTime.Now + duration;
			}

			protected override void OnTick()
			{
				if ( DateTime.Now >= m_Expire )
				{
					AngelicFaithSpell.RemoveEffect( m_Owner );
					Stop();
				}
			}
		}
	}
}

Look it over and see what is diffrent from yours.
 

sangriento

Sorceror
Errors:
+ nuevos/Cleric Spells 2 0/HammerOfFaith.cs:
CS0115: Line 87: 'Server.Spells.Custom.HammerOfFaithSpell.HammerOfFaith.GetD
amageTypes(Server.Mobile, out int, out int, out int, out int, out int)': no se e
ncontró ningún miembro adecuado que reemplazar
 

Hammerhand

Knight
DamageTypes changed a few years back.. there are 7 now.
Phys, Fire, Cold, Pois, Nrgy, Chaos, Direct.
You'll need to add the Chaos & Direct to that & anything else that shows that error.
 
Top