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
Levelable Items (Redux)

Levelable Items (Redux)
Current Version: 2.0


********************
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. Basically, look for and add this 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 new attached zip and replace the older version.

********************
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 attached zip and replace the older version.

********************
UPDATE Dec. 16, 2005
********************
UPDATED: ItemExperienceGump.cs to show the spending point cost for each attribute. Thanks Etherkye for this idea.

Please download new attached zip and replace the older version.

********************

Original Post
This is an update to OutkastDev's Levelable items system. It is very similar in setting up items to become levelable and some of the code is still intact, but besides that, it is very different.

***** Disclaimer *****
This system was written and intended for AOS/SE enabled shards, as it is based on AOS Attributes. It will not break a pre-AOS shard, but the attributes will have no effect!!
*******************


Here are the features...
This system allows you to create levelable weapons, armor, and jewelry. Upon killing creatures, the levelable items will gain experience. Once experience reaches certain points, the item will gain a level. Upon gaining levels, the item will receive "spending points". These points can be used to purchase attribute enhancements to the item via use of a gump.

Here is what is included...
  • Leveling system (based off of OutkastDev's Levelable Items system) - This is the core to the system and how your items will gain experience when a creature is killed.
  • Item Experience Gump - This gump allows the players to view the items experience, experience to next level, spending points available, and attributes on the item. It is also where they can spend the available spending points! Here is an image of the interface...


  • Item Experience Command - Players can use the commands [itemexp or [ixp to bring up the Item Experience gump.

Here are the main differences between this system and OutkastDev's...
  • Items gain experience by fighting any monsters.
  • The experience at which an item levels is based on a calculation, rather than hardcoded numbers. this allows you to easily change the number of levels available by changing one line of code.
  • Spending points added to allow players to pick their own attributes.
  • Context menu removed and gump/command added as the interface.

To install
download the attached file and unrar it to your customs directory. Now you are ready to setup your items.

1. I have included a few examples, a normal kryss, a normal bracelet, and two artifacts (Aegis and Inquisitors Resolution). These are commented and will get you started on creating your own levelable versions of items.
*NOTE* You could also always modify baseweapon.cs, basearmor.cs, etc to have all items levelable, but this has not been tested and I will not support issues if you decide to do it this way!

2. Now that you have created levelable items, you need to make the following changes to BaseCreature.cs to let these items gain experience...

Open up your basecreature.cs and find this method

Code:
		public override void OnDamage( int amount, Mobile from, bool willKill )
		{
			WeightOverloading.FatigueOnDamage( this, amount );

			InhumanSpeech speechType = this.SpeechType;

			if ( speechType != null && !willKill )
				speechType.OnDamage( this, amount );

			base.OnDamage( amount, from, willKill );
		}

Change it to look like this

Code:
		public override void OnDamage( int amount, Mobile from, bool willKill )
		{
			WeightOverloading.FatigueOnDamage( this, amount );

			InhumanSpeech speechType = this.SpeechType;

			if ( speechType != null && !willKill )
				speechType.OnDamage( this, amount );

			[B]if ( !Summoned && willKill )
				LevelItemManager.CheckItems( from, this );[/B]

			base.OnDamage( amount, from, willKill );
		}

3. Now you can modify the definable parameters of the leveling system. To do this,
* Open LevelableItems\New\LevelItemManager.cs and modify the following code to your preference...
Code:
	public const int Levels = 100; //Number of levels items can go up to.
        public const int PointsPerLevel = 5; //How many spending points an item gets per level.
        public const bool EnableExpCap = true; //true = Cap experience per level.  false = no cap.
        public const bool DisplayExpProp = false; //true = Display experience on item onmouseover/click.

Description of parameters...
Levels & PointsPerLevel
At 100 levels and 5 points gained each level (with 5 extra points every 10th level), that gives players 550 points to spend on attributes. You can create an item like the following...


If you want uber weapons or if you think this is too much already, you will need to either increase/decrease Levels or increase/decrease PointsPerLevel to meet your needs.

EnableExpCap
If set to true, their will be a cap of how many experience points an item can gain per creature/per item level. As the levels increase, this cap increases. If false, there is no cap. For example, if an item is level 2 and a player kills a Titan. With EnableExpCap set to true, the item will be capped at around 40 points of experience. If false, the item will gain more like 50-60 points.

DisplayExpProp
If set to true, the total experience points will show OnMouseOver for the item. If false, only the level will show.​
4. Modify the definable property in the gump. To do this,
* Open LevelableItems\Gumps\ItemExperienceGump.cs and modify the following code to your preference...
Code:
        public const bool DoubleArtifactCost = true; //true = Artifact attributes will cost double points.

Description of parameter...
DoubleArtifactCost
If set to true, Artifacts will cost double the spending points for each attribute. If false, artifacts attributes will cost the same as non-artifacts. In my opinion, this create VERY unbalanced items if set to false!​
5. Modify Attribute parameters. To do this,
* Open LevelableItems\New\LevelAttributes.cs and modify each of the attribute parameters to your preference...
You want to modify the lines like

Code:
	new AttributeInfo( AosAttribute.RegenHits, "Regen Hits", AttributeCategory.Stats, 2, 4 ),

Your options are...
  • Delete an entire line to remove the ability to increase the given attribute.
  • Modify the "Cost" of increasing an attribute (the second to last number).
  • Modify the max value to the given attribute (last number).

6. Now, restart your server and you are ready to go.​

Obviously you will need a way to distribute the levelable items as well (i.e., loot, token stone, rewards, etc), but I will leave that up to you :)

Warning
If you use Daat99's OWLTR, you will need to make one change to BaseArmor.cs to fix an issue with Armor resistances. Please read the following post for instructions...
http://www.runuo.com/forums/showthread.php?p=496234#post496234

Credit:
******************
OutkastDev - For the original Levelable Items script and for the Race/Class system, which I used for the calculation of points to each level.
tindin156 - For his contribution of allowing Clothing items to be levelable and the context menu addition.
******************

Feel free to post any bugs or critical feedback

Thanks and hope you enjoy!
 

Attachments

  • Levelable Items 2.0.zip
    15.4 KB · Views: 380

dracana

Sorceror
Reserved

Here are more images of the experience gump and it's attribute pages...


Melee Attributes


Magic Attributes


Character Stats


Misc. Attributes
 

LFFPicard

Sorceror
Very nice, unfortunatly i wont be able to give any bug reports on it as i am still playing with my shard (Still on the map) But this will go in ym list of shard features..

Thank you
 

Alcore

Wanderer
Very nice addition to an already great concept...I like the fact that they can gain on any monster... and letting players decide on what attributes..you even thought of putting in some checks for admins to control the points needed to enhance weapons etc... I used devs levelable weapons and made a few of my own items to be levelable ( very tedious btw) ...having to go through all the code to make weapons with different attributes...letting players build up weapons to what they want, wonderful...thank you for sharing...I will be implementing this..and I will let you know if i find anything...
 

dracana

Sorceror
Alcore said:
Very nice addition to an already great concept...I like the fact that they can gain on any monster... and letting players decide on what attributes..you even thought of putting in some checks for admins to control the points needed to enhance weapons etc... I used devs levelable weapons and made a few of my own items to be levelable ( very tedious btw) ...having to go through all the code to make weapons with different attributes...letting players build up weapons to what they want, wonderful...thank you for sharing...I will be implementing this..and I will let you know if i find anything...

Great. Thanks Alcore!

I look forward to hearing how it works for you.
 

Joeku

Lord
Sounds like you put a lot of work into this, good job. Let me talk to the other admin on my shard, I'll see if I am going to install it or not.
 

Liam

Sorceror
This looks pretty cool. Are pets able to kill and level bracelets and the like? I see that you need to actually cast on the creature, and not use blade/vortex, in order to level jewelry and you need to actually use the weapon in order to level it. Is armor "passive?" Basically, just absorbing blows from a creature while you kill it will entitle it to exp gain?

I am curious as to whether or not pets / blades / vortex are able to be used while raising the items. Thanks for a really nice script!!
 

dracana

Sorceror
Liam said:
This looks pretty cool. Are pets able to kill and level bracelets and the like? I see that you need to actually cast on the creature, and not use blade/vortex, in order to level jewelry and you need to actually use the weapon in order to level it. Is armor "passive?" Basically, just absorbing blows from a creature while you kill it will entitle it to exp gain?

I am curious as to whether or not pets / blades / vortex are able to be used while raising the items. Thanks for a really nice script!!

It is coded that you have to be the killer of the creature for your items to level. You can use pets/summons, but if you let them do all the work and they get the final blow in, you will not be registered as the killer and your items will not level. On the other hand, you can let them do all the work and then deal the final blow... that would work.

I know this may not appeal to everyone, but it is how OutkastDev originally set it up and it is something I didn't change. If anyone has better ideas, let me know and I can think about them.

Thanks.
 

Liam

Sorceror
dracana said:
It is coded that you have to be the killer of the creature for your items to level. You can use pets/summons, but if you let them do all the work and they get the final blow in, you will not be registered as the killer and your items will not level. On the other hand, you can let them do all the work and then deal the final blow... that would work.

I know this may not appeal to everyone, but it is how OutkastDev originally set it up and it is something I didn't change. If anyone has better ideas, let me know and I can think about them.

Thanks.
Cool, thanks Dracana. I just wanted to know what it took.

I love your systems/scripts. Now I know why things didn't "work" so I can adjust and make sure others know how it works.

So that I am clear, all of the items, jewelry, armor and weapons, will only gain experience if I get the killing blow, not my pets, blades/vortexes or anything else? So, to deal the killing blow, I need to physically attack it?

Thanks again!!! :)
 

dracana

Sorceror
Liam said:
Cool, thanks Dracana. I just wanted to know what it took.

I love your systems/scripts. Now I know why things didn't "work" so I can adjust and make sure others know how it works.

So that I am clear, all of the items, jewelry, armor and weapons, will only gain experience if I get the killing blow, not my pets, blades/vortexes or anything else? So, to deal the killing blow, I need to physically attack it?

Thanks again!!! :)

