Level ranges on %chance to cast level x-y spell on hit/damage taken
Moderator: Nizari
Level ranges on %chance to cast level x-y spell on hit/damage taken
I am making a tool that can auto generate documentation for mods based on .txt and .tbl files for a modder. I have it completed for the vanilla files for d2 1.13c and probably also for 1.10, but that is yet to be tested.
I have 1 last issue remaining and that is these "%chance to cast level x-y spell on hit/damage taken". It works fine for me when the level is not a range: "Level ranges on %chance to cast level x spell on hit/damage taken", but for ranges the parameter is just 0 and I just can't figure where this level range is coming from then.
In for example the unique stormrider, the parameters from UniqueItems.txt are as follows:
get-hit 3 50 0
Which shows as this when I generate the documentation:
10% Chance to cast level 0 Charged Bolt on striking
This is supposed to look like this:
10% Chance To Cast Level 13-20 Charged Bolt On Striking
I just can't find where the 13-20 is coming from, is this hard coded? Is it from another file?
I have 1 last issue remaining and that is these "%chance to cast level x-y spell on hit/damage taken". It works fine for me when the level is not a range: "Level ranges on %chance to cast level x spell on hit/damage taken", but for ranges the parameter is just 0 and I just can't figure where this level range is coming from then.
In for example the unique stormrider, the parameters from UniqueItems.txt are as follows:
get-hit 3 50 0
Which shows as this when I generate the documentation:
10% Chance to cast level 0 Charged Bolt on striking
This is supposed to look like this:
10% Chance To Cast Level 13-20 Charged Bolt On Striking
I just can't find where the 13-20 is coming from, is this hard coded? Is it from another file?
Re: Level ranges on %chance to cast level x-y spell on hit/damage taken
A value of 0 for slvl forces the game to default to the ilvl for basing affixes off. This is not random, for example a ilvl 77 will never roll beneath slvl20. Should also be noted that this behaviour caps at slvl 20. The calculation seems to be:
ilvl/3.9=slvl, rouded up after 0.5, with a min and max of 1 and 20.
example ilvl53/3.9 = 13.589, because it's rounded up after 0.5 ilvl53 always rolls with slvl14.
ilvl99-77 is always slvl20
ilvl76-73 is always slvl19
etc
ilvl52-49 is always slvl13
ilvl/3.9=slvl, rouded up after 0.5, with a min and max of 1 and 20.
example ilvl53/3.9 = 13.589, because it's rounded up after 0.5 ilvl53 always rolls with slvl14.
ilvl99-77 is always slvl20
ilvl76-73 is always slvl19
etc
ilvl52-49 is always slvl13
Re: Level ranges on %chance to cast level x-y spell on hit/damage taken
Awesome thanks man!
EDIT:
This does not explain ranges to me though? I mean, I can sure calculate that to the ilvl of the unique, but in this case it should be 13-20. In that case is it always ilvl to 20? That does not seem right to me, but it could be that it is?
EDIT:
This does not explain ranges to me though? I mean, I can sure calculate that to the ilvl of the unique, but in this case it should be 13-20. In that case is it always ilvl to 20? That does not seem right to me, but it could be that it is?
Re: Level ranges on %chance to cast level x-y spell on hit/damage taken
Depends on the ilvl it spawns with. If baal drops it it'll be ilvl 99 and there for slvl 20. If it drops late nightmare it might only be ilvl53. Hence where you end up with a slvl range.
Re: Level ranges on %chance to cast level x-y spell on hit/damage taken
Ahh, so it's from the minimum ilvl it can drop as to the max it can drop as! I get it. Is there a way to get these numbers from the .txt files?
Re: Level ranges on %chance to cast level x-y spell on hit/damage taken
Well the cap is always slvl 20 because every item can drop at ilvl 99. The low end you would have to calculate based of the qlvl in uniqueitems. If min qlvl is 39 then the min slvl would be 10, so it would have a range of 10-20.
Re: Level ranges on %chance to cast level x-y spell on hit/damage taken
I am not sure if it is because the diablo fandom wiki is wrong then, but I did as you say and it looks right for most items, but an item like this: https://diablo.fandom.com/wiki/Snowclash
Shows as 7-19 on this website, but will show as 13-20 for me.
Shows as 7-19 on this website, but will show as 13-20 for me.
Re: Level ranges on %chance to cast level x-y spell on hit/damage taken
That's correct, this changes when the skill in question has a required level. Blizzard has a required level of 24 so that is the ilvl that it starts counting up from. It's my mistake for not giving you a more global formula in the first place. A better formula would be:
(ilvl-(rqlvl-1))/3.9=slvl
ilvl = item level
rqlvl = player level required to use skill
slvl = skill level
Rouded up after 0.5, with a min and max of 1 and 20.
Example: ilvl49 snowclash,
(49-(24-1))/3.9=6.667, rounded up to 7.
afaik this formula would work for all proc skills such as; gethit, hit-skill, etc.
(ilvl-(rqlvl-1))/3.9=slvl
ilvl = item level
rqlvl = player level required to use skill
slvl = skill level
Rouded up after 0.5, with a min and max of 1 and 20.
Example: ilvl49 snowclash,
(49-(24-1))/3.9=6.667, rounded up to 7.
afaik this formula would work for all proc skills such as; gethit, hit-skill, etc.
Re: Level ranges on %chance to cast level x-y spell on hit/damage taken
Awesome, thanks! But in this case this sash has a max level of 19 for this blizzard. Is that just a mistake then? In theory it could drop as level 20?
Re: Level ranges on %chance to cast level x-y spell on hit/damage taken
If it could reach ilvl100 it would drop as slvl20 yeah. But with ilvl99 it can only reach slvl19. Tested with the formula and it checks out.
Re: Level ranges on %chance to cast level x-y spell on hit/damage taken
Thanks, this was a big help!