Resource icon

Level System 3 - Rerelease 3.3

No permission to download

Joshua

Well-Known Member
Sep 13, 2014
562
64
34
Bountiful, Utah
Shard Name
My Own Shard
Pet training

Can you make it active when you are in Pet Slot 5?
Can you please elaborate more on this suggestion? when I think of Pet Training, maybe something that allows a pet with enough stats to potentially gain bonuses. I know in the newest servuo distro Pet Training already exist on some level but it does it a little differently and is handled through the animal lore gump.
 

afevilron

Member
Feb 13, 2014
13
3
35
Shard Name
Blood Isles
hey Joshua, (suggestion)not sure theres a way to but maybe have the expbar gump refresh on xp gains.
 

eugenesa

Well-Known Member
Jun 2, 2014
47
5
35
Shard Name
eugenesa shard
Donate
Donate money to this user
PetLevelGump.cs


else if (pet.ControlSlots! = 5)
from.SendMessage ( "애완 동물에 슬롯이 5 개있는 경우 레벨 포인트를 사용할 수 있습니다.");

이것을 하단에 추가했습니다.

내 애완 동물이 슬롯 5에있을 때 레벨 업 덤프를 사용할 수있는 능력을 제한했습니다.

잘 ~ ~!
 
Last edited:

Joshua

Well-Known Member
Sep 13, 2014
562
64
34
Bountiful, Utah
Shard Name
My Own Shard
hey Joshua, (suggestion)not sure theres a way to but maybe have the expbar gump refresh on xp gains.
That shouldn't be a problem, I will look into it.

PetLevelGump.cs


else if (pet.ControlSlots! = 6)
from.SendMessage ( "If your pet has 5 slots, you can use Level Points.");

I've added this to the bottom

I limited my ability to use level-up gump when my pet is in slot 5

It works well ~ !!!
That is an interesting way to use it. Good idea :)
Post automatically merged:

hey Joshua, (suggestion)not sure theres a way to but maybe have the expbar gump refresh on xp gains.
I think i have it set correctly. When EXP is gained or a level is gained the gump should update now, only if the gump is already open of course. If the gump is closed and this opens it please let me know, that means its not exactly working as intended. I won't be able to test it until later tonight. My work frowns on me playing games while I'm supposed to be productive ;)
Here is the updated LevelHandler.cs. back up your original and replace it with this one and see if that helps the EXP gump update for EXP and Levels.
 

Attachments

Last edited:

afevilron

Member
Feb 13, 2014
13
3
35
Shard Name
Blood Isles
Thanks, It looks like its working, just tested it when i killed a zombie it updated. It did not open up if i had the gump closed when killing a zombie.

EDIT: Looks like it is not closing the old gump, it leaves all the gumps open that its creating and doesn't close any of them.
Post automatically merged:

I added :
C#:
pm.CloseGump(typeof(ExpBar)); //closses old gump
above the sections refreshing the expBar:
Code:
pm.SendGump(new ExpBar(pm));
but I am a amature so im not sure if this is the right way to do it. I included my modified LevelHandler. i noted all my edits //Closses old gump
 

Attachments

Last edited:

Joshua

Well-Known Member
Sep 13, 2014
562
64
34
Bountiful, Utah
Shard Name
My Own Shard
Thanks, It looks like its working, just tested it when i killed a zombie it updated. It did not open up if i had the gump closed when killing a zombie.

EDIT: Looks like it is not closing the old gump, it leaves all the gumps open that its creating and doesn't close any of them.
Post automatically merged:

I added :
C#:
pm.CloseGump(typeof(ExpBar)); //closses old gump
above the sections refreshing the expBar:
Code:
pm.SendGump(new ExpBar(pm));
but I am a amature so im not sure if this is the right way to do it. I included my modified LevelHandler. i noted all my edits //Closses old gump
Ahh that is perfect, I forgot to include that. Yes that is the right way to do it :) I also will include a throttle on the next release so if you are going on a massacre it shouldn't bog things down.
 

