## Skill charges in Magicsuffix param question.

**Moderator:** Nizari

### Skill charges in Magicsuffix param question.

OK, I was about to start messing with magicsuffix.txt to tweak the charged skills that are available (and what levels they appear at). However, the numbers there don't seem to use the same rules as charged skills in Uniqueitems.txt. Param1 seems to still be the skill, but the min and max are both negative. How does that work?

Thanks,

Rev

Thanks,

Rev

"I never would have thought of that. That's probably why I'm dead."

### Re: Skill charges in Magicsuffix param question.

what ???

negative values ?

are you sure you get the proper file ?

negative values ?

are you sure you get the proper file ?

*"How much suffering, mortal, does it take before you lose your grace?"*

Shadow Empire (coming soon) | forum

- Nefarius
- Cherub
**Posts:**11607**Joined:**Sat Jun 15, 2002 8:13 pm**Location:**Where the blood forever rains-
**Contact:**

### Re: Skill charges in Magicsuffix param question.

yes, I saw this as well once. In Magicprefix/Magicsuffix.txt.

The items are set to 100 in version so it probably works the same it does for monsters in levels.txt

normal d2 monsters need negative numbers to spawn, this may use the same method for skills.

The items are set to 100 in version so it probably works the same it does for monsters in levels.txt

normal d2 monsters need negative numbers to spawn, this may use the same method for skills.

''(...)

Black Omen Productions | MetalStorm: Progress Report | Screenshots

*The game can basically be considered unhackable.*'' - Blizzard Entertainment (30th May 2000)Black Omen Productions | MetalStorm: Progress Report | Screenshots

### Re: Skill charges in Magicsuffix param question.

Yep. It's MagicSuffix.txt.

"of Magic Arrows" has a mod1code of "charged" a mod1param of 6, a mod1min of -30 and a mod1max of -10. If there are two versions of the suffix then the second has smaller numbers than the first.

My guess is that there's an equation somewhere that takes these, the mlvl of the monster that dropped it, the phase of the moon and wether it's Wednesday or not and then figures out the number of charges and the level of the skill.

I'll poke at it a bit and see what happens/breaks.

"of Magic Arrows" has a mod1code of "charged" a mod1param of 6, a mod1min of -30 and a mod1max of -10. If there are two versions of the suffix then the second has smaller numbers than the first.

My guess is that there's an equation somewhere that takes these, the mlvl of the monster that dropped it, the phase of the moon and wether it's Wednesday or not and then figures out the number of charges and the level of the skill.

I'll poke at it a bit and see what happens/breaks.

Last edited by ReverendR on Wed Feb 12, 2003 10:58 pm, edited 1 time in total.

"I never would have thought of that. That's probably why I'm dead."

### Re: Skill charges in Magicsuffix param question.

This is for items with the "charged" mod, I have yet to look at the 3 hitskill mods.

First, if "max" is 0, then it does:

slvl = (X + (ilvl - reqlvl) / 4) + 1

X = 3 if ilvl - reqlvl < 0, else 0

reqlvl is the reqlvl from skills.txt

Then it checks if the slvl is at least 1, and 20 or less and modifies it according to that (so it will be a value from 1 to 20).

If "max" is a negative value, it does:

slvl = (ilvl - uselvl) / neg(99 - uselvl / max)

99 - uselevel is always at least 1. it also makes sure that neg(99...) is at least 1 before the divison.

uselvl is the highest of reqlvl from skills.txt and level from affix.txt.

Now it only checks if it is at least 1, no upper cap.

After it calculates number of charges, it gets slvl:

num_charges = (neg(min) * slvl) / 8 + neg(min)

min is just the value from min column in affix.txt. num_charges is then capped at 255. It then calculates the charges left when spawned:

spawn_charges = 1 + (num_charges / 8 ) + rnd[num_charges - (num_charges / 8 )]

That should cover it.

First, if "max" is 0, then it does:

