Jump to content

Attribute sum value cap


Go to solution Solved by Amun,

Recommended Posts

Hi guys!
I have a question regarding a way to put a cap on a summed value of a certain attribute / bonus. For example - I'd like to put a cap on defence against race bonuses. I want to set defence against warriors / ninja / sura / shaman to max of a 80%. Is there a way to do that? I've set value for these attributes in 6/7 to 10% - so having it in all items + shield would give 100% defence against a race and I want to avoid that and create some more items encouraging more versitality in an eq set. I hope I've explained my problem well. I'll be glad for any help.

Link to comment
Share on other sites

On 2/17/2024 at 10:28 PM, tonyp2812 said:

Hi guys!
I have a question regarding a way to put a cap on a summed value of a certain attribute / bonus. For example - I'd like to put a cap on defence against race bonuses. I want to set defence against warriors / ninja / sura / shaman to max of a 80%. Is there a way to do that? I've set value for these attributes in 6/7 to 10% - so having it in all items + shield would give 100% defence against a race and I want to avoid that and create some more items encouraging more versitality in an eq set. I hope I've explained my problem well. I'll be glad for any help.

There is no maximum value on bonuses, but you can change it yourself by choosing that perhaps the following bonus does not appear in two items...

  • Not Good 1
Link to comment
Share on other sites

15 minutes ago, Psycho said:

There is no maximum value on bonuses, but you can change it yourself by choosing that perhaps the following bonus does not appear in two items...

Thank you for the answer!

I can’t totally agree with what you’re saying tho. There’s this quite big Polish server - Pandora mt2 on which I’ve been playing for some time, where this kind of solution is implemented. You theoretically can have up to 140% (or sth in this ballpark) of resistance against a certain class, yet it doesn’t cause others to deal 0 dmg on You. Admins confirm that these bonuses are capped at 90% and it has to be true. I’ve made class eq for myself with over 100% resistances and got clapped quite a few times. So there has to be a way. 
 

For my purposes tho I’ve decided to go the easier route as my work and everyday life doesn’t allow me to go through code in search of a solution. Maybe one day I’ll decide to dedicate more time to this. For now I’m just limiting amounts by planning bonuses available from 6/7, belts, quests etc.

All things considered- I’m simply curious how the game behaviour I’ve described can be achieved. As I’ve said- maybe one day. 

Link to comment
Share on other sites

  • Contributor
  • Solution

You can do it in battle.cpp. If you give it a search you'll find:

	if (pkAttacker->IsPC())
	{
		switch (pkAttacker->GetJob())
		{
		case JOB_WARRIOR:
			iAtk -= (iAtk * pkVictim->GetPoint(POINT_RESIST_WARRIOR)) / 100;
			break;

		case JOB_ASSASSIN:
			iAtk -= (iAtk * pkVictim->GetPoint(POINT_RESIST_ASSASSIN)) / 100;
			break;

		case JOB_SURA:
			iAtk -= (iAtk * pkVictim->GetPoint(POINT_RESIST_SURA)) / 100;
			break;

		case JOB_SHAMAN:
			iAtk -= (iAtk * pkVictim->GetPoint(POINT_RESIST_SHAMAN)) / 100;
			break;
		}
	}

And you can either do a hard cap, like

	if (pkAttacker->IsPC())
	{
		int32_t pvpRaceResistCap = 80;
		switch (pkAttacker->GetJob())
		{
		case JOB_WARRIOR:
			iAtk -= (iAtk * min(pkVictim->GetPoint(POINT_RESIST_WARRIOR), pvpRaceResistCap)) / 100;
			break;

		case JOB_ASSASSIN:
			iAtk -= (iAtk * min(pkVictim->GetPoint(POINT_RESIST_ASSASSIN), pvpRaceResistCap)) / 100;
			break;

		case JOB_SURA:
			iAtk -= (iAtk * min(pkVictim->GetPoint(POINT_RESIST_SURA), pvpRaceResistCap)) / 100;
			break;

		case JOB_SHAMAN:
			iAtk -= (iAtk * min(pkVictim->GetPoint(POINT_RESIST_SHAMAN), pvpRaceResistCap)) / 100;
			break;
		}
	}