Joshua

Well-Known Member
Sep 13, 2014
562
64
34
Bountiful, Utah
Shard Name
My Own Shard
Warning: I am actively going through all my XML scripts and tossing in null checks which include the edits themselves, however if you decide to remove the system, be sure to undo the suggested edits if you did them. Otherwise errors may be thrown. During some testing I realized that i forgot a slew of null checks for the edits. :-\
 

Insert Coin

Well-Known Member
Dec 2, 2018
47
5
37
Hello Joshua,a player on my shard tells me about the [level gump not showing the same stats with the double click in hp bar.Bar shows 61 str,[level gump shows 66. str.Mine (admin acc) is right.Its possible?Thank you!
 

Joshua

Well-Known Member
Sep 13, 2014
562
64
34
Bountiful, Utah
Shard Name
My Own Shard
Hello Joshua,a player on my shard tells me about the [level gump not showing the same stats with the double click in hp bar.Bar shows 61 str,[level gump shows 66. str.Mine (admin acc) is right.Its possible?Thank you!
I double checked on my side, stats show me for me correctly . May I get a screen shot of the issue? The player gump looks at and modifies the RawStr,RawDex and RawInt stats and also displays those stats. The only thing that may affect that view I would think is, if the player were wearing equipment that added a stat, then they opened the player gump, then removed that equipment, I do not believe the gump would account for the removed equipment. They would have to re open the gump to get the new stat value once removing the equipment.
Post automatically merged:

Now that I think about it, that does make a lot of sense. The gumps information doesn't actively update if changes external to the gump are done. Removal of jewels, armor etc. Also including gains to the stats or skills that were not activated by the gump.

1) Open level gump
2) push it to the side, and run around and kill things
3) Gain stats through the skill chain mechanics
4) Look at level gump and the stats it has listed would be out dated if any of them raised.

So , a bug? maybe... Getting gumps to update based on external change can be a little annoying. Such as the one we recently tackled with the expbar. Fortunately the exp is very basic and not much goes into it. The player gump, I think i can rig a work around to force the gump (IF open) to close and reopen upon stat change through the XML attachment.
 
Last edited:
  • Like
Reactions: Insert Coin

Insert Coin

Well-Known Member
Dec 2, 2018
47
5
37
Changed RawStr,RawInt,and RawDex to Str,Int,Dex,and work well.
Now just my shard crashed usin pet level.Disabled it to see what happens.Here the txt log:


ServUO Version 0.5, Build 6996.26785
Operating System: Microsoft Windows NT 6.2.9200.0
.NET Framework: 4.0.30319.42000
Time: 01/04/2019 16:25:23
Mobiles: 43363
Items: 185442
Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.LevelHandlerPet.Set(Mobile killer, Mobile killed)
at Server.Mobiles.BaseCreature.OnDamage(Int32 amount, Mobile from, Boolean willKill)
at Server.Mobile.Damage(Int32 amount, Mobile from, Boolean informMount, Boolean checkDisrupt)
at Server.Mobiles.BaseCreature.Damage(Int32 amount, Mobile from, Boolean informMount, Boolean checkDisrupt)
at Server.Mobiles.BaseCreature.Damage(Int32 amount, Mobile from)
at Server.Spells.SpellHelper.SpellDamageTimer.OnTick()
at Server.Timer.Slice()
at Server.Core.Main(String[] args)
 

Joshua

Well-Known Member
Sep 13, 2014
562
64
34
Bountiful, Utah
Shard Name
My Own Shard
In LevelHandlerPet.cs, at around line 36 find the below and make the change. That should help.

Find this code snippit
C#:
            if (cm == null)
                return;
Add in this above that code snippit
C#:
            if (petxml == null && cp.EnabledLevelPets == false))
                return;
final look
C#:
            Mobile cm = bc.ControlMaster;
          
            if (petxml == null && cp.EnabledLevelPets == false)
                return;
          
            if (cm == null)
                return;

            klr = killer as BaseCreature;
 