slvl = (X + (ilvl - reqlvl) / 4) + 1

X = 3 if ilvl - reqlvl < 0, else 0

reqlvl is the reqlvl from skills.txt

Then it checks if the slvl is at least 1, and 20 or less and modifies it according to that (so it will be a value from 1 to 20).

If "max" is a negative value, it does:

slvl = (ilvl - uselvl) / neg(99 - uselvl / max)

99 - uselevel is always at least 1. it also makes sure that neg(99...) is at least 1 before the divison.

uselvl is the highest of reqlvl from skills.txt and level from affix.txt.

Now it only checks if it is at least 1, no upper cap.

After it calculates number of charges, it gets slvl:

num_charges = (neg(min) * slvl) / 8 + neg(min)

min is just the value from min column in affix.txt. num_charges is then capped at 255. It then calculates the charges left when spawned:

spawn_charges = 1 + (num_charges / 8 ) + rnd[num_charges - (num_charges / 8 )]

That should cover it.

Last edited by Hammerman on Thu Feb 13, 2003 1:48 am, edited 1 time in total.

- Alkalund
- Throne
**Posts:**7597**Joined:**Sun May 26, 2002 5:54 pm**Location:**Toronto, Ontario, Canada-
**Contact:**

### Re: Skill charges in Magicsuffix param question.

Just so noone stays wondering what I edited on Hammerman's post above, I added two spaces to it. So, where before you read

spawn_charges = 1 + (num_charges / 8) + rnd[num_charges - (num_charges / 8)]

you now read

spawn_charges = 1 + (num_charges / 8 ) + rnd[num_charges - (num_charges / 8 )]

as it was meant to

spawn_charges = 1 + (num_charges / 8) + rnd[num_charges - (num_charges / 8)]

you now read

spawn_charges = 1 + (num_charges / 8 ) + rnd[num_charges - (num_charges / 8 )]

as it was meant to

### Re: Skill charges in Magicsuffix param question.

Those 8) smilies are annoying considering the type of code writing we sometimes use around here.

- Red Havoc
- Arch-Angel
**Posts:**1191**Joined:**Sun May 26, 2002 8:57 pm**Location:**Berlin, Germany-
**Contact:**

### Re: Skill charges in Magicsuffix param question.

That´s why there´s an "Disable Smilies in this post" checkbox at the bottom of the new message screen. So if you don´t want to review your code for potential trouble, you can simply activate that box and no smilies will be displayed.

Last edited by Red Havoc on Fri Feb 14, 2003 12:16 am, edited 1 time in total.

**PLEASE READ THE TERMS OF SERVICE BEFORE POSTING**

Avatar image is Scrat from 'IceAge' by Blue Sky Studios and Twentieth Century Fox

### Re: Skill charges in Magicsuffix param question.

Heh, didn't notice that. Thanks for the correction Alkalund

- Alkalund
- Throne
**Posts:**7597**Joined:**Sun May 26, 2002 5:54 pm**Location:**Toronto, Ontario, Canada-
**Contact:**

### Re: Skill charges in Magicsuffix param question.

[quote="Hammerman";p="67417"]Heh, didn't notice that. Thanks for the correction Alkalund [/quote]

No problem The 8 ) coming out as 8) is one of our most common 'unwanted' writing side effects. If you didn't use smileys in your post and wants to make sure none will come out, use the 'Disable Smileys' option as Red Havoc suggested

No problem The 8 ) coming out as 8) is one of our most common 'unwanted' writing side effects. If you didn't use smileys in your post and wants to make sure none will come out, use the 'Disable Smileys' option as Red Havoc suggested

### Re: Skill charges in Magicsuffix param question.

[quote="Alkalund";p="67462"][quote="Hammerman";p="67417"]Heh, didn't notice that. Thanks for the correction Alkalund :)[/quote]