Or something like they've done for the elements and pvm races, where the resistance scales at a different rate than it shows there. Basically, 100% resist bonus gives 80% real resistance, but it can go beyond 80%, in which case 110% resist will give you 88% real.

	if (pkAttacker->IsPC())
	{
		int32_t pvpRaceResistPer100Pct = 80;
		switch (pkAttacker->GetJob())
		{
		case JOB_WARRIOR:
			iAtk -= (iAtk * pvpRaceResistPer100Pct * pkVictim->GetPoint(POINT_RESIST_WARRIOR)) / 10000;
			break;

		case JOB_ASSASSIN:
			iAtk -= (iAtk * pvpRaceResistPer100Pct * pkVictim->GetPoint(POINT_RESIST_ASSASSIN)) / 10000;
			break;

		case JOB_SURA:
			iAtk -= (iAtk * pvpRaceResistPer100Pct * pkVictim->GetPoint(POINT_RESIST_SURA)) / 10000;
			break;

		case JOB_SHAMAN:
			iAtk -= (iAtk * pvpRaceResistPer100Pct * pkVictim->GetPoint(POINT_RESIST_SHAMAN)) / 10000;
			break;
		}
	}

You can also combine the 2 of them, idk. Or maybe don't fucking give 10% bonus?? Give them something like 5-8% and call it a day

Link to comment
Share on other sites

6 hours ago, Amun said:

You can do it in battle.cpp. If you give it a search you'll find:

	if (pkAttacker->IsPC())
	{
		switch (pkAttacker->GetJob())
		{
		case JOB_WARRIOR:
			iAtk -= (iAtk * pkVictim->GetPoint(POINT_RESIST_WARRIOR)) / 100;
			break;

		case JOB_ASSASSIN:
			iAtk -= (iAtk * pkVictim->GetPoint(POINT_RESIST_ASSASSIN)) / 100;
			break;

		case JOB_SURA:
			iAtk -= (iAtk * pkVictim->GetPoint(POINT_RESIST_SURA)) / 100;
			break;

		case JOB_SHAMAN:
			iAtk -= (iAtk * pkVictim->GetPoint(POINT_RESIST_SHAMAN)) / 100;
			break;
		}
	}

And you can either do a hard cap, like

	if (pkAttacker->IsPC())
	{
		int32_t pvpRaceResistCap = 80;
		switch (pkAttacker->GetJob())
		{
		case JOB_WARRIOR:
			iAtk -= (iAtk * min(pkVictim->GetPoint(POINT_RESIST_WARRIOR), pvpRaceResistCap)) / 100;
			break;

		case JOB_ASSASSIN:
			iAtk -= (iAtk * min(pkVictim->GetPoint(POINT_RESIST_ASSASSIN), pvpRaceResistCap)) / 100;
			break;

		case JOB_SURA:
			iAtk -= (iAtk * min(pkVictim->GetPoint(POINT_RESIST_SURA), pvpRaceResistCap)) / 100;
			break;

		case JOB_SHAMAN:
			iAtk -= (iAtk * min(pkVictim->GetPoint(POINT_RESIST_SHAMAN), pvpRaceResistCap)) / 100;
			break;
		}
	}

Or something like they've done for the elements and pvm races, where the resistance scales at a different rate than it shows there. Basically, 100% resist bonus gives 80% real resistance, but it can go beyond 80%, in which case 110% resist will give you 88% real.

	if (pkAttacker->IsPC())
	{
		int32_t pvpRaceResistPer100Pct = 80;
		switch (pkAttacker->GetJob())
		{
		case JOB_WARRIOR:
			iAtk -= (iAtk * pvpRaceResistPer100Pct * pkVictim->GetPoint(POINT_RESIST_WARRIOR)) / 10000;
			break;

		case JOB_ASSASSIN:
			iAtk -= (iAtk * pvpRaceResistPer100Pct * pkVictim->GetPoint(POINT_RESIST_ASSASSIN)) / 10000;
			break;

		case JOB_SURA:
			iAtk -= (iAtk * pvpRaceResistPer100Pct * pkVictim->GetPoint(POINT_RESIST_SURA)) / 10000;
			break;

		case JOB_SHAMAN:
			iAtk -= (iAtk * pvpRaceResistPer100Pct * pkVictim->GetPoint(POINT_RESIST_SHAMAN)) / 10000;
			break;
		}
	}

You can also combine the 2 of them, idk. Or maybe don't fucking give 10% bonus?? Give them something like 5-8% and call it a day


Oh my! Thank You so much for this!

I've gone with the 5% bonus option (so overall players can't reach 100% in eq) but it's nice to have other possibilities.

  • Good 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.