Resource icon

Skill Increase Book 1.031

No permission to download

StaticHex

Citizen
Jul 21, 2020
33
17
8
35
Houston, Texas
www.ultima.teragentech.net
Shard Name
Phantom Realms
Donate
Donate money to this user
StaticHex submitted a new resource:

Skill Increase Book - Gives a permanent skill increase between 0.1% and 0.5% when used

A book which grants the user a permanent increase in a skill of their choice. The bonus applied is between 0.1% and 0.5%. This would make a good reward item or rare drop. Could also be a nice addition to inscription. Anyway hope everyone enjoys this and feel free to edit as needed.

~ StaticHex
Read more about this resource...
 

StaticHex

Citizen
Jul 21, 2020
33
17
8
35
Houston, Texas
www.ultima.teragentech.net
Shard Name
Phantom Realms
Donate
Donate money to this user
StaticHex updated Skill Increase Book with a new update entry:

Implemented check for skill caps

  • Skill book now hides any skills which are maxed out (so players can't increase skills past the server cap)
  • If the bonus applied would push a player's skill over the cap, that skill is simply increased to the cap instead

Special thanks to the member who emailed me and brought this to my attention and I hope everyone who downloaded it continues to enjoy it.
Read the rest of this update entry...
 

JaxStraw

Rookie
Feb 20, 2018
62
3
8
40
I love what you have here!

I added it to the Definscription menu and everything works great! The only thing is that the name shows up "blank" in the crafting menu. here is what I did to try and correct it, but it still shows up blank, but can still be crafted.
Screenshot_2.png

So I have everything working and it is [constructable]. Here is what I did not get this to work inside SkillBook.cs

public override int LabelNumber => 1101453; // SkillBook

public SkillBook()
: base(0xEFA)
{
Weight = 3.0;
Name = "Skill Increase Book";
Hue = 0xA33;


This is how I added it into DefInscription.cs


//SkillBook
AddCraft(typeof(SkillBook), 1044294, 1101453, 85.0, 125.0, typeof(BlankScroll), 1044377, 8, 1044378);
AddRes(index, typeof(DreadHornMane), 1032682, 5, 1044253);
AddRes(index, typeof(WoodPulp), 1113136, 10, 1113289);
AddRes(index, typeof(Beeswax), 1025154, 5, "You do not have enough beeswax.");


Not sure why this would not work.
 

StaticHex

Citizen
Jul 21, 2020
33
17
8
35
Houston, Texas
www.ultima.teragentech.net
Shard Name
Phantom Realms
Donate
Donate money to this user
Glad you're enjoying the book, I think I found the problem

public override int LabelNumber => 1101453; // SkillBook


//SkillBook
AddCraft(typeof(SkillBook), 1044294, 1101453, 85.0, 125.0, typeof(BlankScroll), 1044377, 8, 1044378);
The problem is these 2 lines right here. So the labels used for the other options in the skill book menu aren't just arbitrary numbers, they actually aren't numbers at all. If you look up the documentation for the AddCraft function; the definition looks like this:
C#:
public int AddCraft(Type typeItem, TextDefinition group, TextDefinition name, double minSkill, double maxSkill, Type typeRes, TextDefinition nameRes, int amount)
So what you want is a TextDefinition object not just an integer, because under the hood what's going on is that integer is being used to create a new TextDefinition object. That being said; TextDefinition has a constructor which takes in a string vs. an integer so changing the description in DefInscription.cs to:
C#:
AddCraft(typeof(SkillBook), 1044294 , "Skill Increase Book", 85.0, 125.0, typeof(BlankScroll), 1044377, 8, 1044378);
should fix your problem. Additionally, you can remove the labelNumber option from skillbook unless you're using it for something else.

I hope this helps and let me know if it doesn't fix the problem

EDIT: Accidentally clipped off one of my code tags the first time
EDIT2: Posted the wrong field edited (not a morning person)
 
Last edited:

JaxStraw

Rookie
Feb 20, 2018
62
3
8
40
Glad you're enjoying the book, I think I found the problem



The problem is these 2 lines right here. So the labels used for the other options in the skill book menu aren't just arbitrary numbers, they actually aren't numbers at all. If you look up the documentation for the AddCraft function; the definition looks like this:
C#:
public int AddCraft(Type typeItem, TextDefinition group, TextDefinition name, double minSkill, double maxSkill, Type typeRes, TextDefinition nameRes, int amount)
So what you want is a TextDefinition object not just an integer, because under the hood what's going on is that integer is being used to create a new TextDefinition object. That being said; TextDefinition has a constructor which takes in a string vs. an integer so changing the description in DefInscription.cs to:
C#:
AddCraft(typeof(SkillBook), 1044294 , "Skill Increase Book", 85.0, 125.0, typeof(BlankScroll), 1044377, 8, 1044378);
should fix your problem. Additionally, you can remove the labelNumber option from skillbook unless you're using it for something else.

I hope this helps and let me know if it doesn't fix the problem

EDIT: Accidentally clipped off one of my code tags the first time
EDIT2: Posted the wrong field edited (not a morning person)

Still does the same thing. Shows blank on the craft menu gump
 

StaticHex

Citizen
Jul 21, 2020
33
17
8
35
Houston, Texas
www.ultima.teragentech.net
Shard Name
Phantom Realms
Donate
Donate money to this user
That is interesting, did you end up removing the label or do you still have that line defined in SkillBook.cs? The reason I ask is I copy and pasted your block of code and swapped out the numeric label for the text I posted above and when I load my server and check the inscription menu I see this:

1597435983268.png

To eliminate any ambiguity on what I did; here is the exact section of my DefInscription.cs line for line (with surrounding entries).

C#:
index = AddCraft(typeof(RunedPrism), 1044294, 1073465, 45.0, 95.0, typeof(BlankScroll), 1044377, 1, 1044378);
AddRes(index, typeof(SpidersSilk), 1044360, 1, 1044253);
AddRes(index, typeof(BlackPearl), 1044353, 1, 1044253);
AddRes(index, typeof(HollowPrism), 1072895, 1, 1044253);
ForceNonExceptional(index);

// SkillBook
AddCraft(typeof(SkillBook), 1044294, "Skill Increase Book", 85.0, 125.0, typeof(BlankScroll), 1044377, 8, 1044378);
AddRes(index, typeof(DreadHornMane), 1032682, 5, 1044253);
AddRes(index, typeof(WoodPulp), 1113136, 10, 1113289);
AddRes(index, typeof(Beeswax), 1025154, 5, "You do not have enough beeswax.");

// Runebook
index = AddCraft(typeof(Runebook), 1044294, 1041267, 45.0, 95.0, typeof(BlankScroll), 1044377, 8, 1044378);
AddRes(index, typeof(RecallScroll), 1044445, 1, 1044253);
AddRes(index, typeof(GateTravelScroll), 1044446, 1, 1044253);
So if your code looks the same, something is not as it seems. If you still have that label line in the skill book I would try to comment it out and see if that fixes it and if it does remove it. If you did remove the label is there anything else about the script you changed other than what you posted initially?
 

JaxStraw

Rookie
Feb 20, 2018
62
3
8
40
That is interesting, did you end up removing the label or do you still have that line defined in SkillBook.cs? The reason I ask is I copy and pasted your block of code and swapped out the numeric label for the text I posted above and when I load my server and check the inscription menu I see this:

View attachment 16433

To eliminate any ambiguity on what I did; here is the exact section of my DefInscription.cs line for line (with surrounding entries).

C#:
index = AddCraft(typeof(RunedPrism), 1044294, 1073465, 45.0, 95.0, typeof(BlankScroll), 1044377, 1, 1044378);
AddRes(index, typeof(SpidersSilk), 1044360, 1, 1044253);
AddRes(index, typeof(BlackPearl), 1044353, 1, 1044253);
AddRes(index, typeof(HollowPrism), 1072895, 1, 1044253);
ForceNonExceptional(index);

// SkillBook
AddCraft(typeof(SkillBook), 1044294, "Skill Increase Book", 85.0, 125.0, typeof(BlankScroll), 1044377, 8, 1044378);
AddRes(index, typeof(DreadHornMane), 1032682, 5, 1044253);
AddRes(index, typeof(WoodPulp), 1113136, 10, 1113289);
AddRes(index, typeof(Beeswax), 1025154, 5, "You do not have enough beeswax.");

// Runebook
index = AddCraft(typeof(Runebook), 1044294, 1041267, 45.0, 95.0, typeof(BlankScroll), 1044377, 8, 1044378);
AddRes(index, typeof(RecallScroll), 1044445, 1, 1044253);
AddRes(index, typeof(GateTravelScroll), 1044446, 1, 1044253);
So if your code looks the same, something is not as it seems. If you still have that label line in the skill book I would try to comment it out and see if that fixes it and if it does remove it. If you did remove the label is there anything else about the script you changed other than what you posted initially?

HAHA! I am dumb. I took your fix and added it all to the defcarpentry instead of definscription.cs lol

sorry bro, your fix was correct, just had to get my head out of my ass ;p
This script is flawless and works perfect on the new patch :) Thank you for this amazing piece of art :)
 
  • Like
