Go Back   RunUO - Ultima Online Emulation > RunUO > Script Support

Script Support Get support for modifying RunUO Scripts, or writing your own!

Reply
 
Thread Tools Display Modes
Old 07-02-2009, 08:35 PM   #1 (permalink)
Newbie
 
Join Date: Jun 2009
Posts: 85
Default 4 Scripts

i get this error on 4 scripts i made


Code:
Errors:
 + DexMakesYouFaster.cs:
    CS0117: Line 17: 'Server.AosAttributes' does not contain a definition for 'C
astingSpeed'
    CS0117: Line 18: 'Server.AosAttributes' does not contain a definition for 'C
astingSpeedRecovery'
 + DexoftheHeaven.cs:
    CS0117: Line 22: 'Server.AosAttributes' does not contain a definition for 'C
astingSpeed'
    CS0117: Line 23: 'Server.AosAttributes' does not contain a definition for 'C
astingSpeedRecovery'
 + Talisman.cs:
    CS0103: Line 20: The name 'Attributes' does not exist in the current context

    CS0103: Line 21: The name 'Attributes' does not exist in the current context

    CS0103: Line 22: The name 'Attributes' does not exist in the current context

 + Talismans.cs:
    CS0103: Line 20: The name 'Attributes' does not exist in the current context

    CS0103: Line 21: The name 'Attributes' does not exist in the current context

    CS0103: Line 22: The name 'Attributes' does not exist in the current context
dex of heavens is the goldring the dexmakesyoufast is the bracelet and the otehr two are talismans here are there scripts



gold ring:

Code:
using System;
using Server;

namespace Server.Items
{
	public class DexoftheHeaven : GoldRing
	{

		[Constructable]
		public DexoftheHeaven()
		{
			Name = "Dex of the Heaven";
			Hue = 1453;
			Weight = 1;
			Attributes.AttackChance = 15;
			Attributes.BonusDex = 8;
			Attributes.CastingSpeed = 1;
			Attributes.CastingSpeedRecovery = 3;
		}

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

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

			writer.Write( (int) 0 );
		}

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

			int version = reader.ReadInt();
		}

	}
}
goldbracelet

Code:
using System;
using Server;

namespace Server.Items
{
	public class DexMakesYouFaster : GoldBracelet
	{

		[Constructable]
		public DexMakesYouFaster()
		{
			Name = "Dex Makes You Faster";
			Hue = 1456;
			Weight = 1;
			Attributes.AttackChance = 15;
			Attributes.BonusDex = 8;
			Attributes.CastingSpeed = 1;
			Attributes.CastingSpeedRecovery = 3;
		}

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

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

			writer.Write( (int) 0 );
		}

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

			int version = reader.ReadInt();
		}

	}
}
talisman

Code:
using System;
using Server;

namespace Server.Items
{
	public class Talis : Item
	{

		[Constructable]
		public Talis() : base( 12123 )
		{
			Name = "CUTTED";
			Hue = 1246;
			Weight = 1;
			Attributes.BonusStr = 1;
			Attributes.WeaponDamage = 20;
			Attributes.RegenHits = 2;
		}

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

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

			writer.Write( (int) 0 );
		}

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

			int version = reader.ReadInt();
		}

	}
}
talismans

Code:
using System;
using Server;

namespace Server.Items
{
	public class Tali : Item
	{

		[Constructable]
		public Tali() : base( 12123 )
		{
			Name = "Your Gay?";
			Hue = 1246;
			Weight = 1;
			Attributes.BonusStr = 1;
			Attributes.WeaponDamage = 20;
			Attributes.RegenHits = 2;
		}

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

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

			writer.Write( (int) 0 );
		}

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

			int version = reader.ReadInt();
		}

	}
}
please help thanks.
firefox_3031 is offline   Reply With Quote
Old 07-02-2009, 08:39 PM   #2 (permalink)
Forum Novice
 
Prophet2005's Avatar
 
Join Date: Nov 2008
Age: 23
Posts: 149
Default

because AoSAttributes.CastSpeed is incorrect its

Attributes.CastSpeed = AMOUNT;
Prophet2005 is offline   Reply With Quote
Old 07-02-2009, 08:45 PM   #3 (permalink)
Forum Novice
 
Prophet2005's Avatar
 
Join Date: Nov 2008
Age: 23
Posts: 149
Default