Joshua

Well-Known Member
Sep 13, 2014
562
64
34
Bountiful, Utah
Shard Name
My Own Shard
Sorry, I just realize that statement may not work. If it fails use this instead.

C#:
if (petxml == null || cp.EnabledLevelPets == false)
                return;
 

eugenesa

Well-Known Member
Jun 2, 2014
47
5
35
Shard Name
eugenesa shard
Donate
Donate money to this user
Hi
I want to get experience with fishing or Treasure Hunter.
What should I do?
 

Joshua

Well-Known Member
Sep 13, 2014
562
64
34
Bountiful, Utah
Shard Name
My Own Shard
For fishing, you would just need to add a line of code that adds a chance of gaining x amount of exp when it calculates if you get a fish or not. Or just flat out gives exp for each attempt.

Treasure hunting, it would be more reasonable to just create a token that gives x amount of exp, maybe have it do a switch to randomize a little and make that a part of the loot.
Post automatically merged:

May want to use the taming example I have for gaining exp. it's a little more complicated then just adding to the exp pool, it still has to reference the level handle.
 

Insert Coin

Well-Known Member
Dec 2, 2018
47
5
37
Hello Joshua,after a day of test,the shard continue gettin fatal error related with pet level handler.Here the log now(its different from yesterday):

ServUO Version 0.5, Build 6996.26785
Operating System: Microsoft Windows NT 6.2.9200.0
.NET Framework: 4.0.30319.42000
Time: 01/04/2019 23:21:21
Mobiles: 43685
Items: 186274
Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.LevelHandlerPet.Set(Mobile killer, Mobile killed)
at Server.Mobiles.BaseCreature.OnDamage(Int32 amount, Mobile from, Boolean willKill)
at Server.Mobile.Damage(Int32 amount, Mobile from, Boolean informMount, Boolean checkDisrupt)
at Server.Mobiles.BaseCreature.Damage(Int32 amount, Mobile from, Boolean informMount, Boolean checkDisrupt)
at Server.Mobiles.BaseCreature.Damage(Int32 amount, Mobile from)
at Server.Items.PoolOfAcid.OnMoveOver(Mobile m)
at Server.Mobile.Move(Direction d)
at Server.Mobiles.BaseAI.DoMoveImpl(Direction d)
at Server.Mobiles.BaseAI.DoMove(Direction d, Boolean badStateOk)
at Server.Mobiles.BaseAI.WalkMobileRange(IPoint3D p, Int32 iSteps, Boolean bRun, Int32 iWantDistMin, Int32 iWantDistMax)
at Server.Mobiles.BaseAI.DoActionFlee()
at Server.Mobiles.MeleeAI.DoActionFlee()
at Server.Mobiles.BaseAI.AITimer.OnTick()
at Server.Timer.Slice()
at Server.Core.Main(String[] args)

 

Joshua

Well-Known Member
Sep 13, 2014
562
64
34
Bountiful, Utah
Shard Name
My Own Shard
Hello Joshua,after a day of test,the shard continue gettin fatal error related with pet level handler.Here the log now(its different from yesterday):

ServUO Version 0.5, Build 6996.26785
Operating System: Microsoft Windows NT 6.2.9200.0
.NET Framework: 4.0.30319.42000
Time: 01/04/2019 23:21:21
Mobiles: 43685
Items: 186274
Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.LevelHandlerPet.Set(Mobile killer, Mobile killed)
at Server.Mobiles.BaseCreature.OnDamage(Int32 amount, Mobile from, Boolean willKill)
at Server.Mobile.Damage(Int32 amount, Mobile from, Boolean informMount, Boolean checkDisrupt)
at Server.Mobiles.BaseCreature.Damage(Int32 amount, Mobile from, Boolean informMount, Boolean checkDisrupt)
at Server.Mobiles.BaseCreature.Damage(Int32 amount, Mobile from)
at Server.Items.PoolOfAcid.OnMoveOver(Mobile m)
at Server.Mobile.Move(Direction d)
at Server.Mobiles.BaseAI.DoMoveImpl(Direction d)
at Server.Mobiles.BaseAI.DoMove(Direction d, Boolean badStateOk)
at Server.Mobiles.BaseAI.WalkMobileRange(IPoint3D p, Int32 iSteps, Boolean bRun, Int32 iWantDistMin, Int32 iWantDistMax)
at Server.Mobiles.BaseAI.DoActionFlee()
at Server.Mobiles.MeleeAI.DoActionFlee()
at Server.Mobiles.BaseAI.AITimer.OnTick()
at Server.Timer.Slice()
at Server.Core.Main(String[] args)

