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...
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...
Here are the main differences between this system and OutkastDev's...
To install
download the attached file and unrar it to your customs directory. Now you are ready to setup your items.
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!
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
Change it to look like this
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...
Description of parameters...
* Open LevelableItems\Gumps\ItemExperienceGump.cs and modify the following code to your preference...
Description of parameter...
* Open LevelableItems\New\LevelAttributes.cs and modify each of the attribute parameters to your preference...
You want to modify the lines like
Your options are...
6. Now, restart your server and you are ready to go.
*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,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.
* 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,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!
* 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!