Reactions: StaticHex

StaticHex

Citizen
Jul 21, 2020
33
17
8
35
Houston, Texas
www.ultima.teragentech.net
Shard Name
Phantom Realms
Donate
Donate money to this user
HAHA! I am dumb. I took your fix and added it all to the defcarpentry instead of definscription.cs lol

sorry bro, your fix was correct, just had to get my head out of my ass ;p
This script is flawless and works perfect on the new patch :) Thank you for this amazing piece of art :)
Haha that totally sounds like something I would do, glad you got it working and really glad you're enjoying it :)
 
  • Like
Reactions: JaxStraw

Dallas

Citizen
Oct 7, 2020
28
7
3
43
USA
I open the book but it is empty does not let me pick anything did i do something wrong?
I am new to this so trying to learn.
 

StaticHex

Citizen
Jul 21, 2020
33
17
8
35
Houston, Texas
www.ultima.teragentech.net
Shard Name
Phantom Realms
Donate
Donate money to this user
I open the book but it is empty does not let me pick anything did i do something wrong?
I am new to this so trying to learn.
Well, the first things that I'd need to know is
1. Server Software (RunUO or ServUO). Note that this script is for ServUO so if you're using RunUO I don't think it will work.
2. What version of ServUO you're running
3. What Ultima Online client you're using
4. Do any error/warning messages (these should be red and yellow) pop up when you start your server and do any mention the skill book script?