Yes, that is correct :) However, since I am not sure if I like it this way myself, this is open for discussion. Perhaps something more along the lines of how looting rights are determined might be better? I will wait for feedback from the community before making a decision on changing it though.
 

etherkye

Wanderer
could you make it so that the gump shows the cost of upgrades as well. I've been trying but it keeps giving me errors.

I hate gumps.
 

dracana

Sorceror
etherkye said:
could you make it so that the gump shows the cost of upgrades as well. I've been trying but it keeps giving me errors.

I hate gumps.

Yeah, gumps can be fun, but they are also a pain in the @#^%#$ :)

Good idea, I will go ahead and add this in.

Thanks!
 

dracana

Sorceror
etherkye said:
and what is the forumula for the amount of exp needed for each level?

It can be found at the top of LevelItemManager.cs. But here it is...

Code:
double req = ( currentlevel + 1 ) * 10;

req = Math.Pow( req, 2 );

req -= 100.0;
 

Joeku

Lord
dracana said:
It is coded that you have to be the killer of the creature for your items to level. You can use pets/summons, but if you let them do all the work and they get the final blow in, you will not be registered as the killer and your items will not level. On the other hand, you can let them do all the work and then deal the final blow... that would work.

I know this may not appeal to everyone, but it is how OutkastDev originally set it up and it is something I didn't change. If anyone has better ideas, let me know and I can think about them.