Regarding this issue, can you please run the server is debug mode and replicate the error? that will provide a lot more information in regards to exactly which line is causing the hiccup. Also, you mentioned this started when you tried disabling the pet level system, is that right?
Post automatically merged:

Additional Note: Using the system as is without any additional modifications suggested above, I enabled the pet level system. Tamed a creature, got the attachment on them. Killed, no issue. Then I disabled the system. Restarted the server, killed and still no issue. Have you made any changes to the system at all ? if so what changes were made.

I'm down to people editing the distro version of this system and making it their own, however when too many edits are made and things start breaking that kind of leaves the original creators scope of support since i would have no insight as to what was changes and if it was changed correctly. So anyone please keep that in mind when editing the system. If you want a feature to be included in the system and fielded to make sure it works, please post it here and I can push it on the next release. Such as the one to include fishing and treasure hunting, that is a good example. :)
Post automatically merged:

Never give up, never surrounded. So on a positive point, this IS a bug. The debug session would have helped but I was finally able to replicate.
Found the problem. The issue is any basecreature without the attachment is getting a kick back.

Remove the suggested edits above for LevelHandlerPet.cs , and go into basecreature.cs

Locate the willkill section and replace the level edit with the below.

C#:
            #region Level system WillKill
            Configured cd = new Configured();
            if (willKill && cd.ExpGainFromKill == true)
            LevelHandler.Set(from, this);
           
            /* For Pets */
            XMLPetLevelAtt petxml = (XMLPetLevelAtt)XmlAttach.FindAttachment(this, typeof(XMLPetLevelAtt));
            ConfiguredPetXML cp = new ConfiguredPetXML();
            if (petxml != null && willKill && cp.PetExpGainFromKill == true)
            LevelHandlerPet.Set(from, this);
            #endregion
that should force a check for the attachment before being sent to levelhandlerpet.set
 
Last edited:

Insert Coin

Well-Known Member
Dec 2, 2018
47
5
37
Hello Joshua!i think the last issue i am getting is for my new pets too,i created a pet who born from an egg,they born already tame without level,the the petlevelhandler have this issue but for my pet.
The last issue i see,is the pets are getting well str when level up,but no hit points,strange.
I dont modified your system,just the max level cap.
Dextery raise up stamina well,Int raise upp mana well,but str dont raise HP,i tryed this code:

if (AvlStatPoints > 0)
{
from.SendMessage("One Stat Point (Strength) has been added to your pet.");
m_Pet.RawStr += 1;
m_Pet.HitsMaxSeed += 1; //tryed too m_Pet.Hits += 1;
AvlStatPoints -= 1;
m_Petxml.StrPointsUsed += 1;
m_Petxml.StatPoints = AvlStatPoints;
from.SendGump(new PetLevelGump(from, m_Pet ));
// m_Master.SendGump(new PlayerLevelGump(m_From, GumpPage.None, SkillCategory.Misc));
return;
}

Thank you and sorry,im feeling the one talking shit here,your system is awesome,some players are getting crafy using your updates man.
EDIT:
On the shard ive got,i like in pets 1 STR = 1 HP,so i edit the petlevel gum to:

