ShellLevel as multiplier to Calculate Effect maximum

07/11/2019 00:00 Sevendes#1
I want to migrate that the Max EffectLvl like max SDmg = 40%

Get Calculated by Shelllevel.

for Example

Max HPSl = 9

But when ShellLevel is >60
then multiplier = 0.5

so max hpsl on a shell with lvl >60 is 4.5

So the same like this
Code:
short CalculateEffect(short maximum)
{
	if (maximum == 0)
	{
		return 1;
	}
	else
	{
		double multiplier = 0;
		switch (Rare)
		{
			case 0:
			case 1:
			case 2:
				multiplier = 0.6;
				break;

			case 3:
				multiplier = 0.65;
				break;

			case 4:
				multiplier = 0.75;
				break;

			case 5:
				multiplier = 0.85;
				break;

			case 6:
				multiplier = 0.95;
				break;

			case 7:
			case 8:
				multiplier = 1;
				break;
		}
	}
	// ...
}
I dont want to replace the multiplier from rare lvl i only want to add that he calculate the ShellLevel too.

I know that ShellLevel is set as Design so if Shell has ItemDesign = 80 its lvl 80. But idk how i add this to the source.

Sorry for Bad English and that i repeated me.

(I Speak German)

Thanks for your Help
07/11/2019 11:20 erixor#2
On ciapa's source, I think the shell level is actually set into the "Upgrade" column of the ItemInstance, which would make sense considering this piece of code in the SetShellEffects.

Code:
                    var min = (short)((maximum / 80D) * (Upgrade - 20) * multiplier);
                    var max = (short)((maximum / 80D) * Upgrade * multiplier);

                    if (min == 0)
                    {
                        min = 1;
                    }
                    if (max <= min)
                    {
                        max = (short)(min + 1);
                    }
you can test smth here, try it out by yourself to understand how it works, you can try adding simple if statements above the calulation like this:

Code:
if (Upgrade < 60)
{
    multiplier = 0.5;
}
This is not the proper way to do it, but it will help you understand better how the system works
07/11/2019 20:04 Sevendes#3
@[Only registered and activated users can see links. Click Here To Register...] Actually its upgrade Thanks you alot for the Help man!
07/12/2019 02:22 IceTrailer#4
#closed