Titan Quest Fans Forum

Titan Quest - Anniversary Edition => Modifications => Topic started by: Adehmar on 25 February 2021, 23:38:53

Title: How does "item weight" work?
Post by: Adehmar on 25 February 2021, 23:38:53
So I finally got modding running. Now, editing files, how do weights work?

Suppose there's only 1 drop is allowed, and 2 different items can drop.

If I put 90 in one and 10 in the other under "item weight", does it mean I have 90 % chance to drop the first, and 10 % chance to drop the other? Or I am mistaken?

What about in other cases where I see various item weights and some have 2000, another 500, another 400, another 1500, another 100, another 80. How does it work in that case?
Title: Re: How does "item weight" work?
Post by: Ninakoru on 26 February 2021, 10:35:35
Example: if an item has 1000 weight for Affix A, 200 weight for Affix B, and 20 weight for affix C.

Each time you get that item, there's a dice roll between 1-1220 (the sum of all weights). From 1 to 1000 you get Affix A, from 1001 to 1200 you get Affix B, from 1201 to 1220 you get Affix C.

So to view it as a percent chance, divide each individual weight by the total weight of all items involved, multiply per 100. In the example:

Affix A: 81.97%
Affix B: 16.39%
Affix C: 1.64%

SimplePortal 2.3.7 © 2008-2021, SimplePortal