Thanks.
I suggest you set it up like a champion.

Anyone who was an agressor of the champion at the time of death received a powerscroll. I think that anyone who was agressor of a monster at it's time of death should receive exp. for their items. Anyways, just a suggestion I am throwing out. If you don't want to do that it's fine.
 

dracana

Sorceror
Joeku said:
I suggest you set it up like a champion.

Anyone who was an agressor of the champion at the time of death received a powerscroll. I think that anyone who was agressor of a monster at it's time of death should receive exp. for their items. Anyways, just a suggestion I am throwing out. If you don't want to do that it's fine.

etherkye said:
or exp basied on damage delt. and daamge via spells should count. then my armagened would work XD

Thanks for the feedback, this is exactly what I need. These are both the ways I was thinking of figuring experience. I am not sure on the via spells for weapons though.

If I wanted the easy way, I was going to do something either based on looting rights, aggressors, etc.

If I want to do it the more detailed way, I was thinking of weapons experience based on successful hits/damage dealt (melee only), armor based on hits absorbed, jewelry based on looting rights. Not completely sure on these, so any suggestions on this would be great!

Thanks again for the feedback :)
 

etherkye

Wanderer
well mages would ahve a problem. Unless you want to make staffs work differently. so normal weapons work on damage in combat and staff on damage via spells.
 

Joeku

Lord
Or you could just make only equipped weapons gain when you cast a spell (affectively only letting SpellChanneling weapons gain when you cast.)
 

dracana

Sorceror
Updated ItemExperienceGump.cs

UPDATED: ItemExperienceGump.cs to show the spending point cost for each attribute. Thanks Etherkye for this idea.

If you already have Beta 1, you simply need to download the attached zip, unzip it and replace the old ItemExperienceGump.cs with this new version.

The zip in the original post on this thread has been updated as well.
 

Attachments

  • ItemExperienceGump.zip
    3.1 KB · Views: 52
Top