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!

having problem's with a CTF and DD script im working on..

Devinticus

Wanderer
having problem's with a CTF and DD script im working on..

this is my error im getting

Code:
Errors:
 + Misc/Notoriety.cs:
    CS0117: Line 332: 'Server.Spells.Necromancy.TransformationSpell' does not co
ntain a definition for 'UnderTransformation'
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.

Here is the inside of the Noteriety.cs this code line is refering too. I'm giving 2 or 3 lines higher and lower so u can really see what i got going on.

Code:
			if ( !(target is BaseCreature && ((BaseCreature)target).InitialInnocent) )
			{
				if ( !target.Body.IsHuman && !target.Body.IsGhost && !IsPet( target as BaseCreature ) && !Server.Spells.Necromancy.TransformationSpell.UnderTransformation( target ) )
					return Notoriety.CanBeAttacked;
			}

Any help would be greatly appriciated... seem's this is the last part im missing to finish this script thanks.
 

Bujinsho

Page
Try this:

Code:
if ( !target.Body.IsHuman && !target.Body.IsGhost && !IsPet( target as BaseCreature ) && !Server.TransformationSpellHelper.UnderTransformation( target ) )
 

Devinticus

Wanderer
It's giving me the same thing just a hair different.

Code:
Errors:
 + Misc/Notoriety.cs:
    CS0234: Line 332: The type or namespace name 'TransformationSpellhelper' doe
s not exist in the namespace 'Server' (are you missing 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.
 

Bujinsho

Page
Code:
&& !Server.Spells.TransformationSpellHelper.UnderTransformation( target ) )

This is the code you are trying to call:

Code:
	public class TransformationSpellHelper
	{
		#region Context Stuff
		private static Dictionary<Mobile, TransformContext> m_Table = new Dictionary<Mobile, TransformContext>();

		public static void AddContext( Mobile m, TransformContext context )
		{
			m_Table[m] = context;
		}

		public static void RemoveContext( Mobile m, bool resetGraphics )
		{
			TransformContext context = GetContext( m );

			if( context != null )
				RemoveContext( m, context, resetGraphics );
		}

		public static void RemoveContext( Mobile m, TransformContext context, bool resetGraphics )
		{
			if( m_Table.ContainsKey( m ) )
			{
				m_Table.Remove( m );

				List<ResistanceMod> mods = context.Mods;

				for( int i = 0; i < mods.Count; ++i )
					m.RemoveResistanceMod( mods[i] );

				if( resetGraphics )
				{
					m.HueMod = -1;
					m.BodyMod = 0;
				}

				context.Timer.Stop();
				context.Spell.RemoveEffect( m );
			}
		}

		public static TransformContext GetContext( Mobile m )
		{
			TransformContext context = null;

			m_Table.TryGetValue( m, out context );

			return context;
		}

		[COLOR="Red"]public static bool UnderTransformation( Mobile m )
		{
			return (GetContext( m ) != null);[/COLOR]
		}

		public static bool UnderTransformation( Mobile m, Type type )
		{
			TransformContext context = GetContext( m );

			return (context != null && context.Type == type);
		}
		#endregion

Its is Spellhelper.cs
 

Bujinsho

Page
No ... you just have to find the right way to call it...

maybe like this:

Code:
&& ![COLOR="Red"]Server.Spells.TransformationSpellHelper.UnderTransformation[/COLOR]( target ) )

The bool "UnderTransformation" is part of the "TransformationSpellHelper" Class which is in the Namespace "Server.Spells"

So you either call it fully qualified like:

Code:
Server.Spells.TransformationSpellHelper.UnderTransformation

or you can put the Namespace at the top of the file like:

Code:
using Server.Spells

and that will let you call it like:

Code:
TransformationSpellHelper.UnderTransformation

If you only call it once it makes little difference I guess, but if you call many classes or methods from a namespace then you should put the "using statement in the script header.
 

Devinticus

Wanderer
Alright, that seemed to do the trick now when i get in game and type [add ctfgame it comes up with a target cursor and when i try to target the ground it comes up with this msg in the lower left hand corner

USAGE:
CTFGame int32 numTeams

it doesnt place anything on the ground just show's that in the lower left hand corner of the screen any help on this subject will be greatly appriciated and thanks again for all the help thusfar.

-Devinticus
 

Bujinsho

Page
That is saying that the command needs to be followed by 2 variables (probably both numbers) so you would need to type for example:

[add ctfgame 10 2

Obviously the actual numbers are up to you ... I just picked them out of the air for demo purposes
 

Devinticus

Wanderer
Thanks for the advice... what i ended up doing was just trying a bunch of various stuff

[add ctfgame 10 2
[add ctfgame 32 10

stuff like that but what i did find to work was

[add ctfgame 10

that's as far as i've gotten yet thought i'd post as i was going :) thank you so much for helping this far i really do appriciate it. =D
 
Top