Development Log

Dynamic Loot Generator will consist of two halves, and will be Player Driven.

1st Half

The Forge of Olonwi, when used by a player, will store the INT Value of any item property it transfers, into the nwnx database. It will only store item properties that have not been stored yet. Eg - On Hit Vampiric Touch Level 10, would not get stored, if that was already there. However, On Hit Vampiric Touch Level 5 could still get stored.

This is the player driven part. Players, when using the forge will essentially be feeding the system, additional item properties that can be used in the generation of items and properties to go onto those items.

When a Player Logs in, the login Script will loop through all Items, and memorize the properties on all items, and store in the database, this will help the Dynamic Loot Systems pool of properties to grow.

Have already wrote the functions that will determine the 'type' of item to be spawned. I just need to finish it of a little bit.

  • Need To Do: Write a function that will create an object, based on the resref stored alongside that item type being selected for spawning. Must make sure we do not select Scrolls, Potions, Misc Items.
  • Acceptable items to be selected for generation should be Armor, Weapons, Rings, Amulets, Arrows, Bolts.


The Query function Rand() allows for a where clause. Allowing us to use the where itemtype = "+ITEMTYPE+" and itempropertyname like %Damage Bonus:% order by Rand() limit = 1; This will return one random Damage Bonus, for the itemtype wanted.

Eg - If we put in a Ring Item, the system will return failure, because a ring will never have a Damage Bonus property. - This is intended. Makes our life easier, we dont need to do different queries for Armor and Weapons, and Misc.


3 Queries should be ok.

  1. Add Damage Bonus if Available for item type. // Returns no Damage Property if item is incapable of having a Damage Property, or if there is no damage property stored alongside that item type. No need to do a if statement to determine if its a weapon or not, just make a function that will try to apply damage bonus, and if it doesnt go on, then it doesnt go on - will not cause any harm.
  2. Add Misc Bonus if Available for item type. Must NOT be unique Power Self Items - else it will be wasted. // This wont apply if the item property is incompatible with the item type, but since we are choosing only from a list of compatible properties, we wont have that problem.
  3. Add Random Only Useable property. 30% of time. // The system is generally meant to make players happy, so we dont wana over burden them with restrictions. Only 3/10 of the items spawned should have a Only Useable Property. Maybe have a diceroll for determining how many Only Useable properties to go on. Eg - 6d(1) properties. (between 1 and 6 Classes/Races the Item will be Useable to)

for number 2, we can do the query like this

"Select numericproperty from item_property_repos where name not like %Use: Unique Power% and name not like %Damage Bonus% and name not like %Activate Item% order by Rand() limit = 1";

It will avoid Item Properties of the Unique Power subtype, and the Activate Item subtype (Noticed that Simtools Targetter has this property), and of the Damage Bonus type, will randomly choose one, and then limit the returned values to just 1.

2nd Half

If a successful Roll happens, on creature spawn/death, a call to the DLG (Dynamic Loot Generator) system is made. This will perform additional Rolls to determine the Strength of the Loot being generated.

  • 40% - Low - 1 Damage Property - 2 Misc
  • 30% - Medium - 1 Damage Property - 4 Misc
  • 20% - High - 2 Damage Property - 5 Misc
  • 10% - Super - 2 Damage Property - 6 Misc
  • Subject to change.

The system, after determining the Tier of the item, will then decide on what item properties to add to the item, from the pool of available properties.

Damage Properties will be applied separate, and will be indexed via a query of the sorts like this

select number from YOUR_TABLE where name like '%damage bonus%'order by rand() limit 1; // Basically, Select the int value of property from the table, where the name has damage bonus in it, order it randomly to get a random one, and then make sure we are getting 1 of them returned. Alternativly, we can set the limit to a different number, and use a while loop, to apply the damage bonuses all at once.

Once damage bonuses are applied, the Misc Properties would be done via a similar query.

select number from YOUR_TABLE where name NOT like '%damage bonus%'order by rand() limit 1; // returns all properties NOT damage bonus related.

  • Added the item_type field to the database - This will let the system know, what item type that property came from (from the forge) and then we can index via this. This will make sure that we dont get items being attempted to be generated with wrong item properties. Eg - Armor with Damage Bonuses.
  1. The system will need to determine what Base Item type we are creating first. - Sword, Bow, Boots, Armor, Cloak, jewelry etc.
  2. Then Query will ask for damage bonus - if it is a weapon type item.
  3. Then request Misc Properties which are known to be compatible. eg - Select property from table, where item_type = this item, order random limit 1.
  4. Apply Properties via loop or individually.
  5. Name Generation.

Name Generation

The fun bit.

It has been suggested that the system use the terms of Tiers, similar to World of Warcraft. Eg - Tier 1, 2, 3, 4 etc. I am not going to name these, but I am going to impliment the Tier Color System. Colors in Use: Red, Purple, Orange.

Suggested Colors:

  • Low: Blue
  • Medium: Green
  • High: Magenta
  • Super: Bright Yellow (brigher shade than the artifact color)

Colors are the easy part, however, naming the items may be difficult.

Int values for the item types will need to be compiled. Then we need to use this list to determine what type of item we are dealing with.

Eg - If Ring or not.

If Ring - Name = % Ring %

(% = Prefix and Suffix)

Prefix and Suffix

Based on yet another roll, we will make a Prefix appear in the name only 30% of the time.

Example of Prefix Named Ring.

  • Fred's Ring of %

Example of Non-Prefix Named Ring.

  • Ring of %

Where do we get the names?

Bioware was nice enough to give a Name Generator function with the toolset, this allows for the creation of Human, Elf, Dwarf, etc firstnames and last names. However, these are only going to be used 30% of the time, when a prefix is used.

  • If prefix used
    • If 30% = true
      • Roll for a Bioware Name - Randomly Choose between Human/Elvish/Dwarven Name (first name)
      if Not 30%
      • Choose a Name from a pool of Prefix's from database eg - Dark Ring of% or Obsidian Ring of

Prefix Repository - Words such as

  1. Obsidian
  2. Evil
  3. Light
  4. Flame
  5. Glowing
  6. Poisoned
  7. Venomous
  8. Draining
  9. Stone
  10. Whispering
  11. Ghostly
  12. Heavenly
  13. Divine
  14. Radiant

will be used.

Eg - Radiant Ring of %

Note - We can actually generate the Name Entirely based on Script, and it can actually automatically detect the type of item being used too.

Baseitems.2da - The 'label' field although not capitalized, can be used for the base item type part of the name. We already have the item types stored alongside the properties, so a quick query using Get2DAString() can get the descriptive name of the item, and then use it in the naming convention.

Prefix + BaseItem + Suffix;

Giving something like Snakes ring of the Void.


Jarwen's ring of Haste.

Creature Effect

To Mark creatures who have Dynamic Loot on their person, a special Glowing Effect can be added to the Said Creature, to indicate the Tier of the Item that they have.

  • Low: Blue
  • Medium: Green
  • High: Magenta
  • Super: Bright Yellow (brigher shade than the artifact color)

A special Buff can be applied to the Creature too, to make them harder to kill. The equivelant of making them a Unique Creature from Diablo.

May also be able to give them a Unique Name too Via SetName();