And with the tailisman its BaseTalisman too call from not from an itemid
Prophet2005 is offline   Reply With Quote
Old 07-02-2009, 08:47 PM   #4 (permalink)
Newbie
 
Join Date: Jun 2009
Posts: 85
Default

there is no AOSAttributes.CastSpeed look it jsut says Attributes
firefox_3031 is offline   Reply With Quote
Old 07-02-2009, 08:49 PM   #5 (permalink)
Newbie
 
Join Date: Jun 2009
Posts: 85
Default

and so what dod i change for talisman?
firefox_3031 is offline   Reply With Quote
Old 07-02-2009, 08:55 PM   #6 (permalink)
Forum Novice
 
Prophet2005's Avatar
 
Join Date: Nov 2008
Age: 23
Posts: 149
Default

Quote:
Originally Posted by firefox_3031 View Post
and so what dod i change for talisman?
You need to make a BaseTalisman Script too call from and set the base for the talisman too BaseTalisman

Code:
using System;
using Server;

namespace Server.Items
{
	public class Tali : Item
	{

		[Constructable]
		public class YourGay : BaseTalisman  /////////////////////READ HERE
		{
			Name = "Your Gay?";
			Hue = 1246;
			Weight = 1;
			Attributes.BonusStr = 1;
			Attributes.WeaponDamage = 20;
			Attributes.RegenHits = 2;
		}

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

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

			writer.Write( (int) 0 );
		}

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

			int version = reader.ReadInt();
		}

	}
}
Prophet2005 is offline   Reply With Quote
Old 07-02-2009, 08:56 PM   #7 (permalink)
Newbie
 
Join Date: Jun 2009
Posts: 85
Default

ya but ther only error im getting is attributes does not contain?
firefox_3031 is offline   Reply With Quote
Old 07-02-2009, 08:57 PM   #8 (permalink)
Forum Novice
 
Prophet2005's Avatar
 
Join Date: Nov 2008
Age: 23
Posts: 149
Default

Quote:
Originally Posted by firefox_3031 View Post
ya but ther only error im getting is attributes does not contain?
Because Your calling from an item therefore your stating that itemid XXXXX has these Attributes and it does not because it is a picture
Prophet2005 is offline   Reply With Quote
Old 07-02-2009, 08:59 PM   #9 (permalink)
Newbie
 
Join Date: Jun 2009
Posts: 85
Default

well then i cant make base talisman script
firefox_3031 is offline   Reply With Quote
Old 07-02-2009, 09:00 PM   #10 (permalink)
Forum Novice
 
Prophet2005's Avatar
 
Join Date: Nov 2008
Age: 23
Posts: 149
Default

Quote:
Originally Posted by firefox_3031 View Post
well then i cant make base talisman script

There is the code now call it from BaseTalisman


Code:
using System;
using Server.Engines.Craft;
using System.Collections;
using Server.Network;
using Server.Items;
using Server.Targeting;
using Server.Spells.Necromancy;
using Server.Spells.Fourth;

namespace Server.Items
{
	public enum TalismanRemovalType
	{
		None			= 0,
		CurseRemoval	= 1,
		DamageRemoval	= 2,
		WardRemoval		= 3
	}

	public enum TalismanSummonType
	{
		None			= 0,
		Bandage			= 1,
		Board			= 2,
		Ingot			= 3,
		Arrow			= 4,
		MageRegs		= 5,
		NecroRegs		= 6,
		Bolt			= 7
	}

	public class BaseTalisman : BaseClothing
	{
		private string m_Owner = null;
		private bool m_Useable;
		private TalismanRemovalType m_RemovalType = TalismanRemovalType.None;
		private TalismanSummonType m_SummonType = TalismanSummonType.None;
		private DateTime m_LastUsed;
		private DateTime m_LastSummoned;

		#region Props
		[CommandProperty(AccessLevel.GameMaster)]
		public TalismanSummonType SummonType
		{
			get{return m_SummonType;}
			set{m_SummonType = value;}
		}

		[CommandProperty(AccessLevel.GameMaster)]
		public DateTime LastSummoned
		{
			get{return m_LastSummoned;}
		}

		[CommandProperty(AccessLevel.GameMaster)]
		public DateTime LastUsed
		{
			get{return m_LastUsed;}
		}

