Multiple caster levels for Brew Potion, Craft Wand, and Scribe Scroll are possible with this script. As with a better Scribe Scroll (which is the basis for this), caster levels adjust as far as possible (I think) with neither a client-side hak/override nor a lot of scripting. Furthermore, this script is ready to implement true-level scribing, once someone makes the needed item properties available (or modifies every spell script).
So what does this package do? BioWare's script ignored a PC's caster level. This script does not. It makes the resulting potion, scroll, or wand as powerful as possible, without going over the PC's level (unless the weakest possible item is already over the PC's level, in which case the weakest possible is used).
There are limits, though. The caster levels available are limited to those found in iprp_spells.2da, so not every caster level is possible. To see what levels are available in BioWare's version of that file, download and read Item_levels.txt. Every spell & level combo listed in that file is a possibility with this script.
If you want to extend iprp_spells.2da to allow all (or more) possible caster levels, download and read Extended_levels.txt to see how to change the included .2da so that this scroll scribing system accesses your new item properties. There is still a bit of work involved, but this will save you from having to write a script.
Yes, this package contains a .2da, even though I said there would be no haks and no client-side overrides. This .2da only needs to go into the server's override directory; your players do not need it. Hak-free PW's can use this system.
New! There is now an item that will allow you to select the level at which a spell is brewed, scribed, or crafted. Use this item and target a potion, scroll, or wand before casting a spell. A dialog will appear in which you select the level at which you want the item to cast. Then, when you cast the spell, the item's caster level will be based on the lower of your caster level and the level selected via dialog.
This item requires tag-based scripting.
Players: If you want to use this better Craft Magic in your single-player modules, download the "PlayerOverride" zip file and unzip its contents into your override directory.
New! Inside the .zip is another .zip called BCM_Leveler.zip. If you want to use the new level-selection item, unzip this file into your override directory. If you know how, you can now spawn the item using its blueprint: tk_cm_leveler. Otherwise, you can get the item through the mini-module I created called "ITEM -- Level Setter". To get this module, download BCM Level Module.zip and unzip that into your modules directory.
Builders: If you want to use this better Craft Magic in the module you're building, download and unzip the "BuilderVersion" zip file. Inside, there are two .erf files that get imported into your module, overwriting the standard BioWare resources x2_inc_craft and x2_pc_craft, and there's a .2da file that can either be packaged into a .hak or used as a server-side override (place it in the override directory the server will use). There is also a merge document that can be helpful if you have already customized the standard BioWare script x2_inc_craft.
New! There are now two .erf's in the builder's version. The first, CraftMagic_TK.erf, contains the new crafting scripts. (You need the new scripts if you want to use the level-selecting item.) The second, CM_Leveler_TK.erf, is optional, and contains what is needed for the level-selecting item. I'm keeping this separate so that there is less clutter if you don't want it. If you import it, you'll find the item, Level Setter, under the custom "Crafting/Tradeskill Material" items.
Both .erf's contain a copy of x2_inc_craft.nss for self-containedness. There is no difference between these versions.
Server hosts: If you're hosting a module that you don't want to modify, the "PlayerOverride" version should work if it's unzipped into your server's override directory.
Enjoy!
Notes:
* With this system, crafted wands and scribed scrolls can only be used by the class that created them. Module builders can change this slightly to allow wizards and sorcerers to use each other's items by setting TK_WIZARD_SORCERER_SHARE to TRUE in x2_inc_craft then recompiling x2_pc_craft.
* Whenever possible, items become their standard counterparts instead of generic versions (e.g. a "Potion of Speed (5)" instead of a "Magic Potion: Haste (5)"). If you have additional custom items available, you can cause them to be created by filling in the ResRef's in the appropriate columns in the .2da. (See the accompanying text file.)
* On the flip side, replacing a ResRef in the .2da with "****" will not prevent the crafting of that item; a generic item will be produced in that case. If you need to change which spells can be brewed, scribed, or wandified, either asterisk-out the item property columns in the included .2da or change the associated entry in BioWare's des_crft_spells.2da.
* Creating the .2da required significant data entry. I've verified a good chunk of it in-game, but the possibility of a typo still exists. If you find an error, please let me know.
* One other thing I thought of... If you use this with a module that has custom spells, you can get weird results if you try to brew/scribe/craft the custom spells. Adding enough rows to the included .2da would fix this. ("Enough rows" = "rows in your custom spells.2da")
Update 5/5: I was a little overzealous and commented out too many functions in x2_inc_craft. The updated builder version leaves CIGetIsCraftFeatBaseItem() alone. Mea culpa.
Update 6/29: I added Level Setter, an item that lets you intentionally create items with a lower caster level.
Update 9/20: Fixed a bug that appeared when players targeted a specific weapon with a scroll or wand casting a weapon-enhancing spell (e.g. Magic Weapon). The changed function is CIGetSpellWasUsedForItemCreation().
Override warning: It is unlikely that this override will cause problems, but it's always possible. For reference the contents of the override are:
x2_pc_craft.ncs -- replaces a standard BioWare script.
x2_it_pcscroll.uti -- an item blueprint BioWare named, but never created.
tk_craft_magic.2da -- a custom file that should not be in conflict with anything.
tk_craft_magic.txt -- some documentation for the .2da. NWN will ignore this file.
Level-selecting item:
tk_cm_level_at00.ncs through tk_cm_level_at20.ncs -- scripts for the dialog.
tk_cm_level_end.ncs -- another script for the dialog.
Do you mean you want to use a player tool as the level setter? (I don't see how the actual crafting could be used with player tools.) That should be doable, with a small change to the script tk_cm_leveler. You'd just have to fill in the name of the changed script in the appropriate spot in tk_playertools.2da.
The changes to the script (for use with a player tool) are all towards the beginning. Delete the lines within the main function that appear before oPC is initialized, then change what oPC and oTarget are set to. This web page is going to mess up the indentations, but the end result should have the main function beginning with:
The_Krit,
I am going to use your Player tools, But I want to combine this so that it used off of those tools. Being that both systems are overrides, can I combine them? Remember I am very limited in my knowledge and really want to put both of your systems into my PW.
I know of no incompatibilities with 1.69, so it's likely fully compatible.
(I haven't put this through the tester under 1.69 yet, but I know it is used on at least one PW under 1.69 with no bug reports.)
Is this compatible with Patch 1.69? _________________________ (\__/)
(='.'=) This is Bunny. Copy and paste bunny into
(")_(") your signature to help him gain world domination.
Posted by Shia luck at 2009-02-28 02:26:41 Voted 10.00 on 02/28/09
Simply wonderful, The Krit! Thank you :) It's taken me a while to get here and vote but craft wand became my new must have feat because of this! Thanks! :) _________________________ Check out the latest reviews of new modules: The NWVault Reviewers Guild
Posted by The Thayan at 2008-10-14 11:52:39 Voted 10.00 on 10/14/08
Very, very useful and pretty much essential for non-hak PWs wanting to use the default crafting system. Nice idea on the Level Setter allowing PCs to create lower-level items, as well.
It looks like lots of time was poured in to this (especially in creating the 2da file) and it is quality work. Well done, and thank you! _________________________ Thay - Realm of the Red Wizards A NWN persistent world found under the Roleplay section of Gamespy.
Posted by boiled bones at 2007-12-13 00:28:42 Voted 10.00 on 12/13/07
This is probably the easiest ten I've ever offered. Does what it says it does, every time. Be nice if someone wanted to go through and add a bunch more options, but this is a vast improvement over the stock choices. Thank you, thank you, thank you. Seriously, thank you.
OK, new info. I overlooked the fact that there is a "brewed potion" base item, distinct from the "potion" base item.
With this system, if you brew a potion for which there is a standard potion, the result will be of the "potion" base item, so it will be usable while shifted. The other spells will produce something of the "brewed potion" base item, so these will not be usable while shifted.
I hope BioWare fixes this in the upcoming patch. If not, I'll find a way to make this more consistent.