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!

[RunUO 2.0 RC2]Jako Leveling System (Balanced Pet Leveling)

Ok I took the modded script out that had stopped the crashes but it also stopped the pets leevling all togehter. heres a crash report on the [Kill command the other crashes it gives is basically the same all to do with lose exp and such.


Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Mobiles.BaseCreature.LoseExp(Mobile killer, UInt32 exp, Boolean tellOwner)
at Server.Mobiles.BaseCreature.LoseExp(Mobile killer, UInt32 exp)
at Server.Mobiles.BaseCreature.DecayExperience(Mobile killer)
at Server.Mobiles.BaseCreature.OnBeforeDeath()
at Server.Mobiles.BaseMount.OnBeforeDeath()
at Server.Mobile.Kill()
at Server.Commands.Generic.KillCommand.Execute(CommandEventArgs e, Object obj)
at Server.Commands.Generic.BaseCommandImplementor.RunCommand(Mobile from, Object obj, BaseCommand command, String[] args)
at Server.Commands.Generic.SingleCommandImplementor.OnTarget(Mobile from, Object targeted, Object state)
at Server.Mobile.SimpleStateTarget.OnTarget(Mobile from, Object targeted)
at Server.Targeting.Target.Invoke(Mobile from, Object targeted)
at Server.Network.PacketHandlers.TargetResponse(NetState state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)
 
Well I may of fixed it :) I took out the onbefore death and i comment out this // [CommandProperty(AccessLevel.GameMaster)]
// public virtual double ExpDecayPerc { get { return .20; } }
and i was able to [kill without crashing now to see if pet levels
 

Jerbal

Sorceror
TattooedLioness;798791 said:
Ok I took the modded script out that had stopped the crashes but it also stopped the pets leevling all togehter. heres a crash report on the [Kill command the other crashes it gives is basically the same all to do with lose exp and such.

In BaseCreature.cs, in function: public virtual void LoseExp(Mobile killer, uint exp, bool tellOwner)

Change:
Code:
if (killer is PlayerMobile || !this.JakoIsEnabled || (killer is BaseCreature && ((BaseCreature)killer).Controlled && ((BaseCreature)killer).ControlMaster != null || !((BaseCreature)killer).JakoIsEnabled))

To:
Code:
iif (killer == null || killer is PlayerMobile || !this.JakoIsEnabled || (killer is BaseCreature && ((BaseCreature)killer).Controlled && ((BaseCreature)killer).ControlMaster != null || !((BaseCreature)killer).JakoIsEnabled))

Should fix the problem. I assume it's that the killer is null, and therefore this should make it not lose EXP when it dies. If you do your fix, it will never lose EXP.


TheAvatar1;798790 said:
How do you change the price it take to breed two pets? its a lil steep right now for my shard..

In \Jerbal\Jako\Breeding\JakoBreeder.cs, in function: public static int GoldPrice(Mobile creature1, Mobile creature2)

Modify the return to be what ever you like.


If you need some extra help, please let me know.
 
Still Getting a crash:
Seems its only crashing if the pet is Bonded Also


Server Crash Report
===================

RunUO Version 2.0, Build 3397.3756
Operating System: Microsoft Windows NT 6.0.6001 Service Pack 1
.NET Framework: 2.0.50727.3074
Time: 4/30/2009 1:44:44 AM
Mobiles: 3213
Items: 147213
Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Mobiles.BaseCreature.LoseExp(Mobile killer, UInt32 exp, Boolean tellOwner)
at Server.Mobiles.BaseCreature.LoseExp(Mobile killer, UInt32 exp)
at Server.Mobiles.BaseCreature.DecayExperience(Mobile killer)
at Server.Mobiles.BaseCreature.OnBeforeDeath()
at Server.Mobiles.BaseMount.OnBeforeDeath()
at Server.Mobile.Kill() in c:\Users\Jill\Desktop\SVN299\Server\Mobile.cs:line 3745
at Server.Commands.Generic.KillCommand.Execute(CommandEventArgs e, Object obj)
at Server.Commands.Generic.BaseCommandImplementor.RunCommand(Mobile from, Object obj, BaseCommand command, String[] args)
at Server.Commands.Generic.SingleCommandImplementor.OnTarget(Mobile from, Object targeted, Object state)
at Server.Mobile.SimpleStateTarget.OnTarget(Mobile from, Object targeted) in c:\Users\Jill\Desktop\SVN299\Server\Mobile.cs:line 2666
at Server.Targeting.Target.Invoke(Mobile from, Object targeted) in c:\Users\Jill\Desktop\SVN299\Server\Targeting\Target.cs:line 283
at Server.Network.PacketHandlers.TargetResponse(NetState state, PacketReader pvSrc) in c:\Users\Jill\Desktop\SVN299\Server\Network\PacketHandlers.cs:line 1138
at Server.Network.MessagePump.HandleReceive(NetState ns) in c:\Users\Jill\Desktop\SVN299\Server\Network\MessagePump.cs:line 268
at Server.Network.MessagePump.Slice() in c:\Users\Jill\Desktop\SVN299\Server\Network\MessagePump.cs:line 129
at Server.Core.Main(String[] args) in c:\Users\Jill\Desktop\SVN299\Server\Main.cs:line 480
 

Jerbal

Sorceror
Unfrortunatly I don't know what could be causing the erorr as it looks like I've handled every null reference. Please run your server in debug mode, and then the crash log will give the line number too. That, with the line of code causing the problem, will yield results!

To run it in debug, make a new shortcut of the "run uo server.exe", and add: -debug
after the quotes in the Target:. The Target field should look like this when done:
"C:\Users\Jerbal Bennett\Desktop\RunUOSVN.exe" -debug
 
OH THANK YOU THANK YOU THANK YOU!!!!!!!!!!!!!!!!! That fixed mine you so saved me a monht of ripping my hair out THANK YOU :) Now to see if pets are leveling again which im sure they are :)
 
