This treasure system was used back in the day on at least 2 different PW's around 2007-08. It's been tested thoroughly, and originally ran on a NWN2 server, but I ported it back to NWN1. Should work fine even though I have not used it in a wihle.
Functionality
- Customizeable spawning tables stored as string variables, with excel file included to help generate the data, while tables are able to be modified in real-time, this is usually unneccessary, but scripting some kind of additional scripted modification is possible... for example allowing DM's to generate their very own tables could be done easily. Tables, allow for assigning slot numbers to equip for creatures, to assign a randomized min/max stack, as well as a percent drop rate.
- Command System which operates on the fly using calls within the local variables stored on creatures and other objects. There are 13 different primary functions, which modify how the tables work.
- Full Documentation explaining how to install into a module and how it works.
Function Calls (Requires no scripting knowledge)
Percent Modifier, Percent Use/Ignore, Total Item Max, Total Value Max, Item Max, Value Max, Slots Use/Ignore, Broken Item Toggle, Random Draw, Identify Options, Pickpocket Options, Dropppable Options, Clear to Default Setting
------------------------------------------------------
Object variable Example: $P755,table_a,table_b,$PX,$K,$KOF,table_c
This string variable will call table_a, table_b, and table_c. table_a and table_b will each have a 75.5% chance to be called specified by $P755. When a table is called, each item in it has randomized properties, so it might be some items in the table only drop at a 1% rate. (In this way, if someone specified "$P001,table_a" the table has a 0.1% chance of executing, and once it does, the various items in the table have their own randomized parameters.)
At $PX, this cancels the randomness of a given table executing, so all tables that follow by default will have 100% chance of executing. $K and $KOF specifies that when table_c executes, none of the items will be able to be pick-pocketed. By default, normal item properties are used, but this system allows for overides to original item settings.
--------------------------------------------------------
Attachment | Size |
---|---|
![]() | 56.85 KB |
If you find any bugs, let me know. Also, it probably works on plain jane NWN without expansions, but I never tested that.
In x2_mod_def_load you must add #include "x2_inc_globals"
These are nice scripts; it's a comprehensive system with tons of customizability and it's very well documented. It won't, however, work 'out of the box' on NWN1 (the manual was adapted from the NWN2 version). The instructions ask you to set a variable in x2_mod_def_load if you want global execution (SetGlobalString("N2_SCRIPT_SPAWN_CREATURE", "st_cr_onspawn");) but this variable isn't recognized by NWN1 (nor will SetGlobalString work without including x2_inc_globals, as previous commenter mentioned). To globally execute it on creatures, you can instead add:
to the default OnSpawn script, nw_c2_default9, and comment out any part of that script that generates treasure.
It's also fairly easy to change so that it doesn't require the XLS sheet; you can instead make this a fully scripted system that doesn't require either a spreadsheet or the waypoint object (I personally hate having to update variables on objects and would much rather just make changes to a script).
Also, note that GetCommandID() in st_inc_spawn is missing the $PX command mentioned in the documentation. You'll need to add it to the constants and check for it in the function (above the first check for $P). Further, a few of the commands have lengths that don't match what's being searched for, so review these carefully.