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 08-12-2003, 11:23 AM   #1 (permalink)
 
Join Date: Aug 2003
Posts: 271
Send a message via AIM to Zidane4056
Default Creating Jewelry with Skill Bonuses

What would the code look like? My guess right now is

[code:1]
SkillBonuses.Skill_1_Name = Alchemy;
SkillBonuses.Skill_1_Value = 10;
[/code:1]
etc etc

Is this right?
Zidane4056 is offline   Reply With Quote
Old 08-12-2003, 11:52 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

Skill_1_Name whats this and Skill_1_Value?
Phantom is offline   Reply With Quote
Old 08-12-2003, 11:57 AM   #3 (permalink)
 
Join Date: Aug 2003
Posts: 271
Send a message via AIM to Zidane4056
Default

Uh, ok Phantom that made no sense to me...
and also I have tried that with a bracelet and I get this error:

Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
- Error: Scripts\PrinceOfDarknessL.cs: CS0116: (line 1, column 1) A namespace does not directly contain members such as fields or methods

Do I need to add something to all the "using" statements at the top?

This is the file code:
[code:1]Using System;

namespace Server.Items
{
public class PrinceOfDarknessBracelet : BaseBracelet
{
[Constructable]
public PrinceOfDarknessBracelet() : base( 0x1086 )
{
Resistances.Fire = 20;
Attributes.LowerManaCost = 15;
Attributes.WeaponDamage = 10;
Attributes.WeaponSpeed = 3;
Attributes.CastSpeed = 4;
Weight = 2.5;
}

public PrinceOfDarknessBracelet( 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();
}
}
} [/code:1]

Note: I have already tried adding "using Server;" to the top and it changes nothing
Zidane4056 is offline   Reply With Quote
Old 08-12-2003, 12:10 PM   #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

because its:

using System;

not

Using System;



You posted the question what do you mean by that?
Phantom is offline   Reply With Quote
Old 08-12-2003, 12:27 PM   #5 (permalink)
 
Join Date: Aug 2003
Posts: 271
Send a message via AIM to Zidane4056
Default

er, that last one was the WORST possible example I could have given...I didnt even look at the specific file...
Phantom I meant how do you apply the SkillBonuses attribute to jewelry through code? Here is a better example of what i was trying to do:

[code:1]
using System;

namespace Server.Items
{
public class ApocBossRing : BaseRing
{
[Constructable]
public ApocBossRing() : base( 0x108a )
{
SkillBonuses.Skill_1_Name = Magery;
SkillBonuses.Skill_1_Value = 4;
SkillBonuses.Skill_2_Name = EvalInt;
SkillBonuses.Skill_2_Value = 2;
SkillBonuses.Skill_3_Name = Meditation;
SkillBonuses.Skill_3_Value = 3;
Resistances.Cold = 7;
Resistances.Energy = 3;
Weight = 5.0;
}

public ApocBossRing( 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();
}
}
}
[/code:1]

If you can't see anything still look under [code:1][Contructable]
public ApocBossRing() : base( 0x108a )[/code:1]
Zidane4056 is offline   Reply With Quote
Old 08-12-2003, 12:58 PM   #6 (permalink)
 
Join Date: Aug 2003
Posts: 271
Send a message via AIM to Zidane4056
Default

Sorry forgot to post my errors:

- Error: Scripts\ApocBossL.cs: CS0103: (line 10, column 32) The name 'Magery' does not exist in the class or namespace 'Server.Items.ApocBossRing'
- Error: Scripts\ApocBossL.cs: CS0103: (line 12, column 32) The name 'EvalInt' does not exist in the class or namespace 'Server.Items.ApocBossRing'
- Error: Scripts\ApocBossL.cs: CS0103: (line 14, column 32) The name 'Meditation' does not exist in the class or namespace 'Server.Items.ApocBossRing'

I'm thinkin I need a new namespace or using statement?
Zidane4056 is offline   Reply With Quote
Old 08-13-2003, 10:31 PM   #7 (permalink)
 
Join Date: Aug 2003
Posts: 271
Send a message via AIM to Zidane4056
Default

Anybody!?? Come on I know somebody's done this before.
Zidane4056 is offline   Reply With Quote
Old 08-13-2003, 11:40 PM   #8 (permalink)
Bad Boy
 
Join Date: Jun 2003
Posts: 80
Default

ok It works on Beta 33r2 here you go i had to redo your script but got it to work

[code:1]using System;
using Server.Network;
using Server.Items;