		[CommandProperty(AccessLevel.GameMaster)]
		public TalismanRemovalType RemovalType
		{
			get{return m_RemovalType;}
			set{m_RemovalType = value;}
		}

		[CommandProperty(AccessLevel.GameMaster)]
		public bool Useable
		{
			get{return m_Useable;}
			set{m_Useable = value;}
		}
		[CommandProperty(AccessLevel.GameMaster)]
		public string Owner
		{
			get{return m_Owner;}
			set{m_Owner = value;}
		}
		#endregion

		public BaseTalisman( int itemID, int hue ) : base( itemID,Layer.Talisman, hue )
		{
			m_LastUsed = DateTime.Now - TimeSpan.FromSeconds(30.0);
			m_LastSummoned = DateTime.Now - TimeSpan.FromMinutes(10.0);
			
		}

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

		public override bool OnEquip( Mobile from )
		{
			if(m_Owner != from.Name && m_Owner != null)
			{
				from.SendMessage(String.Format("You can not equip these, they belong to {0}",m_Owner));
				return false;
			}
			if(m_Owner == null)
			{
				from.SendMessage("you bind this item to you...");
				m_Owner = from.Name;
				InvalidateProperties();
			}
			return base.OnEquip(from);
		}

		public override void OnDoubleClick( Mobile m ) 
		{
			if ( this.Parent == m )
			{
				if(m.Name == m_Owner)
				{
					#region Removal Types
					if(m_RemovalType != TalismanRemovalType.None)
					{
						if(m.Name == Owner )
						{
							if(m_RemovalType == TalismanRemovalType.DamageRemoval)
							{
								if (DateTime.Now >= m_LastUsed+TimeSpan.FromMinutes(2.0))
								{
									m.PlaySound( 0xF6 );
									m.PlaySound( 0x1F7 );
									BleedAttack.EndBleed( m, false );
									MortalStrike.EndWound( m );
									m.SendMessage("you have been purged of all damage effects.");
									m_LastUsed = DateTime.Now;
								}
								else
								{
									m.SendMessage("you must wait a while before using this again..");
								}
							}
							if(m_RemovalType == TalismanRemovalType.CurseRemoval)
							{
								if(m.Name == Owner )
								{
									if (DateTime.Now >= m_LastUsed+TimeSpan.FromMinutes(2.0))
									{
										m.PlaySound( 0xF6 );
										m.PlaySound( 0x1F7 );
										StatMod mod;
										mod = m.GetStatMod( "[Magic] Str Offset" );
										if ( mod != null && mod.Offset < 0 )
											m.RemoveStatMod( "[Magic] Str Offset" );

										mod = m.GetStatMod( "[Magic] Dex Offset" );
										if ( mod != null && mod.Offset < 0 )
											m.RemoveStatMod( "[Magic] Dex Offset" );

										mod = m.GetStatMod( "[Magic] Int Offset" );
										if ( mod != null && mod.Offset < 0 )
											m.RemoveStatMod( "[Magic] Int Offset" );

										m.Paralyzed = false;

										EvilOmenSpell.CheckEffect( m );
										StrangleSpell.RemoveCurse( m );
										CorpseSkinSpell.RemoveCurse( m );
										CurseSpell.RemoveEffect( m );

										BuffInfo.RemoveBuff( m, BuffIcon.Clumsy );
										BuffInfo.RemoveBuff( m, BuffIcon.FeebleMind );
										BuffInfo.RemoveBuff( m, BuffIcon.Weaken );
										BuffInfo.RemoveBuff( m, BuffIcon.MassCurse );
										m.SendMessage("you have been purged of all cursed effects.");
										m_LastUsed = DateTime.Now;
									}
									else
									{
										m.SendMessage("you must wait a while before using this again..");
									}
								}
								else
								{
									m.SendMessage("you may not use this.");
								}

							}
						}
						else
						{
							m.SendMessage("you may not use this.");
						}
					}
					#endregion
					#region Summon Types
					if( m_SummonType != TalismanSummonType.None)
					{
						if(m.Name == m_Owner)
						{

							#region Summon Bandage
							if(m_SummonType == TalismanSummonType.Bandage)
							{
								if (DateTime.Now >= m_LastSummoned+TimeSpan.FromMinutes(15.0))
								{
									if ( m.PlaceInBackpack( new Bandage(50) ) )
									{
										m.SendMessage("you summon some bandages.");
										m_LastSummoned = DateTime.Now;
									}
									else
									{
										m.SendMessage("you need more room in your backpack to do this.");
									}
								}
								else
								{
									m.SendMessage("you must wait a while before using this again..");
								}
							}
							#endregion
							#region Summon board
							if(m_SummonType == TalismanSummonType.Board)
							{
								if (DateTime.Now >= m_LastSummoned+TimeSpan.FromMinutes(15.0))
								{
									if ( m.PlaceInBackpack( new Board(50) ) )
									{
										m.SendMessage("you summon some boards.");
										m_LastSummoned = DateTime.Now;
									}
									else
									{
										m.SendMessage("you need more room in your backpack to do this.");
									}
								}
								else
								{
									m.SendMessage("you must wait a while before using this again..");
								}
							}
							#endregion
							#region Summon Ingots
							if(m_SummonType == TalismanSummonType.Ingot)
							{
								if (DateTime.Now >= m_LastSummoned+TimeSpan.FromMinutes(15.0))
								{
									if ( m.PlaceInBackpack( new IronIngot(50) ) )
									{
										m.SendMessage("you summon some iron ingots.");
										m_LastSummoned = DateTime.Now;
									}
									else
									{
										m.SendMessage("you need more room in your backpack to do this.");
									}
								}
								else
								{
									m.SendMessage("you must wait a while before using this again..");
								}
							}
							#endregion
							#region Summon Arrow
							if(m_SummonType == TalismanSummonType.Arrow)
							{
								if (DateTime.Now >= m_LastSummoned+TimeSpan.FromMinutes(15.0))
								{
									if ( m.PlaceInBackpack( new Arrow(50) ) )
									{
										m.SendMessage("you summon some Arrows.");
										m_LastSummoned = DateTime.Now;
									}
									else
									{
										m.SendMessage("you need more room in your backpack to do this.");
									}
								}
								else
								{
									m.SendMessage("you must wait a while before using this again..");
								}
							}
							#endregion
							#region Summon MageRegs
							if(m_SummonType == TalismanSummonType.MageRegs)
							{
								if (DateTime.Now >= m_LastSummoned+TimeSpan.FromMinutes(15.0))
								{
									if ( m.PlaceInBackpack( new BagOfReagents(10) ) )
									{
										m.SendMessage("you summon some reagents.");
										m_LastSummoned = DateTime.Now;
									}
									else
									{
										m.SendMessage("you need more room in your backpack to do this.");
									}
								}
								else
								{
									m.SendMessage("you must wait a while before using this again..");
								}
							}
							#endregion
							#region Summon NecroRegs
							if(m_SummonType == TalismanSummonType.NecroRegs)
							{
								if (DateTime.Now >= m_LastSummoned+TimeSpan.FromMinutes(15.0))
								{
									if ( m.PlaceInBackpack( new BagOfNecroReagents(10) ) )
									{
										m.SendMessage("you summon some necro reagents.");
										m_LastSummoned = DateTime.Now;
									}
									else
									{
										m.SendMessage("you need more room in your backpack to do this.");
									}
								}
								else
								{
									m.SendMessage("you must wait a while before using this again..");
								}
							}
							#endregion
							#region Summon Bolt
							if(m_SummonType == TalismanSummonType.Bolt)
							{
								if (DateTime.Now >= m_LastSummoned+TimeSpan.FromMinutes(15.0))
								{
									if ( m.PlaceInBackpack( new Bolt(50) ) )
									{
										m.SendMessage("you summon some bolts.");
										m_LastSummoned = DateTime.Now;
									}
									else
									{
										m.SendMessage("you need more room in your backpack to do this.");
									}
								}
								else
								{
									m.SendMessage("you must wait a while before using this again..");
								}
							}
							#endregion

						}
					}
					#endregion
				}
				else if (m_Owner == null)
				{
					m.SendMessage("you bind this item to you...");
					m_Owner = m.Name;
					InvalidateProperties();
				}
				else
				{
					m.SendMessage("you cannot use this talisman");
				}
			}
		}