No problem :) The 8 ) coming out as 8) is one of our most common 'unwanted' writing side effects. If you didn't use smileys in your post and wants to make sure none will come out, use the 'Disable Smileys' option as Red Havoc suggested ;)[/quote]

Actually the bigger problem that I have had with it is the filtering out of smiles in some places. Most specifically in some of Ric Faith's file guides (e.g. magicprefix.txt for one). I had written part of what he used in the annex as

I had sent a message about this, but nothing has been done to correct it.

No problem :) The 8 ) coming out as 8) is one of our most common 'unwanted' writing side effects. If you didn't use smileys in your post and wants to make sure none will come out, use the 'Disable Smileys' option as Red Havoc suggested ;)[/quote]

Actually the bigger problem that I have had with it is the filtering out of smiles in some places. Most specifically in some of Ric Faith's file guides (e.g. magicprefix.txt for one). I had written part of what he used in the annex as

but what showed in in the guides ismagic_lvl = magic level bonus on some items. Currently the only ones that have this are wands (normal and exceptional, but not the elite ones), staves, orbs (all with a value of 1) and circlets (circlet=3, Coronet=8, Tiara=13, Diadem=18).

(note what got cut out at the end)magic_lvl = magic level bonus on some items. Currently the only ones that have this are wands (normal and exceptional, but not the elite ones), staves, orbs (all with a value of 1) and circlets (circlet=3, Coronet=8, Tiara=13, Diadem=1.

I had sent a message about this, but nothing has been done to correct it.

### Re: Skill charges in Magicsuffix param question.

I'm trying to calculate the slvl and max charges that a Bow of Multiple Shot would get, assuming its ilvl is 90. Can someone check my calculations please?

> First, if "max" is 0, then it does

>

> slvl = (X + (ilvl - reqlvl) / 4) + 1

>

> X = 3 if ilvl - reqlvl & 0, else 0

> reqlvl is the reqlvl from skills.txt

I'm assuming that by "max", you mean "maxlevel" in magicsuffix.txt. That column seems to be empty for Multiple Shot. So...

max = 0

reqlvl = 6

ilvl = 90

X = 0, since ilvl - reqlvl > 0

slvl = (X + (ilvl - reqlvl) / 4) + 1

= (0 + (90 - 6) / 4) + 1

= 22

> Then it checks if the slvl is at least 1, and 20 or less and modifies it

> according to that (so it will be a value from 1 to 20).

So slvl becomes 20.

> num_charges = (neg(min) * slvl) / 8 + neg(min)

>

> min is just the value from min column in affix.txt. num_charges is then

> capped at 255.

I can't find an affix.txt. I'm assuming you mean the mod1min column from magicsuffix.txt. That is either -30 or -20, depending on which row for Multiple Shot I choose. So:

num_charges = (30 * slvl) / 8 + 30 = 105

or

num_charges = (20 * slvl) / 8 + 20 = 70

Does that look about right? And how do I decide which row for Multiple Shot to take the numbers from, in magicsuffix.txt?

> First, if "max" is 0, then it does

>

> slvl = (X + (ilvl - reqlvl) / 4) + 1

>

> X = 3 if ilvl - reqlvl & 0, else 0

> reqlvl is the reqlvl from skills.txt

I'm assuming that by "max", you mean "maxlevel" in magicsuffix.txt. That column seems to be empty for Multiple Shot. So...

max = 0

reqlvl = 6

ilvl = 90

X = 0, since ilvl - reqlvl > 0

slvl = (X + (ilvl - reqlvl) / 4) + 1

= (0 + (90 - 6) / 4) + 1

= 22

> Then it checks if the slvl is at least 1, and 20 or less and modifies it

> according to that (so it will be a value from 1 to 20).

So slvl becomes 20.

> num_charges = (neg(min) * slvl) / 8 + neg(min)

>

> min is just the value from min column in affix.txt. num_charges is then

> capped at 255.

I can't find an affix.txt. I'm assuming you mean the mod1min column from magicsuffix.txt. That is either -30 or -20, depending on which row for Multiple Shot I choose. So:

num_charges = (30 * slvl) / 8 + 30 = 105

or

num_charges = (20 * slvl) / 8 + 20 = 70

Does that look about right? And how do I decide which row for Multiple Shot to take the numbers from, in magicsuffix.txt?

### Re: Skill charges in Magicsuffix param question.

[quote=pmak";p="77746"]I'm trying to calculate the slvl and max charges that a Bow of Multiple Shot would get, assuming its ilvl is 90. Can someone check my calculations please?

> First, if "max" is 0, then it does

>

> slvl = (X + (ilvl - reqlvl) / 4) + 1

>

> X = 3 if ilvl - reqlvl & 0, else 0

> reqlvl is the reqlvl from skills.txt

I'm assuming that by "max", you mean "maxlevel" in magicsuffix.txt. That column seems to be empty for Multiple Shot. So...

[/quote]

The maxlevel column is to set a maximum alvl that the affix can spawn at.

In my file the max is -8 or -4 depending on the specific affix in question (it is -8 for the affix that can appear on bows), column

Try again from this change.

> First, if "max" is 0, then it does

>

> slvl = (X + (ilvl - reqlvl) / 4) + 1

>

> X = 3 if ilvl - reqlvl & 0, else 0

> reqlvl is the reqlvl from skills.txt

I'm assuming that by "max", you mean "maxlevel" in magicsuffix.txt. That column seems to be empty for Multiple Shot. So...

[/quote]

The maxlevel column is to set a maximum alvl that the affix can spawn at.

In my file the max is -8 or -4 depending on the specific affix in question (it is -8 for the affix that can appear on bows), column

*mod1*.**max**Try again from this change.

### Re: Skill charges in Magicsuffix param question.

[quote=Ruvanal";p="78071"]The maxlevel column is to set a maximum alvl that the affix can spawn at.

In my file the max is -8 or -4 depending on the specific affix in question (it is -8 for the affix that can appear on bows), column

Try again from this change.[/quote]

Okay...

> If "max" is a negative value, it does:

>

> slvl = (ilvl - uselvl) / neg(99 - uselvl / max)

>

> 99 - uselevel is always at least 1. it also makes sure that neg(99...) is

> at least 1 before the divison.

> uselvl is the highest of reqlvl from skills.txt and level from affix.txt.

By "reqlvl from affix.txt", I'm assuming you mean "levelreq" from "magicsuffix.txt". For multishot on bows, this is 19. On skills.txt, the "reqlevel" for multishot is 6. So...

ilvl = 99

max = -8

uselvl = 19

The formula above seems to be missing a pair of brackets needed to force the correct operator precedence; if I interpret it this way (dividing uselvl by max first):

($ilvl - $uselvl) / -(99 - $uselvl / $max)

then the resulting slvl becomes -1, which doesn't make sense. But if I interpret it this way:

($ilvl - $uselvl) / -((99 - $uselvl) / $max)

then the resulting slvl becomes 8, which is consistent with someone else telling me that the best he's seen in the game is 60 charges of level 8 multishot.

Now, calculating the number of charges:

> num_charges = (neg(min) * slvl) / 8 + neg(min)

min = mod1min = -30

slvl = 8

num_charges = 60

Okay, so it appears that the best possible multishot is 60 charges of level 8, which is consistent with what someone else told me was the best he's ever seen.

In my file the max is -8 or -4 depending on the specific affix in question (it is -8 for the affix that can appear on bows), column

*mod1*.**max**Try again from this change.[/quote]

Okay...

> If "max" is a negative value, it does:

>

> slvl = (ilvl - uselvl) / neg(99 - uselvl / max)

>

> 99 - uselevel is always at least 1. it also makes sure that neg(99...) is

> at least 1 before the divison.

> uselvl is the highest of reqlvl from skills.txt and level from affix.txt.

By "reqlvl from affix.txt", I'm assuming you mean "levelreq" from "magicsuffix.txt". For multishot on bows, this is 19. On skills.txt, the "reqlevel" for multishot is 6. So...

ilvl = 99

max = -8

uselvl = 19

The formula above seems to be missing a pair of brackets needed to force the correct operator precedence; if I interpret it this way (dividing uselvl by max first):

($ilvl - $uselvl) / -(99 - $uselvl / $max)

then the resulting slvl becomes -1, which doesn't make sense. But if I interpret it this way:

($ilvl - $uselvl) / -((99 - $uselvl) / $max)

then the resulting slvl becomes 8, which is consistent with someone else telling me that the best he's seen in the game is 60 charges of level 8 multishot.

Now, calculating the number of charges:

> num_charges = (neg(min) * slvl) / 8 + neg(min)

min = mod1min = -30

slvl = 8

num_charges = 60

Okay, so it appears that the best possible multishot is 60 charges of level 8, which is consistent with what someone else told me was the best he's ever seen.

### Re: Skill charges in Magicsuffix param question.

And for multishot on gloves:

uselvl = 55

max = -4

=> slvl = 4

min = -20

=> charges = 30

uselvl = 55

max = -4

=> slvl = 4

min = -20

=> charges = 30

- Alkalund
- Throne
**Posts:**7597**Joined:**Sun May 26, 2002 5:54 pm**Location:**Toronto, Ontario, Canada-
**Contact:**

### Re: Skill charges in Magicsuffix param question.

pmak, please do not post consecutive messages in such a short time interval. Use the Edit button to edit your message instead, thanks.

And welcome to the Phrozen Keep, by the way

And welcome to the Phrozen Keep, by the way

### Re: Skill charges in Magicsuffix param question.

Hello, this is my first post on this forum I apologies for my basic english...

I tried this formula with objects of Ilvl 79 getting charges of telekinesis:
I have two kinds of items, 30 charges of level 4, and 52 charges of level 6.

Trying calculations :

Edit : Solved !

Myrdinn answered here.

The uselevel is in fact reqlevel of skills.txt, without beeing compared to AffixLevel.

So for negative Max, formula is :

slvl = (ILvl - SkillReqLvl) / neg((99 - SkillReqLvl) / max)

I tried this formula with objects of Ilvl 79 getting charges of telekinesis:

Code: Select all

```
Name level levelreq class classlevelreq mod1code mod1param mod1min mod1max
of Telekinesis 12 12 sor 6 charged 43 -30 -8
of Telekinesis 24 24 sor 6 charged 43 -20 -5
```

Trying calculations :

- first case :

Ilvl = 79.

Reqlevel of skill= 6

Level of affixe = 12

uselevel = 12

slvl = (ilvl - uselvl) / neg((99 - uselvl) / max)

= 67 / (87 / 8)

= 67 / 10

= 6

num_charges = (neg(min) * slvl) / 8 + neg(min)

= (30 * 6) / 8 + 30

= 180 / 8 + 30

= 22 + 30

= 52 OK - Second case :

Ilvl = 79.

Reqlevel of skill = 6

Level of affixe = 24

uselevel = 24

slvl = (ilvl - uselvl) / neg((99 - uselvl) / max)

= 55 / (75 / 5)

= 55 / 15

= 3 instead of 4

num_charges = (neg(min) * slvl) / 8 + neg(min)

= (20 * 3) / 8 + 20

= 60 / 8 + 20

= 7 + 20

= 27 slvl = 4 would have given 30

Edit : Solved !

Myrdinn answered here.

The uselevel is in fact reqlevel of skills.txt, without beeing compared to AffixLevel.

So for negative Max, formula is :

slvl = (ILvl - SkillReqLvl) / neg((99 - SkillReqLvl) / max)

Last edited by Ulmo on Thu Oct 06, 2005 9:09 pm, edited 1 time in total.