Closed AgonyAunt closed 10 years ago
Note: Granting level 1 spellcasting at level 1 means some spells have zero duration. Would require editing of spell scripts. Problem with this relates to fixing caster level anyway, as you need to check for caster level and boost it. Also need to get last caster class, to check it is being cast by Paladin or Ranger in order to only apply caster level changes if necessary.
Involved editing roughly 70 spells.
Also worth noting and checking, if you grant level 2 or greater spells at level 1 you can't actually select. Presume there is something stopping learning of spells until appropriate level beyond the spells gained 2da. Presume this applies to wizards and other caster classes as well. Would guess the limit is set at levels 1, 3, 5, 7, 9, etc but need to check its not something hardcoded that means we can't shift all spellcasting down levels.
Solution would be a function in something like ps_inc_functions that is included that performs all checks. Then its a case of simply replacing GetCasterLevel in all relevant spells with the new function that does additional testing.
Ah ha! You can only ever get level 2 spells at character level 2, level 3 at 3, etc... interesting to know.
Function to be called from all relevant spells wherever GetCasterLevel is currently used.
// Used in any spell scripts for Ranger/Paladin spells instead of GetCasterLevel in order that those spells get full caster level for Ranger/Paladin.
int PS_GetCasterLevel(object oPC)
{
int iClass = GetLastSpellCastClass();
int iLevel;
// mystic theurge, sacred fist, stormlord, doomguide, warpriest and Harper agent can increase caster level if they have appropriate feats
// practiced caster can also increase by +4.
if (iClass == CLASS_TYPE_RANGER)
{
iLevel = GetLevelByClass(CLASS_TYPE_RANGER, oPC);
if (GetHasFeat(FEAT_PRACTICED_SPELLCASTER_RANGER, oPC, TRUE)) iLevel += 4;
if (GetHasFeat(1548, oPC, TRUE)) iLevel += GetLevelByClass(44, oPC); // Mystic Theurge
if (GetHasFeat(1552, oPC, TRUE)) iLevel += GetLevelByClass(45, oPC); // Sacred Fist
if (GetHasFeat(1583, oPC, TRUE)) iLevel += GetLevelByClass(28, oPC); // Harper Agent
if (GetHasFeat(1811, oPC, TRUE)) iLevel += GetLevelByClass(51, oPC); // Warpriest
if (GetHasFeat(2036, oPC, TRUE)) iLevel += GetLevelByClass(56, oPC); // Stormlord
if (GetHasFeat(2254, oPC, TRUE)) iLevel += GetLevelByClass(60, oPC); // Doomguide
}
if (iClass == CLASS_TYPE_PALADIN)
{
iLevel = GetLevelByClass(CLASS_TYPE_PALADIN, oPC);
if (GetHasFeat(FEAT_PRACTICED_SPELLCASTER_PALADIN, oPC, TRUE)) iLevel += 4;
if (GetHasFeat(1547, oPC, TRUE)) iLevel += GetLevelByClass(44, oPC); // Mystic Theurge
if (GetHasFeat(1551, oPC, TRUE)) iLevel += GetLevelByClass(45, oPC); // Sacred Fist
if (GetHasFeat(1582, oPC, TRUE)) iLevel += GetLevelByClass(28, oPC); // Harper Agent
if (GetHasFeat(1810, oPC, TRUE)) iLevel += GetLevelByClass(51, oPC); // Warpriest
if (GetHasFeat(2035, oPC, TRUE)) iLevel += GetLevelByClass(56, oPC); // Stormlord
if (GetHasFeat(2250, oPC, TRUE)) iLevel += GetLevelByClass(60, oPC); // Doomguide
}
else
{
iLevel = GetCasterLevel(oPC);
}
return iLevel;
}
The following scripts need editing:
NW_S0_Aid NW_S0_Barkskin NW_S0_BearEndur NW_S0_Bless NW_S0_BullStr NW_S0_CatGrace NW_S0_CurLgtW NW_S0_CurModW NW_S0_CurSerW NW_S0_DeaWard nw_s0_detctundd NW_S0_DisMagic NW_S0_EagleSpl NW_S0_EndEle NW_S0_Entangle NW_S0_FreeMove NW_S0_HoldAnim NW_S0_InvPurge nw_s0_jagtooth nw_s0_lowltvisn NW_S0_LsRestor NW_S0_OwlWis NW_S0_PolySelf NW_S0_Prayer NW_S0_PrChaos NW_S0_PrEvil NW_S0_PrGood NW_S0_PrLaw NW_S0_ProEnergy NW_S0_RemEffect NW_S0_ResEnergy NW_S0_Resis NW_S0_Restore NW_S0_RmvParal nw_s0_shldother NW_S0_Sleep NW_S0_Summon NW_S0_Virtue nx_s0_bladecurse nx_s0_healanimal nx_s0_lionheart nx_s0_mbladecurse nx_s0_visage nx2_s0_animalistic_power nx2_s0_blades_of_fire nx2_s0_castigate NX2_S0_ReduceAnimal NX2_S0_Stabilize scod_s_invoke_cerulean_sign x0_s0_auraglory x0_s0_camo x0_s0_divfav x0_s0_gmagicfang x0_s0_magicfang x0_s0_masscamo x0_s0_spikegro X2_S0_BlssWeap X2_S0_GrMagWeap X2_S0_HolySwrd X2_S0_MagcWeap
Done and ready for update.
As it says.