		public override void GetProperties( ObjectPropertyList list )
		{	
			base.GetProperties( list );
			#region Binding
			if(m_Owner == null)
			{
				list.Add(1060658,"Owned By\t{0}","Nobody");
				list.Add(1060659,"Use\t{0}","Equip to Bind");
			}
			else
				list.Add(1060658, "Bound To\t{0}",m_Owner);
			#endregion
			#region Removals
			// Removals
			if(m_RemovalType == TalismanRemovalType.CurseRemoval)
				list.Add(1060659,"Use\t{0}","Curse Removal");
			if(m_RemovalType == TalismanRemovalType.DamageRemoval)
				list.Add(1060659,"Use\t{0}","Damage Removal");
			#endregion
			#region Summons
			// Summons
			if(m_SummonType == TalismanSummonType.Bandage)
				list.Add(1060659,"Use\t{0}","Summon Bandages");
			if(m_SummonType == TalismanSummonType.Board)
				list.Add(1060659,"Use\t{0}","Summon Boards");
			if(m_SummonType == TalismanSummonType.Ingot)
				list.Add(1060659,"Use\t{0}","Summon Iron Ingots");
			if(m_SummonType == TalismanSummonType.Arrow)
				list.Add(1060659,"Use\t{0}","Summon Arrows");
			if(m_SummonType == TalismanSummonType.Bolt)
				list.Add(1060659,"Use\t{0}","Summon Bolts");
			if(m_SummonType == TalismanSummonType.MageRegs)
				list.Add(1060659,"Use\t{0}","Summon Mage Reagents");
			if(m_SummonType == TalismanSummonType.NecroRegs)
				list.Add(1060659,"Use\t{0}","Summon Necro Reagents");
			#endregion
		}

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

