|
||
|
|||||||
| Script Support Get support for modifying RunUO Scripts, or writing your own! |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Join Date: May 2003
Posts: 2,848
|
How do you set the meditation allowance for a piece of armor? I wanted to make a custom piece of plate armor, but I can't figure out how to get the meditation allowance set to "all."
Oh, and how do I make the localized message "Mage Armor" appear on the property list of the armor on a mouse-over? |
|
|
|
|
|
#3 (permalink) |
|
Join Date: May 2003
Posts: 2,848
|
Well, I'm trying to script OSI artifacts into my shard, and the Inquisitor's Resolution gloves are Mage Armor... so i need to figure out how to get it to say "Mage Armor" on the mouse-over property list of the item, and I need to know how to script in MeditationAllowance-All.
|
|
|
|
|
|
#4 (permalink) | |
|
Account Terminated
|
Quote:
Look up the int number, using Krrio's Clilic viewer |
|
|
|
|
|
|
#5 (permalink) |
|
Join Date: May 2003
Posts: 2,848
|
Okay, well here is the code for InquisitorsResolution.cs:
[code:1]using System; using Server.Items; namespace Server.Items { [FlipableAttribute( 0x1414, 0x1418 )] public class InquisitorsResolution : BaseArmor { public override int BasePhysicalResistance{ get{ return 5; } } public override int BaseFireResistance{ get{ return 3; } } public override int BaseColdResistance{ get{ return 22; } } public override int BasePoisonResistance{ get{ return 3; } } public override int BaseEnergyResistance{ get{ return 17; } } public override int InitMaxHits{ get{ return 225; } } [Constructable] public InquisitorsResolution() : base( 0x1414, 40, ArmorMaterialType.Plate, ArmorBodyType.Gloves ) { Weight = 1; Hue = 1266; DexBonus = -2; StrRequirement = 30; Name = " Inquisitor's Resolution "; Attributes.ArtifactRarity = 10; MaxHitPoints = 255; HitPoints = 255; Attributes.CastRecovery = 3; Attributes.LowerManaCost = 8; 1060437; } public InquisitorsResolution( 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:1] I added the Localized Message # (1060437) to the properties list: [code:1][Constructable] public InquisitorsResolution() : base( 0x1414, 40, ArmorMaterialType.Plate, ArmorBodyType.Gloves ) { Weight = 1; Hue = 1266; DexBonus = -2; StrRequirement = 30; Name = " Inquisitor's Resolution "; Attributes.ArtifactRarity = 10; MaxHitPoints = 255; HitPoints = 255; Attributes.CastRecovery = 3; Attributes.LowerManaCost = 8; 1060437; }[/code:1] And it comes up with this error: [code:1]Error: Scripts\Custom Scripts\Artifacts\InquisitorsResolution.cs: CS1519: <line 15, column 23> Only assignment, call, increment, decrement, and new object expressions can be used as a statement[/code:1] |
|
|
|
|
|
#8 (permalink) |
|
Join Date: Nov 2002
Posts: 61
|
Im not 100% sure of this but lets say 99%. Mage armor in Osi is not meditationall, but 1/2. I had a bard with zero meditation on Osi, and using mage armor did slow a lot my med rate, so i didn't used them. I guess using Mage armor give the same regen rate as studded armor, coz i was wearing leather, and saw a huge slow when puting mage armor on this char (i say this coz im not sure RunUo meditallow 1/2 = Osi med rate of studded)
|
|
|
|
|
|
#10 (permalink) | |
|
Join Date: May 2003
Posts: 2,848
|
Quote:
[code:1]'Server.Items.BaseArmor.MeditationAllowance' dontaes a 'property' where a 'class' was expected[/code:1] [code:1]Static member 'Server.Items.ArmorMeditationAllowance.All' cannot be accessed with an instance referance; qualify it with a type name instead[/code:1] And how do I get the message "Mage Armor" to display in the properties mouse-over? |
|
|
|
|
|
|
#11 (permalink) |
|
Forum Administrator
Join Date: Aug 2002
Posts: 2,850
|
Sorry, try:
[code:1]MeditationAllowance = ArmorMeditationAllowance.All;[/code:1] Use the localization viewer in the downloads section to add properties in the GetProperties method. There are many examples of this. |
|
|
|
|
|
#13 (permalink) |
|
Forum Expert
Join Date: Oct 2002
Location: Naples,FL
Age: 32
Posts: 1,552
|
Dipends on if you want the name to be magic armor then you do an public override int LabelTo {get{return 1060437}} if you add it to the property list then you have to override the AddNameProperties.
|
|
|
|
|
|
#17 (permalink) |
|
Forum Expert
Join Date: Oct 2002
Location: Naples,FL
Age: 32
Posts: 1,552
|
Dipending on if you want it on the bottom or top of the list you'd use either the first or the second[code:1]
public override void AddNameProperties( ObjectPropertyList list ) { base.AddNameProperties( list ); list.Add("Mage Armor"); } [/code:1][code:1] public override void AddNameProperties( ObjectPropertyList list ) { list.Add("Mage Armor"); base.AddNameProperties( list ); } [/code:1] |
|
|
|
|
|
#20 (permalink) |
|
Forum Expert
Join Date: Oct 2002
Location: Naples,FL
Age: 32
Posts: 1,552
|
If you use the labelTo override it'll change the name if you just use the override addnameproperties exactly how I showed you, the top one will list Mage armor at the bottom and the bottom one will list it at the top of the current property list. If you have a locilized text instead of "mage armor" you can use the int. Also if it doesn't list the name and you want the name on top the mage armor then the rst you can do[code:1] public override void AddNameProperties( ObjectPropertyList list )
{ list.Add(Name); list.Add("Mage Armor"); base.AddNameProperties( list ); } [/code:1]or if you want to have NAME [Mage Armor] on top you can use [code:1] public override void AddNameProperties( ObjectPropertyList list ) { list.Add(Name + " [Mage Armor]"); base.AddNameProperties( list ); } [/code:1] The combination are quite a few as are the options on how to do it. Don't mean to sound rude but I'm sorry, don't expect further help from me for I have shown you the way but you haven't shown that you even tried to play with what I gave you to try and figure it out. It seems that you want the code just handed to you which I don't like doing, I try to help people not do hand outs unless I have no samples to refer to, which wasn't the case here. |
|
|
|
|
|
#22 (permalink) |
|
Join Date: May 2003
Posts: 2,848
|
Well, I tried the addnameproperties and the getproperties methods, but it always makes the first property on the object property list the name of the item... I got "Mage Armor" to appear at the bottom with this code:
[code:1] public override void GetProperties( ObjectPropertyList list ) { base.GetProperties( list ); list.Add( " Mage Armor " ); }[/code:1] But it still puts the first property on the object list in the place of the name. I tired to add list.add( name ); into this code in several differenet places, but each time it comes up with the same results... a property in the place of the name... |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|