Skill charges in Magicsuffix param question.

Post here about all aspects of D2 mod making whether it's information, problems or whatever. Please specify whether your post is relating to Classic D2 or the Expansion.

Moderator: Nizari

Post Reply
User avatar
ReverendR
Posts: 17
Joined: Thu Jan 23, 2003 9:07 am
Location: SoCal

Skill charges in Magicsuffix param question.

Post by ReverendR » Wed Feb 12, 2003 10:33 pm

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
"I never would have thought of that. That's probably why I'm dead."

User avatar
Joel
Moderator
Dominion
Posts: 6921
Joined: Mon May 27, 2002 7:19 am
Location: Orsay
Contact:

Hand-picked

Re: Skill charges in Magicsuffix param question.

Post by Joel » Wed Feb 12, 2003 10:42 pm

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

User avatar
Nefarius
Retired Admin
Cherub
Posts: 11607
Joined: Sat Jun 15, 2002 8:13 pm
Location: Where the blood forever rains
Contact:

Hand-picked

Re: Skill charges in Magicsuffix param question.

Post by Nefarius » Wed Feb 12, 2003 10:51 pm

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 game can basically be considered unhackable. '' - Blizzard Entertainment (30th May 2000)
Black Omen Productions | MetalStorm: Progress Report | Screenshots

User avatar
ReverendR
Posts: 17
Joined: Thu Jan 23, 2003 9:07 am
Location: SoCal

Re: Skill charges in Magicsuffix param question.

Post by ReverendR » Wed Feb 12, 2003 10:58 pm

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

Hammerman
Junior Member
Champion of the Light
Posts: 263
Joined: Sun Jun 02, 2002 2:08 am

Hand-picked

Re: Skill charges in Magicsuffix param question.

Post by Hammerman » Thu Feb 13, 2003 12:47 am

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.
Last edited by Hammerman on Thu Feb 13, 2003 1:48 am, edited 1 time in total.

User avatar
Alkalund
Retired Admin
Throne
Posts: 7597
Joined: Sun May 26, 2002 5:54 pm
Location: Toronto, Ontario, Canada
Contact:

Hand-picked

Re: Skill charges in Magicsuffix param question.

Post by Alkalund » Thu Feb 13, 2003 1:50 am

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 ;)

Ruvanal
Junior Member
Champion of the Light
Posts: 364
Joined: Sun May 26, 2002 1:16 am

Re: Skill charges in Magicsuffix param question.

Post by Ruvanal » Thu Feb 13, 2003 9:55 pm

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

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

Re: Skill charges in Magicsuffix param question.

Post by Red Havoc » Thu Feb 13, 2003 10:45 pm

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

Hammerman
Junior Member
Champion of the Light
Posts: 263
Joined: Sun Jun 02, 2002 2:08 am

Hand-picked

Re: Skill charges in Magicsuffix param question.

Post by Hammerman » Thu Feb 13, 2003 10:59 pm

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

User avatar
Alkalund
Retired Admin
Throne
Posts: 7597
Joined: Sun May 26, 2002 5:54 pm
Location: Toronto, Ontario, Canada
Contact:

Hand-picked

Re: Skill charges in Magicsuffix param question.

Post by Alkalund » Fri Feb 14, 2003 12:36 am

[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 ;)

Ruvanal
Junior Member
Champion of the Light
Posts: 364
Joined: Sun May 26, 2002 1:16 am

Re: Skill charges in Magicsuffix param question.

Post by Ruvanal » Fri Feb 14, 2003 10:45 pm

[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
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=18).
but what showed in in the guides is
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.
(note what got cut out at the end)

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

pmak
Posts: 5
Joined: Wed Feb 05, 2003 7:10 am

Re: Skill charges in Magicsuffix param question.

Post by pmak » Fri Mar 14, 2003 12:41 pm

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?

Ruvanal
Junior Member
Champion of the Light
Posts: 364
Joined: Sun May 26, 2002 1:16 am

Re: Skill charges in Magicsuffix param question.

Post by Ruvanal » Sat Mar 15, 2003 12:44 pm

[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 mod1max.

Try again from this change.

pmak
Posts: 5
Joined: Wed Feb 05, 2003 7:10 am

Re: Skill charges in Magicsuffix param question.

Post by pmak » Sat Mar 15, 2003 11:00 pm

[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 mod1max.

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.

pmak
Posts: 5
Joined: Wed Feb 05, 2003 7:10 am

Re: Skill charges in Magicsuffix param question.

Post by pmak » Sat Mar 15, 2003 11:06 pm

And for multishot on gloves:

uselvl = 55
max = -4

=> slvl = 4

min = -20

=> charges = 30

User avatar
Alkalund
Retired Admin
Throne
Posts: 7597
Joined: Sun May 26, 2002 5:54 pm
Location: Toronto, Ontario, Canada
Contact:

Hand-picked

Re: Skill charges in Magicsuffix param question.

Post by Alkalund » Sun Mar 16, 2003 1:24 am

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 ;)

User avatar
Ulmo
Forum Regular
Angel
Posts: 860
Joined: Fri Jun 04, 2004 5:04 pm

Re: Skill charges in Magicsuffix param question.

Post by Ulmo » Sun Jan 16, 2005 6:17 pm

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:

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
I have two kinds of items, 30 charges of level 4, and 52 charges of level 6.

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
Any clue ?


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.

Post Reply

Return to “General Mod Making”