if (AvlStatPoints > 0)
{
m_Pet.HitsMaxSeed = m_Pet.RawStr;
from.SendMessage("One Stat Point (Strength) has been added to your pet.");
m_Pet.HitsMaxSeed += 1;
m_Pet.RawStr += 1;
AvlStatPoints -= 1;
m_Petxml.StrPointsUsed += 1;
m_Petxml.StatPoints = AvlStatPoints;
from.SendGump(new PetLevelGump(from, m_Pet ));
// m_Master.SendGump(new PlayerLevelGump(m_From, GumpPage.None, SkillCategory.Misc));
return;
}
 
Last edited:

Joshua

Well-Known Member
Sep 13, 2014
562
64
34
Bountiful, Utah
Shard Name
My Own Shard
Joshua updated Level System 3 - Rerelease with a new update entry:

Feature and Bug Update

Files Adjusted or added
- LevelHandler.cs
- PlayerLevelGump.cs
- LevelCore.cs
- LevelHandlerPet.cs
- PetLevelGump.cs
- ExpPowerHourToken.cs
- ExpPowerHour.cs
- ReadMe

Fixed issue with BaseCreatures that did not have the XML attachment causing a crash when they were killed either by a player or area damage.

Fixed issue with PetLevelSystem not activating properly. Moved the null check into the PetLevelHandler , adjusted the code for basecreature.cs , updated overview with proper code...
Read the rest of this update entry...
Post automatically merged:

Hello Joshua!i think the last issue i am getting is for my new pets too,i created a pet who born from an egg,they born already tame without level,the the petlevelhandler have this issue but for my pet.
The last issue i see,is the pets are getting well str when level up,but no hit points,strange.
I dont modified your system,just the max level cap.
Dextery raise up stamina well,Int raise upp mana well,but str dont raise HP,i tryed this code:

if (AvlStatPoints > 0)
{
from.SendMessage("One Stat Point (Strength) has been added to your pet.");
m_Pet.RawStr += 1;
m_Pet.HitsMaxSeed += 1; //tryed too m_Pet.Hits += 1;
AvlStatPoints -= 1;
m_Petxml.StrPointsUsed += 1;
m_Petxml.StatPoints = AvlStatPoints;
from.SendGump(new PetLevelGump(from, m_Pet ));
// m_Master.SendGump(new PlayerLevelGump(m_From, GumpPage.None, SkillCategory.Misc));
return;
}

Thank you and sorry,im feeling the one talking shit here,your system is awesome,some players are getting crafy using your updates man.
EDIT:
On the shard ive got,i like in pets 1 STR = 1 HP,so i edit the petlevel gum to:

if (AvlStatPoints > 0)
{
m_Pet.HitsMaxSeed = m_Pet.RawStr;
from.SendMessage("One Stat Point (Strength) has been added to your pet.");
m_Pet.HitsMaxSeed += 1;
m_Pet.RawStr += 1;
AvlStatPoints -= 1;
m_Petxml.StrPointsUsed += 1;
m_Petxml.StatPoints = AvlStatPoints;
from.SendGump(new PetLevelGump(from, m_Pet ));
// m_Master.SendGump(new PlayerLevelGump(m_From, GumpPage.None, SkillCategory.Misc));
return;
}
No offense taken, I take all feed back! :) I wouldn't know if something was broken or not working as intended if no one ever said anything, so I appreciate your feedback on the system.

I pushed an update, to fix the issue with pets, LevelHandlerPet.cs has been updated with the null check and the overview has been updated with the proper edit to basecreature.cs , that should be good now.
 

Joshua

Well-Known Member
Sep 13, 2014
562
64
34
Bountiful, Utah
Shard Name
My Own Shard
After a long lull of grinding diablo 3 the fix for the exp share system just came to me. I tried it and it worked! The split EXP , I still have to figure out, but I might just kick that to the curb and just keep the exp share as it is. Once I finalize the code and run it through some field testing (about 5 clients as a time) , i will post the modified files in the discussion for people to test out to make sure to meets the expectations. Now that I got the core issue sorted out, I will also add in some of my own 'taste' to the feature to make it more unique.
 
Last edited: