#Changes fraction of mainjob that subjob caps to.
# 0 No subjob
# 1 Sub is 1/2 of mainjob
# 2 Sub is 1/3 of mainjob
# 3 Sub is 2/3 of mainjob
# 4 caps to mainjob (equal)
#Default is 1 (retail values)
SJ_CAP: 1
new configuration setting: subjob level cap
new configuration setting: subjob level cap
This allows non retail behavior for the level of the support job, like other map settings do for other things. It's just for fun for those who want it. Prolly not the sort of thing you want to trunk but thought I'd share anyway.
- Attachments
-
- Search_SJ.patch
- (4.96 KiB) Downloaded 841 times
-
- search_server.conf.patch
- (535 Bytes) Downloaded 833 times
-
- map_darkstar.conf.patch
- (642 Bytes) Downloaded 793 times
-
- SJ_CAP.patch
- (2.69 KiB) Downloaded 819 times
Last edited by TeoTwawki on Mon Apr 30, 2018 5:56 pm, edited 1 time in total.
Hi, I run The Demiurge server.
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
DO NOT PRIVATE MESSAGE ME ABOUT BUGSPLS USE [ code ] CODE TAGS [ /code ] WHEN POSTING CODE
Re: new configuration setting: subjob level cap
Search setting patches added to main post.
This lets search server know of the new calculation. Defaults to retail behavior if missing. This had to be done as a separate setting because the search server does its own separate calculation and cannot read the map servers configuration without breaking the ability to be on separate physical machines. Unless I were to write more code than this and store it somewhere both servers can access, like the database.
It does what I want but open to suggestions for any further modification/improvement.
This lets search server know of the new calculation. Defaults to retail behavior if missing. This had to be done as a separate setting because the search server does its own separate calculation and cannot read the map servers configuration without breaking the ability to be on separate physical machines. Unless I were to write more code than this and store it somewhere both servers can access, like the database.
It does what I want but open to suggestions for any further modification/improvement.
Hi, I run The Demiurge server.
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
DO NOT PRIVATE MESSAGE ME ABOUT BUGSPLS USE [ code ] CODE TAGS [ /code ] WHEN POSTING CODE
-
- Posts: 26
- Joined: Sun Mar 25, 2018 8:54 am
Re: new configuration setting: subjob level cap
Does this functionality still work?
Re: new configuration setting: subjob level cap
Yeah mostly. You can still find that segment in battleentity.cpp and just set the subjob capping to whatever you wnat your server to use, or use this old post thread as a guide to make it adjustable still. The search server edits are no longer needed. I could turn it into a proper setting in project now but I don't think it'd see that much use, a majority of servers just want to emulate either modern retail or 2004 ish retail.
I wouldn't try to actually apply those outdated patch files though. Just open them in a text editor and look at what I changed.
Original:
That's what sets sub to cap at half of main. Just replace the math. (understanding how C++ ternary works will help, google it if you don't)
I wouldn't try to actually apply those outdated patch files though. Just open them in a text editor and look at what I changed.
Original:
Code: Select all
void CBattleEntity::SetSLevel(uint8 slvl)
{
m_slvl = (slvl > (m_mlvl >> 1) ? (m_mlvl == 1 ? 1 : (m_mlvl >> 1)) : slvl);
}
Hi, I run The Demiurge server.
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
DO NOT PRIVATE MESSAGE ME ABOUT BUGSPLS USE [ code ] CODE TAGS [ /code ] WHEN POSTING CODE
-
- Posts: 26
- Joined: Sun Mar 25, 2018 8:54 am
Re: new configuration setting: subjob level cap
I have no idea what any of that means, I'll have to flex some google-fu to figure it out.
Mostly my friend and I were thinking about ways to make the game a little more duo/trio friendly, and we thought if we could have a subjob that was either 2/3 or 1/1 of our main job, it would help make killing EP-DC actually possible at higher levels.
Mostly my friend and I were thinking about ways to make the game a little more duo/trio friendly, and we thought if we could have a subjob that was either 2/3 or 1/1 of our main job, it would help make killing EP-DC actually possible at higher levels.
Re: new configuration setting: subjob level cap
If you don't want it to apply to mobs as well you'll need an if/else conditional check for the entity type.
Back when I wrote the setting mobs core code guts were a little diff and now they call the same function to set their sj level. I forgot all about that.
That will use "new math" for players and their pets, but the old math for everything else. Since pets are often also mobs (jug pets) I make sure to explicitly check its NOT a pet using != on that same line. Unfortunately, charmed pets will be whatever they were before you charmed them, so they won't get the boost.
Back when I wrote the setting mobs core code guts were a little diff and now they call the same function to set their sj level. I forgot all about that.
Code: Select all
void CBattleEntity::SetSLevel(uint8 slvl)
{
if (this->objtype == TYPE_MOB && this->objtype != TYPE_PET)
{
m_slvl = (slvl > (m_mlvl >> 1) ? (m_mlvl == 1 ? 1 : (m_mlvl >> 1)) : slvl);
}
else
{
// REPLACE THIS LINE - example of new math to place here can be found in the original patch text, quoted below
}
original patch text wrote: m_slvl = (slvl > (m_mlvl >> 1) ? (m_mlvl == 1 ? 1 : (m_mlvl >> 1)) : slvl); // Sub is 1/2 of main of main, same as retail
m_slvl = (slvl > (m_mlvl / 3) ? (m_mlvl == 1 ? 1 : (m_mlvl / 3)) : slvl); // Sub is 1/3 of main
m_slvl = (slvl > ((m_mlvl * 2) / 3) ? (m_mlvl == 1 ? 1 : ((m_mlvl * 2) / 3)) : slvl); // Sub is 2/3 of main
m_slvl = (slvl > (m_mlvl) ? (m_mlvl == 1 ? 1 : (m_mlvl)) : slvl); // Sub caps to main.
m_slvl = 0; / / No SJ at all...Where is your Altana now?
Hi, I run The Demiurge server.
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
DO NOT PRIVATE MESSAGE ME ABOUT BUGSPLS USE [ code ] CODE TAGS [ /code ] WHEN POSTING CODE
-
- Posts: 26
- Joined: Sun Mar 25, 2018 8:54 am
Re: new configuration setting: subjob level cap
Many thanks this is exactly what I needed