RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Level Items (Redux)

dracana

Sorceror
PoxIRL said:
I looked in the Gump file for where you had if baseweapon show button Weapon hits. I then looked further into it to see if I could change it to after you click on Magic attributes. To try and make it so if basejewel show fc/fcr/lmc buttons. But I couldnt even find those attributes. I dont want to limit magic attributes to just jewels. I want to be able to let players chose SC for a wep.

Sorry if this isn't clear.

I added the lines
Code:
if (m_Item is BaseJewel)
Here
Code:
AddLabel(136, 93, TitleHue, @"Categories");
			AddButton(75, 116, 4005, 4007, GetButtonID( 1, 0 ), GumpButtonType.Reply, 0);
            AddLabel(112, 117, LabelHue, @"Melee Attributes");
			[COLOR="Red"]if (m_Item is BaseJewel)[/COLOR]
				AddButton(75, 138, 4005, 4007, GetButtonID( 1, 1 ), GumpButtonType.Reply, 0);
            AddLabel(112, 139, LabelHue, @"Magic Attributes");
			AddButton(75, 160, 4005, 4007, GetButtonID( 1, 2 ), GumpButtonType.Reply, 0);
            AddLabel(112, 161, LabelHue, @"Character Stats");
			AddButton(75, 182, 4005, 4007, GetButtonID( 1, 3 ), GumpButtonType.Reply, 0);
            AddLabel(112, 183, LabelHue, @"Resistances");
            if (m_Item is BaseWeapon)
			    AddButton(75, 204, 4005, 4007, GetButtonID( 1, 4 ), GumpButtonType.Reply, 0);
            AddLabel(112, 205, LabelHue, @"Weapon Hits");
			AddButton(75, 226, 4005, 4007, GetButtonID( 1, 5 ), GumpButtonType.Reply, 0);
            AddLabel(112, 227, LabelHue, @"Misc. Attributes");

But that only makes it so that if targeted item is not basejewel, then you cant select magic attributes, making it so weapons cant have SC added to it.

I want to look further in the script for after that part is selected. I dont know where to go from here. Any help as to where to look would be greatly appreciated.

Look in LevelAttributes.cs this is where you assign a category to each attribute. To make it easy, simply move the ones that you want to have for all items (not just jewels) from AttributeCategory.Magic to another category. for example...

Spell Channeling...
Code:
new AttributeInfo( AosAttribute.SpellChanneling, "Spell Channeling", [B][COLOR="Red"]AttributeCategory.Magic[/COLOR][/B], 15, 1 ),

change to...
Code:
new AttributeInfo( AosAttribute.SpellChanneling, "Spell Channeling", [B][COLOR="red"]AttributeCategory.Misc[/COLOR][/B], 15, 1 ),

then leave your change in ItemExperienceGump.cs as is.
 

Turtle666

Wanderer
i got a 2questions so here they are :

1. what would i have to add to a base file to make all the weapons, armor a jewelery level?

2. What do i change if i want a certain item to get more points to use like double for example. for example if i wanted a katana to gain 10 points where as everything else gains 5?

im kinda new at this scripting thing so i would appreciate it if someone could show me how to do these things
 

Camerous

Wanderer
I would liek to know as well what I would change so that all weapons, armor, and jewelry on my shard would be levelable.
 

dracana

Sorceror
Camerous said:
I would liek to know as well what I would change so that all weapons, armor, and jewelry on my shard would be levelable.

The best way would be to modify baseweapon.cs, basearmor.cs, and basejewel.cs with the Levelable Item specific code found in the sample items I provided. the sections that need to be added are...

Add
Code:
ILevelable
to the list of interfaces in the public class.
(for example...
Code:
public abstract class BaseWeapon : Item, IWeapon, IFactionItem, ICraftable[COLOR="Red"], ILevelable[/COLOR]
)

Inside the public class, add
Code:
		/* These private variables store the exp, level, and *
		 * points for the item */
		private int m_Experience;
		private int m_Level;
		private int m_Points;

Inside the public base item routine, (i.e. within
Code:
public BaseWeapon( int itemID ) : base( itemID )
		{
),
add
Code:
LevelItemManager.InvalidateLevel( this );

Within serialize, increase the version number by one and add...
Code:
			// DONT FORGET TO SERIALIZE LEVEL, EXPERIENCE, AND POINTS
			writer.Write( m_Experience );
			writer.Write( m_Level );
			writer.Write( m_Points );

within Deserialize, add (in the same order that you added in Serialize and where 8 is the version you increased to in Serialize)...
Code:
			case 8:
			{m_Experience = reader.ReadInt();
			m_Level = reader.ReadInt();
			m_Points = reader.ReadInt();
goto case 7;
}

Within GetProperties routine, add...
Code:
			list.Add( 1060658, "Level\t{0}", m_Level );
			if ( LevelItemManager.DisplayExpProp )
				list.Add( 1060659, "Experience\t{0}", m_Experience );

Now add the rest after the Deserialize within the base item class...
Code:
		// ILevelable Members that MUST be implemented
		#region ILevelable Members

		// This one will return our private m_Experience variable.
		[CommandProperty( AccessLevel.GameMaster )]
		public int Experience
		{
			get
			{
				return m_Experience;
			}
			set
			{
				m_Experience = value;

				// This keeps gms from setting the level to an outrageous value
				if ( m_Experience > LevelItemManager.ExpTable[LevelItemManager.Levels - 1] )
					m_Experience = LevelItemManager.ExpTable[LevelItemManager.Levels - 1];

				// Anytime exp is changed, call this method
				LevelItemManager.InvalidateLevel( this );
			}
		}

		// This one will return our private m_Level variable.
		[CommandProperty( AccessLevel.GameMaster )]
		public int Level
		{
			get
			{
				return m_Level;
			}
			set
			{
				// This keeps gms from setting the level to an outrageous value
				if ( value > LevelItemManager.Levels )
					value = LevelItemManager.Levels;

				// This keeps gms from setting the level to 0 or a negative value
				if ( value < 1 )
					value = 1;

				// Sets new level.
				if ( m_Level != value )
				{
					m_Level = value;
				}
			}
		}

		// This one will return our private m_Points variable.
		[CommandProperty( AccessLevel.GameMaster )]
		public int Points
		{
			get
			{
				return m_Points;
			}
			set
			{
				//Sets new points.
				m_Points = value;
			}
		}
		#endregion

that is basically it. I have not really tested this so, but it should work with a bit of playing around with (for example fists in base weapon may need to be specifically handled!). Please give it a shot and let me know if you need more assistance.
 
I really really like this script :) Ive got it running on my shard thats about to hit public testing, however I was curiouse to know one thing..

The way you have it set up now, all Levable weapons/items fall under one leveable system, so basicly all the leveable stuff you have all have to have the same "max" level.. is there a way to break it down so say one weapon can only gain a level of 5 while another weapon can gain a level up to 20?
 
I would like to bring this the attention of the everyone using this system, and I do not think there is a fix for this aside from disabling Razor on your server alot.

Players can set a macro in Razor which allows the program to continuously add attributes even after the item has hit it's cap as long as there are spending points avaliable.

This is honestly a great script and I loved it until I found some of my players abusing it. I had one player with over 500 in str and dex on one item. I had it capped at 10. Just a warning to everyone out there with this script.

This post is not intended to hurt the reputation of this script pack because it is a wonderful system and I love it. So did my players. Sucks that a bunch of exploiters haveta mess it up for everyone Thanks.
 

dracana

Sorceror
BTuesday22 said:
I would like to bring this the attention of the everyone using this system, and I do not think there is a fix for this aside from disabling Razor on your server alot.

Players can set a macro in Razor which allows the program to continuously add attributes even after the item has hit it's cap as long as there are spending points avaliable.

This is honestly a great script and I loved it until I found some of my players abusing it. I had one player with over 500 in str and dex on one item. I had it capped at 10. Just a warning to everyone out there with this script.

This post is not intended to hurt the reputation of this script pack because it is a wonderful system and I love it. So did my players. Sucks that a bunch of exploiters haveta mess it up for everyone :( Thanks.

First off, thanks for the report on this (although I would have preferred a pm rather than a post of the exploit :) )

Anyway, can you give me more info (if your players that did this will tell you more)? I would like to know how the macro was setup, so I can test and try to come up with a fix.

Thanks
 

Liam

Sorceror
dracana said:
First off, thanks for the report on this (although I would have preferred a pm rather than a post of the exploit :) )

Anyway, can you give me more info (if your players that did this will tell you more)? I would like to know how the macro was setup, so I can test and try to come up with a fix.

Thanks
Check your pm's.
 

dracana

Sorceror
BTuesday22 said:
I would like to bring this the attention of the everyone using this system, and I do not think there is a fix for this aside from disabling Razor on your server alot.

Players can set a macro in Razor which allows the program to continuously add attributes even after the item has hit it's cap as long as there are spending points avaliable.

This is honestly a great script and I loved it until I found some of my players abusing it. I had one player with over 500 in str and dex on one item. I had it capped at 10. Just a warning to everyone out there with this script.

This post is not intended to hurt the reputation of this script pack because it is a wonderful system and I love it. So did my players. Sucks that a bunch of exploiters haveta mess it up for everyone Thanks.

I am working on the fix for this now. If testing goes good and explout is fixed, I should release by tomorrow.

Thanks,
 

dracana

Sorceror
Exploits fixed

********************
UPDATE Mar. 22, 2006
********************
Fixed: ItemExperienceGump.cs to fix an exploit involving increasing attributes over their max allowed when using razor macros.
Thanks BTuesday22 for pointing this out.

Please download new zip from the first post.

Also, an exploit was brought to my attention by aventae involving gaining experience off of summoned creatures. To fix, edit BaseCreature.cs and replace...
Code:
			if ( willKill )
				LevelItemManager.CheckItems( from, this );

