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!

No reagent consumed for Gamemaster/Admin

viront

Sorceror
No reagent consumed for Gamemaster/Admin

I didn't see anything about this when I was searching and I thought it was kinda useful. If you want your Gamemasters and GMs to cast spells without having to carry regs you need to find Spell.cs, default is RunUO 1.0\Scripts\Spells\Base\Spell.cs

scroll down to line 157 in unmodified Spell.cs and add the code in red
Code:
		public virtual bool ConsumeReagents()
		{
			[COLOR="Red"]if ( m_Caster.AccessLevel >= AccessLevel.GameMaster )
				return true;[/COLOR]

			if ( m_Scroll != null || !m_Caster.Player )
				return true;

			if ( AosAttributes.GetValue( m_Caster, AosAttribute.LowerRegCost ) > Utility.Random( 100 ) )
				return true;

			Container pack = m_Caster.Backpack;

			if ( pack == null )
				return false;

			if ( pack.ConsumeTotal( m_Info.Reagents, m_Info.Amounts ) == -1 )
				return true;

			if ( GetType().BaseType == typeof( Spell ) )
			{
				if ( ArcaneGem.ConsumeCharges( m_Caster, 1 + (int)Circle ) )
					return true;
			}

			return false;
		}
 
Top