namespace Server.Items
{
public class ApocBossRing : BaseRing
{
public SkillMod m_SkillMod0;
public SkillMod m_SkillMod1;
public SkillMod m_SkillMod2;


[Constructable]
public ApocBossRing() : this( 0 )
{
}

[Constructable]
public ApocBossRing( int hue ) : base( 0x108a )
{
Weight = 5.0;
Resistances.Cold = 7;
Resistances.Energy = 3;

}

public ApocBossRing( 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();

if ( Parent is Mobile )
{
m_SkillMod0 = new DefaultSkillMod( SkillName.Magery, true, 4 );
((Mobile)Parent).AddSkillMod( m_SkillMod0 );

m_SkillMod1 = new DefaultSkillMod( SkillName.EvalInt, true, 2 );
((Mobile)Parent).AddSkillMod( m_SkillMod1 );

m_SkillMod2 = new DefaultSkillMod( SkillName.MagicResist, true, 3 );
((Mobile)Parent).AddSkillMod( m_SkillMod2 );


}
}

public override bool OnEquip( Mobile from )
{
m_SkillMod0 = new DefaultSkillMod( SkillName.Magery, true, 4 );
from.AddSkillMod( m_SkillMod0 );

m_SkillMod1 = new DefaultSkillMod( SkillName.EvalInt, true, 2 );
from.AddSkillMod( m_SkillMod1 );

m_SkillMod2 = new DefaultSkillMod( SkillName.MagicResist, true, 3 );
from.AddSkillMod( m_SkillMod2 );



return true;
}

public override void OnRemoved( object parent )
{
if ( parent is Mobile )
{
((Mobile)parent).RemoveStatMod("Bane" );
((Mobile)parent).Hits = ((Mobile)parent).HitsMax;
}

if ( m_SkillMod0 != null )
{
m_SkillMod0.Remove();
m_SkillMod0 = null;
}

if ( m_SkillMod1 != null )
{
m_SkillMod1.Remove();
m_SkillMod1 = null;
}

if ( m_SkillMod2 != null )
{
m_SkillMod2.Remove();
m_SkillMod2 = null;
}
}

public override void OnSingleClick( Mobile from )
{
this.LabelTo( from, Name );
this.LabelTo( from, "Mage Power!" );
}

}

}[/code:1]


Just a suggestion but i would change this line of code
[code:1][Constructable]
public ApocBossRing( int hue ) : base( 0x108a )
{
Weight = 5.0;
Resistances.Cold = 7;
Resistances.Energy = 3;

} [/code:1]

to this so the ring has a name

[code:1]
[Constructable]
public ApocBossRing( int hue ) : base( 0x108a )
{
Weight = 5.0;
Resistances.Cold = 7;
Resistances.Energy = 3;
Name = "ApocBossRing";

} [/code:1]
Noobus is offline   Reply With Quote
Old 08-13-2003, 11:51 PM   #9 (permalink)
Forum Expert
 
PerfectWing's Avatar
 
Join Date: Oct 2002
Location: USA, Ga.
Age: 24
Posts: 1,205
Send a message via ICQ to PerfectWing Send a message via AIM to PerfectWing Send a message via MSN to PerfectWing Send a message via Yahoo to PerfectWing
Default

That will work, but I believe the purpose of all this is to utilize the already available Attributes of AOS. I haven't tried anything out myself yet, but I too would be interested in seeing it, I'll try real quick and see what I come up with.
PerfectWing is offline   Reply With Quote
Old 08-13-2003, 11:52 PM   #10 (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 Zidane4056
Anybody!?? Come on I know somebody's done this before.
Please don't bump your posts.

To be honest you never gave me a chance to answer it.
Phantom is offline   Reply With Quote
Old 08-14-2003, 12:42 AM   #11 (permalink)
 
Join Date: Aug 2003
Posts: 2
Default

Hey Zidane,

Why don't you try this :

[code:1]using System;


namespace Server.Items
{
public class ApocBossRing : BaseRing
{
[Constructable]
public ApocBossRing() : base( 0x108a )
{
SkillBonuses.Skill_1_Name = SkillName.Magery;
SkillBonuses.Skill_1_Value = 4;
SkillBonuses.Skill_2_Name = SkillName.EvalInt;
SkillBonuses.Skill_2_Value = 2;
SkillBonuses.Skill_3_Name = SkillName.Meditation;
SkillBonuses.Skill_3_Value = 3;

Resistances.Cold = 7;
Resistances.Energy = 3;
Weight = 5.0;
}

public ApocBossRing( 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();
}
}
}
[/code:1]

That should work for you.....or whoever else.
Quietus is offline   Reply With Quote
Old 08-14-2003, 06:01 PM   #12 (permalink)
Bad Boy
 
Join Date: Jun 2003
Posts: 80
Default

Quote:
That will work, but I believe the purpose of all this is to utilize the already available Attributes of AOS. I haven't tried anything out myself yet, but I too would be interested in seeing it, I'll try real quick and see what I come up with. Smile
What is the difference???????? The ring i wrote for him does the same damn thing so what does it matter how you arrive as long as it works!!!
Noobus is offline   Reply With Quote
Old 08-30-2003, 02:56 PM   #13 (permalink)
 
Join Date: Aug 2003
Posts: 271
Send a message via AIM to Zidane4056
Default

Sorry for the bump but I havent been able to check up on this post for a long time.

Noobus I tried youre code and the scripts all compiled fine but the ring does not have any skill bonuses...I read youre code and it looks like it should work but it doesnt...

And also I do not want to change the name because it is not meant to be a super-rare or one-of-a-kind or anything like that; just a kickass ring found on a very strong monster's corpse that you can add directly so you dont waste 2 or 3 years of your life changing the attributes.
Zidane4056 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