with...
Code:
			if ( [COLOR="Red"][B]!Summoned [/B][/COLOR]&& willKill )
				LevelItemManager.CheckItems( from, this );

Thanks,
 
Wow awesome job! I can add this to my shard again without any worry of exploiters! Dracana you have done a wonderful job with this :) Keep up the good work.
 

evany

Sorceror
if i kill a zombie i get 24 exp points, and if I kill an ancient wyrm i get 28 skills points (?????). How can i customize this so i can give certain xperience points depending on the creature??
I know this script has a calculator, but i think it's not working fine. A zombie shouldn't give equal or more points than a more powerfull enemy.

I found the script in wich all the calculations are made, but i don't understand very well in order to change anything :p

By the way: this script rulz!
 

dracana

Sorceror
evany said:
if i kill a zombie i get 24 exp points, and if I kill an ancient wyrm i get 28 skills points (?????). How can i customize this so i can give certain xperience points depending on the creature??
I know this script has a calculator, but i think it's not working fine. A zombie shouldn't give equal or more points than a more powerfull enemy.

I found the script in wich all the calculations are made, but i don't understand very well in order to change anything :p

By the way: this script rulz!

Experience points are based off of the strengt
, int, dex, and skills total of the creatures. Additional factors are thrown in to add more points, like if creatue is a magery using or fire breathing creature. The more powerful the creature, the more experience points the items will get. However!! I am guessing what you are seeing is the experience per level caps. Each level has a cap on how many points can be gained on a kill. This cap is the experience needed divided by 20. For example, to get to level 2, you need 300 points. the max points any creature killed will give at this level is 15 (300/20). At higher levels, that cap will increase and stronger monsters will give more points.
This was done so players wont get to the top level so fast, however if you don't like this feature, you simply can change the variable EnableExpCap in LevelItemManager.cs to false and a cap won't be used.

Hope this helps :)
 

evany

Sorceror
dracana said:
Experience points are based off of the strengt
, int, dex, and skills total of the creatures. Additional factors are thrown in to add more points, like if creatue is a magery using or fire breathing creature. The more powerful the creature, the more experience points the items will get. However!! I am guessing what you are seeing is the experience per level caps. Each level has a cap on how many points can be gained on a kill. This cap is the experience needed divided by 20. For example, to get to level 2, you need 300 points. the max points any creature killed will give at this level is 15 (300/20). At higher levels, that cap will increase and stronger monsters will give more points.
This was done so players wont get to the top level so fast, however if you don't like this feature, you simply can change the variable EnableExpCap in LevelItemManager.cs to false and a cap won't be used.

Hope this helps :)

No, i like it the way is now (after reading this :D). Excuse, i didn't knew that it was that way. Im not english, so i think i missed some words.
 
Im curiouse to know if you can make Cloaks, Robes and other clothing items to make them levable? I tried the cloak but it wouldnt let me level it
 

tindin156

Wanderer
it can be done cause i have done it you need to edit a few scripts like the gump one and a few others....i'll search my files and post what ones
 

dracana

Sorceror
DamienPenDragon said:
hehe Thanks :) I got it to reconize Baseclothing so when I type [ixp it opens the gump for it... but thats about it :S

Yeah, I never got around to adding this inalthough it should be pretty straightforward. It would require mods to the gump and the attribute scripts to process clothing attribute selection. In addition, most scripts do some sort of check that the item is BaseWeapon, BaseArmor, or BaseJewel. Check for BaseClothing would need to be added to these scripts as well.

Tindin, If you can find your mods, with your permission, I can add them to the package and re-release with credit to you. If you can't find, I will try to get this into a near-future release.
 

tindin156

Wanderer
here is my file for levelable items the changes are...added the weap/armor scripts the are on the boards

my work is made clothing levelable plus added all the basic clothing to it (no ml some aos and se)
i also add in a txt file with a copy paste add on for loot with all the items in it (not the best way to do it but it works)

oh and i blocked the dont show xp on all items cause i was sick of the warnings (so all items so exp)

edit*sorry about the typing half a sleep*...oh and i never updated to your newest script ether...was on the list of things to do

View attachment 6577
 

Attachments

  • LevelableItems.rar
    222.3 KB · Views: 22

dracana

Sorceror
New version 2.0 released

********************
UPDATE Mar. 28, 2006
********************
Updated: Now possible to add levelable Clothing items.
Added: Added new sample LevelCloak.cs for a sample levelable clothing item.
Added: Context Menu Entry so single click on levelable items will now bring up [ixp gump. Sample items updated to show sample of adding context menu to levelable items. Look for and add the following to each levelable item script...
Code:
		public override void GetContextMenuEntries(Mobile from, ArrayList list)
		{
			base.GetContextMenuEntries (from, list);

			/* Context Menu Entry to display the gump w/
			 * all info */
			list.Add( new LevelInfoEntry( from, this, AttributeCategory.Melee ) );
		}

Thanks tindin156 for his contributions to both of these additions!

Please download the new zip from the first post and replace the older version.
 
Top