Page 1 of 1

new configuration setting: subjob level cap

Posted: Sun Oct 20, 2013 2:14 pm
by TeoTwawki
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.
#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

Re: new configuration setting: subjob level cap

Posted: Fri Oct 25, 2013 6:17 pm
by TeoTwawki
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.

Re: new configuration setting: subjob level cap

Posted: Fri Apr 06, 2018 5:35 pm
by ClanMcCracken
Does this functionality still work?

Re: new configuration setting: subjob level cap

Posted: Sun Apr 08, 2018 8:40 pm
by TeoTwawki
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:

Code: Select all

void CBattleEntity::SetSLevel(uint8 slvl)
 {
	m_slvl = (slvl > (m_mlvl >> 1) ? (m_mlvl == 1 ? 1 : (m_mlvl >> 1)) : slvl);
 }
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)

Re: new configuration setting: subjob level cap

Posted: Mon Apr 09, 2018 8:06 am
by ClanMcCracken
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.

Re: new configuration setting: subjob level cap

Posted: Sat Apr 14, 2018 10:37 pm
by TeoTwawki
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.

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
    }

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.
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?

Re: new configuration setting: subjob level cap

Posted: Mon Apr 30, 2018 1:08 pm
by ClanMcCracken
Many thanks :D this is exactly what I needed