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 10-28-2003, 12:17 AM   #1 (permalink)
 
Join Date: Oct 2003
Location: Colorado
Age: 29
Posts: 808
Default Help with adding ArtifactRarity to script

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!
SphericalSolaris is offline   Reply With Quote
Old 10-28-2003, 12:33 AM   #2 (permalink)
Account Terminated
 
Join Date: Sep 2002
Age: 26
Posts: 3,846
Send a message via ICQ to Phantom Send a message via AIM to Phantom Send a message via MSN to Phantom
Default

The Item class doesn't have ArtifactRarity so you can't do it that way.

One solution is to add it directly to the Property list using the correct method.
Phantom is offline   Reply With Quote
Old 10-28-2003, 12:55 AM   #3 (permalink)
 
Join Date: Oct 2003
Location: Colorado
Age: 29
Posts: 808
Default

what correct method is that, I do not know what you mean.
I am brandnew to making script, just better at modifying it.
SphericalSolaris is offline   Reply With Quote
Old 10-28-2003, 01:06 AM   #4 (permalink)
Account Terminated
 
Join Date: Sep 2002
Age: 26
Posts: 3,846
Send a message via ICQ to Phantom Send a message via AIM to Phantom Send a message via MSN to Phantom
Default

public override void GetProperties( ObjectPropertyList list )
{
base.GetProperties( list );

}

Add the localized message for ArticfactRaritey(sp) look it up using the Localized Viewer Krriors wrote.
Phantom is offline   Reply With Quote
Old 10-28-2003, 01:11 AM   #5 (permalink)
 
Join Date: Oct 2003
Location: Colorado
Age: 29
Posts: 808
Default

does it have something to do with this?

