forums | blogs | polls | tutorials | downloads | rules | help

Add new comment

BL001 wrote:
It seems like such a simple thing to have included in the item templates, something like an item level that would fit into the ranges of drops that monsters carry..

I did not really care that much about modding in DS1, however after scrolling through pcontent.skrit, it seems that the 'power$' variable represents some kind of item level.

The calc_item_power$() function is quite interesting, there must be the global (pre-defined) variables item_power_min$ item_power_max$ and I assume they carry the damage minimum and maximum of a weapon (or other values, but proportional to these stats).
For an armor piece it's probably twice the same value - wild assumption though, but comments it this function are partially speaking of 'defense rating'.

Now at the beginning of the calc_item_power$() function the average of item_power_min$ and item_power_max$ is taken to assign this power value (= item level?).
Rings and amulets have neither a damage or a defense stat of course, and there's actually a comment at the end of pcontent.skrit refering to that issue.

It's unclear to me how potion or spell drops are handled, but assumed once power$ represents the average stats value or a weapon or armor piece, it's significant that this number - by trend - will be increased for items that usually have lower stats (for example mage armors) and lowered for items with higher stats (like two-handed staffs). It seems that happens in order to get all item powers on the same (item) level as figher pieces have (armor or 1-handed).

power$ = power$ - (power$ * ((((item_power_max$ - item_power_min$) / 2) / power$) / 10))
An almost frightening formula - it took a while until I recognized that it is simply reducing the power$ by 5% of the diffrence of damage minimum and maximum - it must be intention that this formula is skipped for armor pieces (useless, if the assumption above is ok, the difference would be zero anyway).

Hence if a 1-handed sword does a damage of 20 until 30, its power should be 24.5 !(?)
No idea however if a drop request like '#weapon/21-28' really would be appropriate to produce this sword. There are several other things too that probably need to be taken into account - like the rather intransparent 'modifier' handling.