			writer.Write( (int) 0 ); // version
			writer.Write( (bool)m_Useable);
			writer.Write( (string)m_Owner);
			writer.Write( (DateTime) m_LastUsed);
			writer.Write( (DateTime) m_LastSummoned);
		}

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

			int version		= reader.ReadInt();
			m_Useable		= reader.ReadBool();
			m_Owner			= reader.ReadString();
			m_LastUsed		= reader.ReadDateTime();
			m_LastSummoned	= reader.ReadDateTime();
		}

		

	}
}
Prophet2005 is offline   Reply With Quote
Old 07-02-2009, 09:22 PM   #11 (permalink)
Newbie
 
Join Date: Jun 2009
Posts: 85
Default

ok so
i got that now what do i change in the talisman script like armor talisman?
firefox_3031 is offline   Reply With Quote
Old 07-02-2009, 10:15 PM   #12 (permalink)
Forum Novice
 
Prophet2005's Avatar
 
Join Date: Nov 2008
Age: 23
Posts: 149
Default

Quote:
Originally Posted by firefox_3031 View Post
ok so
i got that now what do i change in the talisman script like armor talisman?

Here is an example of what they will need too look like

Code:
using System;
using Server;

namespace Server.Items
{
	public class totemofthevoid : BaseTalisman
	{
		public override int LabelNumber{ get{ return 1024246; } } // Talisman

		[Constructable]
		public totemofthevoid() : base( 0x2F5B, 0 )
		{
			Name = "Totem Of The Void";
			
			Attributes.LowerManaCost = 10;
			Attributes.RegenHits = 2;
			Attributes.BonusStr = 1;
			Weight = 1.0;
		}

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

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

			writer.Write( (int) 0 ); // version
		}

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

			int version = reader.ReadInt();
		}
	}
}
Prophet2005 is offline   Reply With Quote
Old 07-02-2009, 11:20 PM   #13 (permalink)
Newbie
 
Join Date: Jun 2009
Posts: 85
Default

thanks i used this to make mine and btw you know how to make total resist script?
firefox_3031 is offline   Reply With Quote
Old 07-03-2009, 01:34 AM   #14 (permalink)
Newbie
 
Join Date: Jun 2009
Posts: 85
Default

hi waiting...
firefox_3031 is offline   Reply With Quote
Old 07-03-2009, 03:56 AM   #15 (permalink)
Forum Novice
 
Thilgon's Avatar
 
Join Date: Apr 2008
Location: Messina, Sicily, Italy
Age: 26
Posts: 556
Default

... firefox, why don't you open same *random* files and look at them?
something like... basearmor, baseweapon, baseshield, basetalisman, baseclothin, basejewel, and so on?

you will find WHATEVER you need about items in those.
Thilgon is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5