public override void AddNameProperty( ObjectPropertyList list )
{
SphericalSolaris is offline   Reply With Quote
Old 10-28-2003, 01:12 AM   #6 (permalink)
 
Join Date: Oct 2003
Location: Colorado
Age: 29
Posts: 808
Default

oh sorry i posted that after you wrote, thanks!
SphericalSolaris is offline   Reply With Quote
Old 10-28-2003, 01:24 AM   #7 (permalink)
 
Join Date: Oct 2003
Location: Colorado
Age: 29
Posts: 808
Default

Quote:
Originally Posted by Phantom
public override void GetProperties( ObjectPropertyList list )
{
base.GetProperties( list );

}

Add the localized message for artifactrarity(sp) look it up using the Localized Viewer Krriors wrote.
So do I add the numbers i get ""base.GetProperties( IN HERE? );""
or do i need to type artifactrarity(sp) in there
What does "sp" mean?
SphericalSolaris is offline   Reply With Quote
Old 10-28-2003, 01:29 AM   #8 (permalink)
 
Join Date: Oct 2003
Location: Colorado
Age: 29
Posts: 808
Default

Is this right? Or am I way off, or what lol.



public override void GetProperties( ObjectPropertyList list )
{
base.GetProperties( list );
list.SendLocalizedMessage( 1061078 ); //artifact rarity~1_val~

}
SphericalSolaris is offline   Reply With Quote
Old 10-28-2003, 02:22 AM   #9 (permalink)
Account Terminated
 
Join Date: Sep 2002
Age: 26
Posts: 3,846
Send a message via ICQ to Phantom Send a message via AIM to Phantom Send a message via MSN to Phantom
Default

Have you even tried it before asking if its correct or not, sheish...
Phantom is offline   Reply With Quote
Old 10-28-2003, 04:17 AM   #10 (permalink)
 
Join Date: Oct 2003
Location: Colorado
Age: 29
Posts: 808
Default

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.
SphericalSolaris is offline   Reply With Quote
Old 10-28-2003, 11:10 AM   #11 (permalink)
Account Terminated
 
Join Date: Sep 2002
Age: 26
Posts: 3,846
Send a message via ICQ to Phantom Send a message via AIM to Phantom Send a message via MSN to Phantom
Default

Quote:
Originally Posted by SphericalSolaris
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.
After you test to see if your correct, reply back with error ( if you get them ).

I need the exact errors.

Install .NET Framework and grab RunUO and test it yourself, not that hard.
Phantom is offline   Reply With Quote
Old 10-28-2003, 01:32 PM   #12 (permalink)
 
Join Date: Oct 2003
Location: Colorado
Age: 29
Posts: 808
Default

Quote:
After you test to see if your correct, reply back with error ( if you get them ).

I need the exact errors.

Install .NET Framework and grab RunUO and test it yourself, not that hard.

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.
SphericalSolaris is offline   Reply With Quote
Old 10-28-2003, 08:58 PM   #13 (permalink)
 
Join Date: Oct 2003
Location: Colorado
Age: 29
Posts: 808
Default

any ideas?
SphericalSolaris is offline   Reply With Quote
Old 10-28-2003, 10:06 PM   #14 (permalink)
Account Terminated
 
Join Date: Sep 2002
Age: 26
Posts: 3,846
Send a message via ICQ to Phantom Send a message via AIM to Phantom Send a message via MSN to Phantom
Default

DO NOT BUMP POSTS!!!

list.Add(1061078);
Phantom is offline   Reply With Quote
Old 10-29-2003, 02:06 AM   #15 (permalink)
 
Join Date: Oct 2003
Location: Colorado
Age: 29
Posts: 808
Default

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~.
SphericalSolaris is offline   Reply With Quote
Old 10-29-2003, 03:58 AM   #16 (permalink)
 
Join Date: Jun 2003
Posts: 277
Send a message via Yahoo to Caesar
Default i got a similar problem...

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.
Caesar is offline   Reply With Quote
Old 10-29-2003, 12:42 PM   #17 (permalink)
 
Join Date: Oct 2003
Location: Colorado
Age: 29
Posts: 808
Default

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.
SphericalSolaris is offline   Reply With Quote
Old 10-29-2003, 03:13 PM   #18 (permalink)
UOT
Forum Expert
 
UOT's Avatar
 
Join Date: Oct 2002
Location: Naples,FL
Age: 32
Posts: 1,552
Default

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.
UOT is offline   Reply With Quote
Old 10-29-2003, 07:25 PM   #19 (permalink)
Account Terminated
 
Join Date: Sep 2002
Age: 26
Posts: 3,846
Send a message via ICQ to Phantom Send a message via AIM to Phantom Send a message via MSN to Phantom
Default

I said this in my first reply.

WTF is the problem?
Phantom is offline   Reply With Quote
Old 10-29-2003, 09:28 PM   #20 (permalink)
 
Join Date: Oct 2003
Location: Colorado
Age: 29
Posts: 808
Default

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.
SphericalSolaris is offline   Reply With Quote
Old 10-29-2003, 09:30 PM   #21 (permalink)
 
Join Date: Jul 2003
Posts: 163
Send a message via Yahoo to lovemenow
Default

Phantom is trying to make you learn for yourself..He goes about it in a rough manner..but his intentions are good. Maybe a little less caffiene and he would be less irritable.
lovemenow is offline   Reply With Quote
Old 10-29-2003, 09:30 PM   #22 (permalink)
 
Join Date: Oct 2003
Location: Colorado
Age: 29
Posts: 808
Default

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.
SphericalSolaris is offline   Reply With Quote
Old 10-29-2003, 09:31 PM   #23 (permalink)
 
Join Date: Jul 2003
Posts: 163
Send a message via Yahoo to lovemenow
Default

double post..hit the little red x
lovemenow is offline   Reply With Quote
Old 10-29-2003, 10:44 PM   #24 (permalink)
Account Terminated
 
Join Date: Sep 2002
Age: 26
Posts: 3,846
Send a message via ICQ to Phantom Send a message via AIM to Phantom Send a message via MSN to Phantom
Default

Quote:
Originally Posted by SphericalSolaris
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.
Unless your willing to help out, please stay out of this. I said exactly what he had to do, yet he still posted exactly what he started with.
Phantom is offline   Reply With Quote
Old 10-29-2003, 11:01 PM   #25 (permalink)
 
Join Date: Jul 2003
Posts: 163
Send a message via Yahoo to lovemenow
Default

ok i take back what i said about the good intentions...
lovemenow 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 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5