// Detectable Spells v3
//
// Assembled by Ardanis/GeN1e, using DavidW's version (SCS) as a base
//
// Changes from previous version (SCS):
// - if Khelben's Warding Whip is broken, we first will attempt to repair it
// - removing older Ascension version of DS is less destructive
// - patching STATS.IDS is compatible with ToBEx
// - scripts from Kiara-Zaiya mod are also being updated to use new DS
// - core code is more compatibility-friendly with spell-altering mods
// - removed EFF-patching, it is not being used anywhere anyway
// - removed ~134 LEVELDRAIN~ stat, until somebody shows me a live example of the 200th stat NOT working
// - new ToBEx stats may be added on the fly, similar to how ADD_SPELL WeiDU command works (suggested by i30817 and aigleborgne)
//
// Contents (don't change any, unless you're the next update maintainer!!!):
// ds.tph
// spwi705.spl
// stats.2da
// fix_old_ds.2da
// old_ds_swap.2da
//
// Usage (basic):
// copypaste code below into your TP2, and set the path to match the directory
/*
OUTER_SPRINT path ~mymod/ds_folder~ // change it to your mod folder
INCLUDE ~%path%/ds.tph~
LAF detectable_spells_setup STR_VAR path END
LAF detectable_spells STR_VAR table=~%path%/cddetect.2da~ END
*/
//
// Advanced options:
// 1) table's format is:
// FILE - which file (SPL or ITM) you want patched
// OPCODE - which opcode will be added to the FILE (233 is proficiency, 282 is scripting state)
// PAR_1 - the first parameter of OPCODE (stat value for 233/282 opcodes)
// PAR_2 - the second paramater of OPCODE (stat's index in STATS.IDS, substract 156 for scripting states);
// if set to a string, it will be looked up in STATS.IDS and the corresponding index will be used instead
// CLONE - the opcode used as a marker (duration, etc.) for generating OPCODE; if CLONE is not found, OPCODE will not be added
// TICK - see the 4th option (below) for detailed explanation
// PATCH_WHAT - the location within FILE where OPCODE should be added to (and where CLONE is looked up):
// "g" - global (equipped) effects
// "a" - all ability headers
// if you want only specific header patched, set PATCH_WHAT to that header's index (starting from 0)
//
// 2) you can launch the second macro multiple times with different tables (change path, if required)
//
// 3) you can use stats' ID names in your table instead of fixed values; to avoid compatibility issues with other ToBEx-using mods,
// consider using only strings (with your personal modder's prefix) for ToBEx stats, rather than values - DS then will find the
// lowerest unclaimed 400+ slot in STATS.IDS and use it for further patching
//
// 4) you can update painlessly spells with ticking effects (Khelben's Whip, clouds) - change the letter in "tick" column to a value;
// DS will find the effect with the longest delay and use it for the cloning purpose, your value will be added to the total duration;
// non-zero values may be required in cases when the spell only has one effect in header and relies on the projectile to apply it
// multiple times (clouds)
//
// 5) if you have altered some spells, so that their duration can no longer be correctly detected by the opcode in "clone" column, you
// must update the "ag#dsalt.2da" table in the "override" folder, to let other mods know of your changes; if you don't, those mods will
// erroneously assume that the spell's detection is invalid and delete it; this is how we'd proceed with the Spell Shield fix (SCS):
/*
LAF ds_altered_spell INT_VAR old_clone=226 new_clone=142 STR_VAR file=~spwi519.spl~ END
*/
// 6) you can install detectable weapon enchantment, as per SCS:
/*
LAF detectable_weapon_enchantment END
*/
//
Attached Files
Edited by GeN1e, 12 January 2012 - 11:11 AM.