[Release] Leveling Pets w/ Mob Kills

02/20/2019 17:44 Naltalah#1
Hi again.

After a question once came up on how to do it I tried it myself and I'm actually using this system myself.

Basically what this system does: Pet EXP no longer goes up automatically but instead the player has to kill mobs for pet exp. There's a lot of customization which can be done to change how much exp the pet gets. You can find it in the comments.

DpClient.cpp

Mover.cpp

Mover.h

MoverSkill.cpp Only add this if you want to add Pet-Tonics

AttackArbiter.cpp

DPSrvr.cpp Only implement this, if you dont want eggs to be leveled by using Pet Feed


VersionCommon.h (Neuz)
PHP Code:
#define        __SYS_PETLEVELING_MOBKILL 
VersionCommon.h (WorldServer)
PHP Code:
#define        __SYS_PETLEVELING_MOBKILL
#ifdef        __SYS_PETLEVELING_MOBKILL
#define        PET_BASE_EXP 25.0f
#endif 
You can add the Tonics yourself, just create items with the following Item Kinds: IK1_SYSTEM IK2_SYSTEM IK3_SCROLL

Explanation on modifiers:

In the VersionCommon.h the Base EXP for the pet is defined. It is 25.0f is 0.025% Pet EXP.

Increase this on your behalf, since there are many multiplicators you can change in the Mover.cpp

Just go to the function AddPetExpOnKill and take a look at the values there.

Currently it is set to 5% Pet EXP for a boss kill, x1.2 EXP for a giant kill, x1.2 EXP if the monster is 10 or more levels above the player, x1.25 EXP for dungeon mobs, +25% for the weak Pet Tonics and +50% for the strong Tonic.

All fine and dandy, where you can really make exp explode is what comes next: Differentiating pet levels. Currently Eggs and D-Level get 12.5x Base-EXP, C-Level gets 7x, B-Level 3.5x and A-Level gets base-exp.

Please note that the values for the base-exp can be changed indiviually depending on if the player is in a dungeon or not.

Do whatever you want with this. As always, feedback on how to improve the code is welcome.
I bet there are some flaws or possible optimizations, I'd be glad to hear them.
02/20/2019 18:55 comcem#2
Nice, thank you for release
02/21/2019 00:00 LookAtTheFlower#3
Great release , thank you :).
08/16/2020 19:40 Naltalah#4
Sorry for the necro, updated a bug in AttackArbiter.cpp
08/17/2020 10:24 Groxy101#5
Quote:
Originally Posted by Naltalah View Post
Sorry for the necro, updated a bug in AttackArbiter.cpp
What did you change? I already had your code implemented, and it's exactly the same. The only thing you changed is where to add the code (before, after). But that's the same spot..
08/17/2020 12:08 Naltalah#6
Quote:
Originally Posted by Groxy101 View Post
What did you change? I already had your code implemented, and it's exactly the same. The only thing you changed is where to add the code (before, after). But that's the same spot..
In the original release, the AddPetExpOnKill was added in OnDiedPVP, rather than OnDied in AttackArbiter.cpp
08/17/2020 12:26 Groxy101#7
Quote:
Originally Posted by Naltalah View Post
In the original release, the AddPetExpOnKill was added in OnDiedPVP, rather than OnDied in AttackArbiter.cpp
Ahh... Now I understand. I already had it added on OnDied, instead of OnDiedPVP, because they have the same code you told me to search for in your original post.

Maybe add: search for "void CAttackArbiter::OnDied()" at the AttackArbiter.cpp part.