Issue pet training system,after apply points,no more experience wins.

Lemke

Well-Known Member
Sep 26, 2015
53
5
37
Hello guys,asking about the pet training system.
I modified the TrainingProfile.cs line 55:
C#:
public bool CanApplyOptions { get { return HasBegunTraining && TrainingProgressPercentile >= 0.01; } }
Now pets can apply gains from 1% of training progress,but now the pets cannot gain more exp after apply the first hability points,,i tested on other targets,and best npcs to gain,but no gains after apply these points.
If i do not apply points,pet continue gaining experience as intended.
Here the related code,finally found:

C#:
 if (PetTrainingHelper.ApplyTrainingPoint(Creature, TrainingPoint, Value))
                                {
                                    User.SendLocalizedMessage(1157497); // You successfully train the pet!

                                    if (TrainingPoint.TrainPoint is SkillName)
                                    {
                                        Effects.SendLocationParticles(EffectItem.Create(Creature.Location, Creature.Map, EffectItem.DefaultDuration), 0, 0, 0, 0, 0, 5060, 0);
                                        Effects.PlaySound(Creature.Location, Creature.Map, 0x243);

                                        Effects.SendMovingParticles(new Entity(Server.Serial.Zero, new Point3D(Creature.X - 6, Creature.Y - 6, Creature.Z + 15), Creature.Map), Creature, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100);
                                        Effects.SendMovingParticles(new Entity(Server.Serial.Zero, new Point3D(Creature.X - 4, Creature.Y - 6, Creature.Z + 15), Creature.Map), Creature, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100);
                                        Effects.SendMovingParticles(new Entity(Server.Serial.Zero, new Point3D(Creature.X - 6, Creature.Y - 4, Creature.Z + 15), Creature.Map), Creature, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100);

                                        Effects.SendTargetParticles(Creature, 0x375A, 35, 90, 0x00, 0x00, 9502, (EffectLayer)255, 0x100);

                                        if (scroll != null)
                                            scroll.Delete();
                                    }
                                    else
                                    {
                                        Creature.PlaySound(0x1EB);
                                        Creature.FixedEffect(0x375A, 1, 11);
                                    }

                                    profile.OnTrain(User, cost);

                                    ResendGumps(profile.HasBegunTraining);

                                    Server.Engines.Quests.TeachingSomethingNewQuest.CheckComplete(User);
                                }
Can anyone help me please?Thank you so much.
Post automatically merged:
 

Attachments

Last edited:

Lokai

Moderator
ServUO Developer
Dec 4, 2014
1,231
201
Western New York State
Shard Name
Test Center
Donate
Donate money to this user
These code pieces have nothing to do with gains that I can see. Your issue is with the part where gains would happen. These are only the parts where you are applying points to the pet.
 

Lemke

Well-Known Member
Sep 26, 2015
53
5
37
/////SOLVED/////Thank you so much Lokai !!!!!!!!!!!!!!!!!!!!!!!!
/////" if i delete the ControlSlots >= ControlSlotsMax i think its solved"//////////////////

Maybe this code is what i want?Is located inside TrainingProfile.cs
I think the answer is here:
C#:
   if (ControlSlots >= ControlSlotsMax || !HasBegunTraining || TrainingProgress >= TrainingProgressMax || Creature.ControlMaster == null)

                return;
On press button to train,there is a gump saying the pet will get +1 slot,so if i delete the ControlSlots >= ControlSlotsMax i think its solved,testing now in local.
 
Last edited: