|
||
|
|||||||
| Script Support Get support for modifying RunUO Scripts, or writing your own! |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Join Date: Oct 2003
Location: Colorado
Age: 29
Posts: 808
|
What do I need to do to add this:
public override int ArtifactRarity{ get{ return 5; } } to this: using System; using Server.Network; using Server.SkillHandlers; namespace Server.Items { [FlipableAttribute( 0x12A6, 0x12A6 )] public class DoomTarot : Item, IRare { [Constructable] public DoomTarot() : base( 0x12A6 ) { Stackable = false; Weight = 10.0; Movable = false; Name = "Tarot Cards"; } public DoomTarot( 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(); } } } Thanks for the help in advance! |
|
|
|
|
|
#7 (permalink) | |
|
Join Date: Oct 2003
Location: Colorado
Age: 29
Posts: 808
|
Quote:
or do i need to type artifactrarity(sp) in there What does "sp" mean? |
|
|
|
|
|
|
#10 (permalink) |
|
Join Date: Oct 2003
Location: Colorado
Age: 29
Posts: 808
|
well i dont have the compiler on my machine here, and if i did i dont have all the required extra scripts that go along with what i am doing to see if it works, my friend has it on his computer.
And instead of sending them to him all the time I would rather get help from people that know what they are doing. But to make it better I sent them to him and they dont work, they error, so i tried a number of different things like addind these "{" & "}" or changing it from list.localized to artifact.localize and from.localize i have tried lots of things and I am guessing what is wrong is probablyreally small. Now I know you may be relunctant to help me because you want me to learn, but I need to know a link that I can go to that covers this stuff in detail. But for now will you please tell me what I am doing wrong, or how exactly I am suppose to type it. thank you. |
|
|
|
|
|
#11 (permalink) | |
|
Account Terminated
|
Quote:
I need the exact errors. Install .NET Framework and grab RunUO and test it yourself, not that hard. |
|
|
|
|
|
|
#12 (permalink) | |
|
Join Date: Oct 2003
Location: Colorado
Age: 29
Posts: 808
|
Quote:
The following errors are: this one i tried using 'list.SendLocalizedMessage' - Error: Scripts\Items\Rares\DoomRares\BloodyWater.cs: CS0117: <line 25, column 2> 'Server.ObjectPropertyList' does not contain a definition for 'SendLocalizedMessage' Scripts: One or more scripts failed to compile or no script files were found. - Press return to exit, or R to try again. and:(two seperate tries) this one i tried using 'from.SendLocalizedMessage' instead of list.SendLocalizedMessage - Error: Scripts\Items\Rares\DoomRares\BloodyWater.cs: CS0246: <line 25, column 2> The namespace 'from' could not be found <are you missing a using directive or 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. and at a seperattime i tired using 'artifactrarity().SendLocalizedMessage' and I got the same error as above about namespace. |
|
|
|
|
|
|
#15 (permalink) |
|
Join Date: Oct 2003
Location: Colorado
Age: 29
Posts: 808
|
ok that worked, now how do i get it not to say ~1_val~?
I tried to do list.add("Artifact Rarity 5") but it overwrites the name of the item, if i do it with list.add(1061078) it displays what the item is bit it the says artifact rarity ~1_val~. |
|
|
|
|
|
#16 (permalink) |
|
i got a similar problem only that the normal wat doesnt work and wnt let me put artifact rarity heres da code i want it to say artifact rarity 69
[code:1]using System; namespace Server.Items { public abstract class BaseJupCloak : BaseJupClothing { public BaseJupCloak( int itemID ) : this( itemID, 0 ) { } public BaseJupCloak( int itemID, int hue ) : base( itemID, Layer.Cloak, hue ) { } public BaseJupCloak( 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(); } } [Flipable] public class CloakOfJupiter : BaseJupCloak, IArcaneEquip { public override int ArtifactRarity{ get{ return 69; } } //THIS IS WERE I NORMALLY ADD IT AND IT USUALLY WORKS #region Arcane Impl private int m_MaxArcaneCharges, m_CurArcaneCharges; [CommandProperty( AccessLevel.GameMaster )] public int MaxArcaneCharges { get{ return m_MaxArcaneCharges; } set{ m_MaxArcaneCharges = value; InvalidateProperties(); Update(); } } [CommandProperty( AccessLevel.GameMaster )] public int CurArcaneCharges { get{ return m_CurArcaneCharges; } set{ m_CurArcaneCharges = value; InvalidateProperties(); Update(); } } [CommandProperty( AccessLevel.GameMaster )] public bool IsArcane { get{ return ( m_MaxArcaneCharges > 0 && m_CurArcaneCharges >= 0 ); } } public void Update() { if ( IsArcane ) ItemID = 0x26AD; else if ( ItemID == 0x26AD ) ItemID = 0x1515; if ( IsArcane && CurArcaneCharges == 0 ) Hue = 0; } public override void GetProperties( ObjectPropertyList list ) { base.GetProperties( list ); if ( IsArcane ) list.Add( 1061837, "{0}\t{1}", m_CurArcaneCharges, m_MaxArcaneCharges ); // arcane charges: ~1_val~ / ~2_val~ } public override void OnSingleClick( Mobile from ) { base.OnSingleClick( from ); if ( IsArcane ) LabelTo( from, 1061837, String.Format( "{0}\t{1}", m_CurArcaneCharges, m_MaxArcaneCharges ) ); } public void Flip() { if ( ItemID == 0x1515 ) ItemID = 0x1530; else if ( ItemID == 0x1530 ) ItemID = 0x1515; } #endregion [Constructable] public CloakOfJupiter() : this( 0 ) { } [Constructable] public CloakOfJupiter( int hue ) : base( 0x1515, hue ) { Weight = 5.0; Name = "Cloak Of Jupiter"; Hue = 1152; //Attributes.Luck = 200; //Attributes.BonusDex = 20; //Attributes.BonusStr = 20; //Attributes.BonusInt = 20; //Resistances.Fire = 10; //Resistances.Cold = 10; //Resistances.Poison = 10; //Resistances.Energy = 10; //Attributes.LowerManaCost = 20; //Attributes.LowerRegCost = 50; } public CloakOfJupiter( Serial serial ) : base( serial ) { } public override void Serialize( GenericWriter writer ) { base.Serialize( writer ); writer.Write( (int) 1 ); // version if ( IsArcane ) { writer.Write( true ); writer.Write( (int) m_CurArcaneCharges ); writer.Write( (int) m_MaxArcaneCharges ); } else { writer.Write( false ); } } public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); switch ( version ) { case 1: { if ( reader.ReadBool() ) { m_CurArcaneCharges = reader.ReadInt(); m_MaxArcaneCharges = reader.ReadInt(); if ( Hue == 2118 ) Hue = ArcaneGem.DefaultArcaneHue; } break; } } if ( Weight == 4.0 ) Weight = 5.0; } } }[/code:1] this error i get Scripts: Compiling C# scripts...failed (1 errors, 0 warnings) - Error: Scripts\Misc\Custom\Artifacts\CloakOfJupiter.cs: CS0115: (line 38, col umn 23) 'Server.Items.CloakOfJupiter.ArtifactRarity': no suitable method found t o override Scripts: One or more scripts failed to compile or no script files were found. - Press return to exit, or R to try again. |
|
|
|
|
|
|
#17 (permalink) |
|
Join Date: Oct 2003
Location: Colorado
Age: 29
Posts: 808
|
items dont have a 'overide' you have to change it to be like mine list.add() but i get ~1_val now
Try doing this: public override void GetProperties( ObjectPropertyList list ) { base.GetProperties( list ); list.Add(1061078); //artifact rarity~1_val~ } if its a weapon or armor you can overide, but if its an item i understand that you cant. |
|
|
|
|
|
#18 (permalink) |
|
Forum Expert
Join Date: Oct 2002
Location: Naples,FL
Age: 32
Posts: 1,552
|
To fill the value for ~var_1~ use[code:1]public override void GetProperties( ObjectPropertyList list )
{ base.GetProperties( list ); list.Add(1061078, "5"); //artifact rarity~1_val~ } [/code:1]Change the "5" to any number you want it to be, but it must be in a string format. |
|
|
|
|
|
#20 (permalink) |
|
Join Date: Oct 2003
Location: Colorado
Age: 29
Posts: 808
|
Phantom why are you so mean to people, they have simple questions, cant you try to be nicer to them. He probably didnt see that, he probably just saw that i was having troubles similar to his.
Do you have a bad day everyday and take it out on beginners in a forum? Dont answer the forum anymore if it just makes you mad, let someone else help. SHIESH.. Chill out dude. |
|
|
|
|
|
#22 (permalink) |
|
Join Date: Oct 2003
Location: Colorado
Age: 29
Posts: 808
|
Phantom why are you so mean to people, they have simple questions, cant you try to be nicer to them. He probably didnt see that, he probably just saw that i was having troubles similar to his.
Do you have a bad day everyday and take it out on beginners in a forum? Dont answer the forum anymore if it just makes you mad, let someone else help. SHIESH.. Chill out dude. |
|
|
|
|
|
#24 (permalink) | |
|
Account Terminated
|
Quote:
|
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|