|
||
|
|||||||
| Script Support Get support for modifying RunUO Scripts, or writing your own! |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Newbie
Join Date: Jun 2009
Posts: 85
|
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
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();
}
}
}
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();
}
}
}
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();
}
}
}
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();
}
}
}
|
|
|
|
|
|
#6 (permalink) |
|
Forum Novice
Join Date: Nov 2008
Age: 23
Posts: 149
|
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();
}
}
}
|
|
|
|
|
|
#10 (permalink) |
|
Forum Novice
Join Date: Nov 2008
Age: 23
Posts: 149
|
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();
}
}
}
|
|
|
|
|
|
#12 (permalink) | |
|
Forum Novice
Join Date: Nov 2008
Age: 23
Posts: 149
|
Quote:
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();
}
}
}
|
|
|
|
|
|
|
#15 (permalink) |
|
Forum Novice
Join Date: Apr 2008
Location: Messina, Sicily, Italy
Age: 26
Posts: 556
|
... 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. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|