The MetaRod of Preparations allows PC and Companions to quickly and consistently recast spell buffs as well as refresh Bardic Inspirations.
@brief MetaPrepa is a set of scripts and blueprints that provide for automatic buffing in Neverwinter Nights 2. It is based on Lost Creation's Rod of Preparation, which is based on Loudent's Rod of Full Party Buffing, with the major difference being that MetaPrepa is able to prepare metamagic spells. By placing the Rod into Learn mode, buffs that are cast are immediately written as Pages into a spellcaster's Book of Preparation, so that when the Rod is in Play mode the preparations get recast as they originally were.
The spells that can be prepared are identified from a list of buffs via scripting. The only feats that can be prepared currently are Bardic Inspirations. Animal Companion and Summon Familiar can also be prepared, but they are problematic in that any buffs that were prepared for pets will not recognize the pets as valid targets, unless the pets were summoned prior to the rebuffing sequence. A few other feats such as a few Stormlord feats are also accepted as valid buffs. See the included ReadMe - or the source code - for more detailed information.
Some buffs, notably those cast from subradials (eg, Protection from Evil) will be set to CasterLevel 10 to get around the fact that the caster doesn't technically have such subradial spells memorized, but only its Master entry in Spells.2da (eg, Protection from Alignment). Clerical Domain buffs will be set similarly, again because a Cleric does not technically know the spells. If you wish to get around this you should cast these buffs normally.
MetaPrepa has advanced handling for buffs that are cast on items, so that after the spell is applied initially the Rod will seek out the same item among party members and attempt to re-apply its buff automagically. Also, informational as well as error messages are shown to the player.
I consider this a beta release mostly because ... well, somethings are hardcoded and just can't be worked around
--------
IMPORTANT: note about Upgrading to beta.96:
Installation: remove or delete your old MetaPrepa folder. Unzip beta.96 to MyDocs->Override. IF YOUR PC ALREADY HAS A ROD THIS WILL DESTROY IT ALONG WITH ALL BOOKS AND PAGES. A message should appear telling you to rerun the 'mrop' setup from the game console. Probability of this causing insurmountable problems in the module you are currently playing: < 1%
- beta.96 has a workaround for the "Persistent Haste" bug. If Persistent Haste (or perhaps other metamagic buffs) was prepared in Instant-cast mode, and another preparation followed it instantly, the NwN2 executable drops its metamagic-variable and so the buff was cast without being Persistent. The workaround is to add a half-second delay between casts; note that the mode "Instantly" has been changed to "Fast" to reflect that ( the mode "As Actions" has not been changed ).
technotes: A new variable, "MROP_FAST_DELAY", has been added to the rod-object. It is set by default to 0.5f seconds. A new script has been added to the package, 'mrop_setdelay', and can be used at the console to change the delay (or just check what it is currently set to). Details can be found in the header of that script-file.
Since the bug is a timing-related issue it could manifest differently on different computers. If you find that your computer can handle a shorter delay, or needs a longer delay, the float-variable on the rod-object can be changed either with the 'mrop_setdelay' script or by editing the rod-object with the toolset (or a GFF editor). The latter method would assign a new default value that automatically takes effect if and whenever a new Rod is created IG, while the former method needs to be redone every time a new Rod is created. Personally I think the 0.5 sec delay adds a nice spice to Fast buffing and isn't quite the "slap in the face" that Instant-mode used to be; however, the delay can still be set to 0.0 sec if desired.
- other changes: refactored/ optimized many functions. A new bug(s) could have crept in during this process ...
All of Kaedrin's PrC Pack (v.1.41.4) functions that are relevant have been broken out and added to #includes that are now integral to the MetaPrepa pack, meaning that all scripts contained herein may be re-compiled without recourse to the kPrC Pack itself. Note that these functions have been altered and are not Kaedrin's responsibility here, but yours and mine ( kevL's ). Credit and thanks to Kaedrin and I hope he sees fit to release the source-code to any future versions of the kPrC.
ReadMe follows
===============================================================================
MetaPrepa
MetaRod of Preparations ( MRoP )
v.beta.97a
2020 mar 14
-------------------------------------------------------------------------------
Editor:
kevL's, a variant of Lost Creation's Rod of Preparation
Contact:
https://neverwintervault.org/
Webpages:
https://neverwintervault.org/project/nwn2/script/metaprepa
The MetaRod of Preparations, or MetaPrepa, allows PC and Companions to quickly
and consistently recast spell buffs as well as refresh Bardic Inspirations.
-------------------------------------------------------------------------------
Credits:
MetaPrepa is a variant of the Rod of Preparation by Matt McMahon (aka "Lost
Creation") which can be found on the Vault:
https://neverwintervault.org/project/nwn2/other/gui/rod-preparation
The RoP is a complete rewrite of Loudent's Rod of Full Party Buffing which can
be found here on the Vault:
https://neverwintervault.org/project/nwn2/prefab/item/rod-full-party-buf...
Arkalezth of the BSN boards, the Don Quixote who offered insightful feedback
that broadened the scope and generally urged the tone of this project.
Sky FM radio - Mostly Classical
http://www.sky.fm/classical ( before it went pseudo-commercial )
-------------------------------------------------------------------------------
How it works:
If you're familiar with LC's Rod of Preparation, there are three major
differences.
1. The primary purpose of this Rod, the MetaPrepa rod, is to implement
metamagics on buffing spells. It does this by using a spellhook, while
attempting to respect modules that are designed with a spellhook already in
place. ( See the hook script for further information. )
2. To do that, the MetaRod has two modes of operation - Learn and Play modes.
Both are activated by double-clicking the Rod and activating it on itself. First
up is Learn mode; this searches through a list of spells when a party member
casts a spell, and if the buff is found ( or if it's one of the 7 Bardic
Inspirations ) a Page of Preparation is added to a Book of Preparations on the
caster of that buff. This lets the spellhook capture the metamagic type, as well
as other things, and write it as a variable on the preparation. Play mode then
needs to be activated for regular play and re-buffing after resting. If you
forget to switch from Learn to Play modes it should not break anything, but
there might be a few more preparations in your Books than you want. Watch for
messages that are intended as reminders of which mode your Rod is in ...
3. Feats work differently because technically they do not use a spellhook. They
also are not always 'spells' at all. Feats have ... issues. So far the only
feats that are allowed to be prepared are the 7 Bardic Inspirations. This
required adding the spellhooking code to those 7 scripts ( included ). The
Stormlord weapon feats, as well as Summon Companion and Summon Familiar, have
been additionally added since. The latter two scripts are also included.
Further, spellscripts are included to cover buffs that are cast on items in
characters' inventories - armor, shields, and weapons basically. I did this so
that items which have received buffs do not need to be passed back to a caster
when re-buffing with the Rod.
Kaedrin's 1.41.4 PrC Pack functions were used where applicable. All spellscripts
included have been tidied and recompiled, so if you have issues with any of them
talk to me, or fix them yourself. Since I find Kaedrin's material slightly
overpowered I backed off a couple of Massive Critical properties etc by a notch.
no, I don't want to keep two versions of spells. nyah!
-------------------------------------------------------------------------------
Installation:
Unzip the MetaPrepa to your MyDocs->NwN2->override folder. MAKE SURE THAT FILES
ARE NOT DUPLICATED IN THE OVERRIDE FOLDER! This means searching for duplicate
spellscripts + Inspirations, then rename, back up, or remove them. If you have
Kaedrin's PrC Pack or any other spell fixes pack, you will very likely have
duplicates kicking around.
The core MRoP files do not conflict with previous Rod of Preparation files.
Uninstallation:
Remove the MetaPrepa folder from MyDocs->NwN2->override. Revert all spellscripts
and Inspiration scripts that you had backed up.
-------------------------------------------------------------------------------
Setup:
In the game, open the console by typing
`
DebugMode 1
then enter,
RunScript mrop
If you are not controlling your PC, control will be switched to your PC. This is
simply a safety measure and should help focus your attention on what comes next.
Then exit the console by typing
DebugMode 0
`
Or you can do it from the chat window.
##DebugMode 1
##RunScript mrop
##DebugMode 0
Your PC should receive a MetaRod. Then activate the Rod on anything ( your PC,
the ground, wherever ) to get things moving along. A GUI will pop up with the
setup screen if everything is progressing nicely. The only setup is chosing
whether you want re-buffing to happen Fast or As Actions. Fast means
all spell buffs are cast quickly, and As Actions means each preparation takes
a normal round to cast. If you want to change your previous setup, repeat the
console commands above.
Congratulationz!!! the MetaPrepaRoP is installed!
-------------------------------------------------------------------------------
Usage:
Activate the Rod on itself
- switches between Learn and Play modes. Learn allows buffs ( and Bardic
Inspirations!! &tc. ) to be turned into preparations, Pages in the Book of
Preparations that get created on each caster that prepares ( casts ) a buff from
the list of ID's in the spellhook script. Pages of Preparation are created
only for buffs cast on PC faction members or their equipment. When done,
re-activate the Rod on itself to switch to Play mode. Adventure as usual ...
and after a rest - or whenever you like really -
Activate the Rod on anything except itself
( but not on a Book of Preparations ) - this causes the buffing sequence to
begin, whether Fast or As Actions. Spells that are not memorized will
merely be skipped, as will buffs that were cast on targets that are no longer
available. If a character still has effects from a previous buffing, the buffs
should refresh ( rather than be skipped ).
Activate the Rod on a Book of Preparations
- this brings up a GUI asking if you wish to destroy the Book and all its Pages
& contents. A confirmation is required if you then want to destroy the Book.
Activate a Page of Preparation on itself:
- brings up a GUI asking if you wish to destroy the Page. A confirmation request
is not given.
note: Anyone in the party can carry and activate the MetaRod.
-------------------------------------------------------------------------------
Tips:
Pages at the top of the Book get cast first .....
Pages can be taken out of the Book and put back in at your discretion. Only
Pages that are in a Book will be cast during the buffing routine.
Pages of Preparation can be added one ( or several ) at a time to a Book by
entering Learn mode, casting the buff(s), then returning to Play mode.
Bardic Inspirations that are prepared have special considerations. A bard can
have only one Inspiration active, but you will find that the Rod allows up to
all 7 to be prepared as Pages. My advice is to prepare two or three Inspirations
that you like to use as your standard Bard defaults, then take them out of your
Book and swap in only the one that you want to go with for a while. If you
change your mind later, just swap in a different one ( without having to enter
Learn mode ).
If a Page of Preparation is examined, you should see a lot of arcana there -
that is for debugging and, well ... arcana lore. It has occult significance ...!
A Book of Preparations is cursed and cannot be gotten rid of except by
activating the Rod on it and chosing to destroy it. Pages however can be passed
around freely, although if you put one into the Book of a caster to which it
does not belong and your cat happens to scratch your eye out as a result, I am
not responsible. Thanks!
The MetaRod is not meant for combat. It cannot be placed into Learn mode when
a member of the party is in combat. You can do the buffing routine while combat
is near, but the Rod will cast spells As Actions even if Fast was chosen
during setup.
Do not store anything in the Books apart from Pages of Preparation. ( I don't
know why, exactly, it just sounds good to get that out of the way. )
Druidic Spontaneous Conversion is not supported. The Bardic Inspirations will
work Fast if you chose Fast during setup. Other feats should not work
at all ( as of v.beta.7 ). As of v.beta.8, the Animal Companion and Summon
Familiar feats have been added - they require the special scripts that are
included, just like the Bardic Inspiration scripts ( and buff-on-item scripts ).
As of v.beta.92, fixed a bad bug that kept Animal Companions at low level iff
Kaedrin's PrC Pack wasn't installed correctly. dam animals ...
MetaPrepa ought work with or without the kPrC Pack!!! Note: Cyphre's Companions
are also supported.
Spells that are cast from subradial menus need to use 'cheat casting' by the
Rod, as such they will be cast at CL 10 and will have "(10)" on their Pages'
descriptions.
Spells that were granted to a character by Cleric Domain powers are also
problematic. Since, like subradial spells mentioned above, they are not fully
registered as known by the caster these must also be cheat-cast at CL 10. Their
Pages of Preparation will not have "(10)" in the description, because the method
of determining which casts come from Domain granted powers is not absolute. I
believe the underlying issue is hard-coded.
The MetaRop has added code to spellscripts that cast buffs on items. This allows
items such as armor, shields, and weapons to be buffed in the caster's
inventory during Learn mode and then passed to other characters, where they
will be targetted directly for rebuffing during regular Play mode. Again, the
method used is not foolproof: it depends on (a) the caster, (b) the name of the
item, and (c) the spell. When an idea occurs that would make this more solid, it
should be done.
Finally, spells that are cast on the ground will never be prepared. All
preparations need a targetted object to maintain integrity. Usually this means
that if you try to prepare a summons such as Planar Ally or Summon Creature, the
file Spells.2da ( and Feat.2da ) have to be configured to cast the spell or
perform the feat on an object, which ought then allow a Page to be written in a
Book of Preparation. In addition, don't expect to prepare a summons and then
buff it during the buffing routine: the target will be invalid since it hasn't
been summoned yet. If you want to buff your summons you need to have it out
already, or call it before engaging the buffing routine ....
nb. There is a maximum number of spells that can be lined up on the Action
Queue. It's about 20.
-------------------------------------------------------------------------------
Bug Reports requested:
If you notice any spell buffs that MetaPrepa does not prepare, feel free to tell
me about them.
If you notice any spell buffs that were cast on items ( armor, shields,
weapons ) that do not get correctly re-applied, please let me know about these.
If you have a favorite Feat that you would like to see implemented, I'll
look into it - no guarantee though.
And anything else that goes the wrong direction, after you've ruled out as many
possibilities as you can on your end. Tks!
Players will and have noticed that numerous spell descriptions do not match
their actual use in NwN2; this is because descriptions are in a file called
Dialog.Tlk while spell usage is handled by Spells.2da and the spellscripts. It
is far beyond the purview of the MetaPrepa to address those inconsistencies, but
there it is.
-------------------------------------------------------------------------------
A Note About 2DAs:
The .2da files that come with Lost Creation's Rod of Preparation are not used
by the MetaRod. Instead, Spells.2da is used and Feats are handled partly as
spells.
Of particular interest in Spells.2da are the columns: MetaMagic, TargetType,
ImpactScript, and FeatID; also Name and SpellDesc.
-------------------------------------------------------------------------------
File Manifest:
blueprints:
mrop_rod.uti
mrop_book.uti
mrop_page.uti
scripts:
mrop.nss/ncs ( setup )
mrop_inc.nss ( #include )
mrop_inc_preps.nss ( #include )
mrop_inc_gui.nss ( #include )
mrop_spellhook.nss/ncs ( spellhook )
i_mrop_rod_ac.nss/ncs ( activate rod )
i_mrop_page_ac.nss/ncs ( activate page )
gui_mrop_ok.nss/ncs ( gui accept )
gui_mrop_cancel.nss/ncs ( gui cancel )
mrop_debug.nss/ncs ( debug vars )
spellscripts ( nss/ncs )
7 inspirations ( nss/ncs )
nw_s2_animalcom.nss/ncs ( Animal Companion )
nw_s2_familiar.nss/ncs ( Familiar )
mrop_cmi_animcom ( #include for Animal Companions )
+ a few ReadMe's scattered about ... and as of ver.beta.96 ->
mrop_bardic_inc.nss ( #include for Bardic Inspirations )
mrop_items_inc.nss ( #include for Item buffs )
mrop_setdelay.nss/ncs ( console-script for changing the fast-cast delay )
-------------------------------------------------------------------------------
Spellhooking:
If a module author has already implemented a spellhook script, the MetaRod will
do its best to switch back and forth between that script and the MRoP spellhook.
Messages ought appear in the chat window to the effect that spellhooking is
already enabled and that the module's author should be contacted, or at least
that the two scripts should be merged ( see the MRoP spellhook script
'mrop_spellhook' for detailed info ).
Wild Magic works in conjunction with the spellhook and will switch back and
forth as appropriate. The spellhook and Wild Magic need to be enabled during
Learn mode only. Play mode operates with neither.
Finally, NwN2-style tag-based scripting has to be enabled by the module author
for the MetaPrepa to work in that module.
Attachment | Size |
---|---|
![]() | 65.79 KB |
![]() | 65.63 KB |
![]() | 1.57 KB |
![]() | 14.06 KB |
Nihil Trilogy: Awakening |
92.5% |
Planescape: The Shaper of Dreams |
94.3% |
A Fairy Tale |
80% |
From This Comes Strength |
98.9% |
Dark Avenger Chapter 1 |
92.5% |
The Cursed Land |
82% |
Night Howls in Nestlehaven V1.17 |
92% |
Trial and Terror |
83.3% |
The Darkening Sky - Prologue |
87.1% |
SoZ Overland Map Demo and Documentation |
95% |
I added compatibility scripts for 2 campaigns, The Maimed God's Saga and Moonshadows.
They are needed for the Rod of Metapreparation to work in those modules/campaigns. Instructions are included within a textfile for each; compatibility for TMGS updates/replaces its onModuleLoad script, for Moonshadows it updates/replaces its onItemActivate script.
update:
2017 feb 19, ver.beta.96.1
nw_s2_familiar - don't apply SR if == 0. Also prevents a misleading Spell Resistance icon from appearing on a familiar's character sheet.
Yay for ridding myself of real-life tedium! Thanks for this. I'll spruik it on my blog.
Thank you for this god-send of a mod. Would it be possible to support something like vigor or persistent vigor?
thanks.
I'm curious about two things
1. why would someone "buff" their character with a short-term spell like Vigor?
2. i don't get to play much high level stuff. Is spell persistence a thing in Nwn2?
Yeah, extended spell leads into persistent spell. The spell lasts until you rest or it's dispelled. A little bit of healing all the time, even if it's weak, might be kind of nice. I recently bought the game and really appreciate your mod.
ok :)
I'll look more closely at Spells.2da and see what buffs have a "persistent" flag.
might take me a while to get into though, some other stuff i want to clean up first ...
Cool. Thanks for looking at it.
( faster than i thought )
Please give it a try I haven't tested it. was really straightforward.
- added LesserVigor, Vigor, and MassLesserVigor to the valid buffs
- recompiled all scripts (against Nwn2Fixes if applicable)
Yup, totally works. Thanks!
+1
/enjoy
Uh oh, I have another one for you. The druid spell "Storm Avatar" isn't recongized.
np, looking ...
( also, i think there's a way to get around bCheating subradial spells like Prot.Alignment ...) (which would be totally bonus if it works)
keep em coming if you notice anymore
Will do!
What about Nature's Avatar ( Druid L9 ) -- animal companion buffI left these out before, because they're short-term ... i never saw the point of including short-term buffs (my opinion). But okay if you want them in, there's probably more,aha! we found a bug! I had the id for Rejuvenation Cocoon instead of Storm Avatar.
so ... should Rejuvenation Cocoon go in ? Druid L5
edit: nah that'd be pretty silly ... the Cocoon is more like a heal spell on steroids that lasts 2 rounds.
am going to look into bypassing those subradial bCheats ...
Yeah It'd have to be persist-able to make sense. I'm just finding them as I play but maybe I'll make some characters later and test a bunch of them.
And I don't know what subradial bCheats are but good luck!
if you load up a wizard and prepare Protection from Alignment ... you don't actually cast Protection from Alignment but your choice of either Protection from Evil or Protection from Good <- those can be called "subradial spells" (or submenu spells, the term radial refers back to Nwn1's circular, or radial submenu)
presently such subspells need to be cast at casterlevel 10 instead of the caster's true casting level -- "(10)" appears in the name of the preparation page. This is the result of the bCheat parameter in the spell-casting function. Am going to take a closer look at things to see if such spells can instead be cast w/out bCheat ...
but it's been a long time since i thought about this stuff :)p
> maybe I'll make some characters later and test a bunch of them.
I don't think that's necessary -- having looked through isBuff() several times now it looks okay (incl/ short-term buffs).
edit: )*%@ snarling and gnashing of teeth )(*#%&
@Theodulus -- StormAvatar should be fixed in beta.97a
( i found a way to bypass the bCheat thing but ... it's pretty nasty [not included] It'd require writing ~50 modified spellscripts for subradial buffs ...) ah well, perhaps someday
update 2020 march 14
beta.97 - add LesserVigor, Vigor, MassLesserVigor as valid buffs
beta.97a - fix StormAvatar's id