well now i cannot make it crash hmmm?! good job man lol.. Also with the Gold Price thanks a lot man...Awesome system you have here! By far the best lvl system that i have used
 

Jerbal

Sorceror
Glad to hear that you like the system AND can't get it to crash any more. *chuckles*

If you do have any other problems, just let me know!
 

HatedNation

Wanderer
Changing Breed Time

I'm wondering if anyone could help me out.
I'm using the JakoBreeder, Works great...but i noticed it takes forever to breed.

Code:
private DateTime CalcDoneReal(DateTime calc)
        {
            if (m_failed)
                return DateTime.Now + TimeSpan.FromDays(3.0);
            if (!m_creature.Female)
                return DateTime.Now + TimeSpan.FromDays(4.0);
             return new DateTime(calc.Ticks) - TimeSpan.FromHours(Utility.RandomDouble()*24);
        }

i changed to this

Code:
private DateTime CalcDoneReal(DateTime calc)
        {
            if (m_failed)
                return DateTime.Now + TimeSpan.FromDays(0.1);
            if (!m_creature.Female)
                return DateTime.Now + TimeSpan.FromDays(0.1);
             return new DateTime(calc.Ticks) - TimeSpan.FromHours(Utility.RandomDouble()*1);
        }

Now, when the owner of the male turns his ticket in...and its almost Instantly.
However the Female Ticket....still takes 7-9 days

I'm trying to change it to 30 - 1 hour
Thanks.
 

wlrdwawoolard

Sorceror
i got no errors with this and this seems to be an awesome system and easyer good job i will certainly add this to the wlrdwawoolard script pack :)
 

Jerbal

Sorceror
Ah, there is another function in the breeder (I should have made them scale, but didn't think about it) that 'tickets' the mother's and father's pet.

In file: Customers/Jerbal/Jako/Breeding/JakoBreeder.cs, function EndBreeding:
Change:
Code:
 pm1.AddToBackpack(new BreedingParentTicket(pm1, pm2, c1, c2, DateTime.Now + c1.NextMateIn));
            pm2.AddToBackpack(new BreedingParentTicket(pm2, pm1, c2, c1, DateTime.Now + c2.NextMateIn));

To:
Code:
 pm1.AddToBackpack(new BreedingParentTicket(pm1, pm2, c1, c2, DateTime.Now + new TimeSpan(1,0,0)));
            pm2.AddToBackpack(new BreedingParentTicket(pm2, pm1, c2, c1, DateTime.Now + new TimeSpan(1,0,0)));


This is where the ticket is held for the breeding, but it should be a function of the breeding time. This change will make them returnable in 1 hour. Change new TimeSpan(#,#,#) to what ever your heart desires.
 

MiniDevil

Sorceror
Code:
        public virtual uint ExpNeeded(uint atLevel) { return (uint)(5 * Math.Pow(atLevel,3) + 10000); }

What would be the correct usage to define specific experience needed per level?

Also, how can I make it so the gump does NOT close when adding attributes?

I was unable to find special abilities scripted for the pets.. if anyone has any they would part with let me know

Thanks!
 

Jerbal

Sorceror
MiniDevil;804183 said:
Code:
        public virtual uint ExpNeeded(uint atLevel) { return (uint)(5 * Math.Pow(atLevel,3) + 10000); }

What would be the correct usage to define specific experience needed per level?

Also, how can I make it so the gump does NOT close when adding attributes?

I was unable to find special abilities scripted for the pets.. if anyone has any they would part with let me know

Thanks!


I don't know if I understand your question about the specific EXP well enough. Change the function you listed to any value you wish and it will change the EXP needed to level. Instead of immediately returning a number, do some switch:case statements and do it per-level. A function would be more efficient, but what ever you desire for your shard.

To make it so the gump doesn't close when adding attributes, you need to re-send the gump and the page number to the user who clicked it on the AnimalLore Gump.

There are no special abilities, because I thought this made it far to powerful. If someone made some, which wouldn't be that hard to extend this system, that's great, but I will not make them.

Please let me know if this answers your questions!

-Jerbal
 
Top