Let's start with answering these questions and we can work from there
 

Dallas

Citizen
Oct 7, 2020
28
7
3
43
USA
ServUO
Publish 54
Classic OSI newest patch
No errors nothing script works just fine but when i open the book its completely blank.
 

StaticHex

Citizen
Jul 21, 2020
33
17
8
35
Houston, Texas
www.ultima.teragentech.net
Shard Name
Phantom Realms
Donate
Donate money to this user
ServUO
Publish 54
Classic OSI newest patch
No errors nothing script works just fine but when i open the book its completely blank.
Ok great, thanks so much for providing info. I think I know what's going on here but I want to confirm before I post an updated version of the script so one last question.

Did you use any commands or items to set all your skills to the maximum? I.e. are all your skills capped out?
 

Dallas

Citizen
Oct 7, 2020
28
7
3
43
USA
Not maximum only gm level 100.0 but even with having them able to go to 120 with a powerscroll it is completely invisible if i lower the skills below 100 i can see the book... But at 100 everything is disappeared.

thank you for your reply didn't know if maybe i was just doing something wrong?
 

StaticHex

Citizen
Jul 21, 2020
33
17
8
35
Houston, Texas
www.ultima.teragentech.net
Shard Name
Phantom Realms
Donate
Donate money to this user
StaticHex updated Skill Increase Book with a new update entry:

v1.03 Changelog

  • Removed the ability to open the book if you don't have any skills you can increase (before would just display an empty book which was confusing)
  • Added a capBonus variable to the script which can be used to allow the user to increase skills past the cap (more specifically, allows the user to change this in a single place vs. having to hunt down every instance of cap in the entire script).
Read the rest of this update entry...
Post automatically merged:

Not maximum only gm level 100.0 but even with having them able to go to 120 with a powerscroll it is completely invisible if i lower the skills below 100 i can see the book... But at 100 everything is disappeared.

thank you for your reply didn't know if maybe i was just doing something wrong?
Ok I was correct in what I thought the problem was. So, this isn't a bug and you aren't doing anything wrong. So the skill max is 120 but that's different than the skill cap which is the natural number a skill stops increasing at (minus things like scroll bonuses and such). That is the number I'm using to stop increasing skills at.

Additionally, I made the script automatically filter out skills which are already at/above the detected cap; because why display skills you can't increase anyway? That's a waste of everyone's time.

Now, here's where I messed up. I didn't put a check in to see if the user had GM'd all skills i.e. I never checked for the case where there are no skills to be able to increase. This is very confusing. Additionally, it occurred to me that users may want to allow their users to increase their skills past the cap (to account for things like power scrolls or whatever else).

So, I just pushed a new release which has the changes mentioned above. Give that a try and see if that doesn't fix your problems. (Note: to get it to show skills you'll need to set the variable "capBonus" to something other than 0, but once you do that you should see skills. It should also not let you open the book anymore if there are no skills you increase. Anyway, hope this fixes your issue and let me know if it doesn't and/or you find anything else.
 
Last edited:

Dallas

Citizen
Oct 7, 2020
28
7
3
43
USA
StaticHex updated Skill Increase Book with a new update entry:

v1.03 Changelog
Read the rest of this update entry...

Post automatically merged:



Ok I was correct in what I thought the problem was. So, this isn't a bug and you aren't doing anything wrong. So the skill max is 120 but that's different than the skill cap which is the natural number a skill stops increasing at (minus things like scroll bonuses and such). That is the number I'm using to stop increasing skills at.

Additionally, I made the script automatically filter out skills which are already at/above the detected cap; because why display skills you can't increase anyway? That's a waste of everyone's time.

Now, here's where I messed up. I didn't put a check in to see if the user had GM'd all skills i.e. I never checked for the case where there are no skills to be able to increase. This is very confusing. Additionally, it occurred to me that users may want to allow their users to increase their skills past the cap (to account for things like power scrolls or whatever else).

So, I just pushed a new release which has the changes mentioned above. Give that a try and see if that doesn't fix your problems. (Note: to get it to show skills you'll need to set the variable "capBonus" to something other than 0, but once you do that you should see skills. It should also not let you open the book anymore if there are no skills you increase. Anyway, hope this fixes your issue and let me know if it doesn't and/or you find anything else.
So far from my testing i seem to found a bug with having 120 mining an my skill being at 100 i open the book and then close out of it per say accidentally then go to reopen it opens up as a blank book.. it seems to do it with all skills not just mining i just used that as an example.

Other then that i have not ran into any problems.
 

StaticHex

Citizen
Jul 21, 2020
33
17
8
35
Houston, Texas
www.ultima.teragentech.net
Shard Name
Phantom Realms
Donate
Donate money to this user
So far from my testing i seem to found a bug with having 120 mining an my skill being at 100 i open the book and then close out of it per say accidentally then go to reopen it opens up as a blank book.. it seems to do it with all skills not just mining i just used that as an example.

Other then that i have not ran into any problems.
Sorry, trying to understand. You have 120 in mining and your skill cap is 100, You open the book, (skills are all there at this point), then close the book without picking a skill and when you reopen it, it's empty? Is this correct? Also what are you setting capBonus to?

I tried opening the book, closing it by right clicking, and then opening it again but I don't see the behavior you're talking about. Let me know if I missed anything above or if there's something you did that you notice I didn't do.
 

Dallas

Citizen
Oct 7, 2020
28
7
3
43
USA
yes that is exactly what is happening.

Here is a giff of what is happening.


Per say if i am a player i open the book to see what it is then close it drop it in per say a chest this is just an example it brakes the book gump until the shards restart... Then you can repeat the same bug.
 

StaticHex

Citizen
Jul 21, 2020
33
17
8
35
Houston, Texas
www.ultima.teragentech.net
Shard Name
Phantom Realms
Donate
Donate money to this user
yes that is exactly what is happening.

Here is a giff of what is happening.


Per say if i am a player i open the book to see what it is then close it drop it in per say a chest this is just an example it brakes the book gump until the shards restart... Then you can repeat the same bug.
Ah, thanks for that gif that was wonderful. So I was able to find the problem, it wasn't actually just when closing the book it was that any time the gump was reloaded it would clip off 2 entries so before long you end up with an empty book.

The problem was in the GetSkills function. I was using num_skills to get all the "valid skills" (skills less than the cap + the bonus) but I forgot that I update that number and so it progressively grabs fewer and fewer skills. I changed it to just loop over the server defined list of skills instead and everything appears to be working now. Will update the version shortly; good catch and let me know if you find anything else :)