Since I was rewriting all of my spells anyways, I figured I'd hook in a system for changing the elemental nature of spells while I was at it.
I have the elemental affinities that I've included so far (The traditional air, earth, fire, and water, plus ice and lightning) as selectable, usable, feats, also given out as bonus feats based on deity selected.
For AOE spells, if the selected affinity matches the default spell, the default VFX can be used, otherwise that gets replaced with a generic one based on the element as well.
I gave each elemental affinity two associated damage types, though the second only gets used in a few spells. So far, I've hooked it into fire shield, ice storm, flame strike, and fire storm that use both.
I'm not happy with some of the VFX I've picked initially, I'll have to go through all those extra ones in the cep to find better ones still, especially for earth and air.
I also forgot to add the IP damage type constants to the struct, though with only a couple spells that use those I might still add them on a seperate routine.
Anyways, here's the struct and the script I have so far. As always, any ideas for optimizing or adding to it would be appreciated. I have to assume the PRC must have done something similar, if they did I'd be curious if anyone knew how they'd handled it as well. Any suggestions for vanilla or cep 2.3 VFX to use would also be helpful.
struct EA {int Match;
int Save1;
int Save2;
int Damage1;
int Damage2;
int S;
int M;
int L;
int AOE;
int Beam;
int Mirv;};
//// nBaseElement, 1 = Air, 2 = Earth, 3 = Fire, 4 = Water/Acid, 5 = Ice, 6 = Lightning
struct EA GetElementalAffinity (int nBaseElement)
{
struct EA VFX;
int nFeat = GetLocalInt (OBJECT_SELF, "ELEMENTAL_AFFINITY");
//// Apply the default element if no affinity is active.
if (!nFeat) nFeat = nBaseElement;
if (nFeat == nBaseElement) VFX.Match = TRUE;
switch (nFeat)
{
case 1: VFX.Save1 = SAVING_THROW_TYPE_NONE; VFX.Save2 = SAVING_THROW_TYPE_SONIC;
VFX.Damage1 = DAMAGE_TYPE_SLASHING; VFX.Damage2 = DAMAGE_TYPE_SONIC;
VFX.S = VFX_IMP_DUST_EXPLOSION; VFX.M = VFX_IMP_DUST_EXPLOSION; VFX.L = VFX_IMP_DUST_EXPLOSION;
VFX.AOE = VFX_FNF_HOWL_MIND; VFX.Beam = VFX_BEAM_FIRE_W_SILENT;
VFX.Mirv = VFX_IMP_MIRV; break;
case 2: VFX.Save1 = SAVING_THROW_TYPE_NONE; VFX.Save2 = SAVING_THROW_TYPE_NONE;
VFX.Damage1 = DAMAGE_TYPE_BLUDGEONING; VFX.Damage2 = DAMAGE_TYPE_PIERCING;
VFX.S = VFX_IMP_HEAD_ODD; VFX.M = VFX_IMP_NIGHTMARE_HEAD_HIT; VFX.L = VFX_IMP_SPIKE_TRAP;
VFX.AOE = VFX_FNF_SCREEN_SHAKE; VFX.Beam = VFX_BEAM_CHAIN;
VFX.Mirv = VFX_IMP_MIRV; break;
case 3: VFX.Save1 = SAVING_THROW_TYPE_FIRE; VFX.Save2 = SAVING_THROW_TYPE_DIVINE;
VFX.Damage1 = DAMAGE_TYPE_FIRE; VFX.Damage2 = DAMAGE_TYPE_DIVINE;
VFX.S = VFX_IMP_FLAME_S; VFX.M = VFX_IMP_FLAME_M; VFX.L = VFX_IMP_FLAME_M;
VFX.AOE = VFX_FNF_FIREBALL; VFX.Beam = VFX_BEAM_FIRE;
VFX.Mirv = VFX_IMP_MIRV_FLAME; break;
case 4: VFX.Save1 = SAVING_THROW_TYPE_ACID; VFX.Save2 = SAVING_THROW_TYPE_NONE;
VFX.Damage1 = DAMAGE_TYPE_ACID; VFX.Damage2 = DAMAGE_TYPE_PIERCING;
VFX.S = VFX_IMP_ACID_S; VFX.M = VFX_IMP_ACID_S; VFX.L = VFX_IMP_ACID_L;
VFX.AOE = VFX_FNF_GAS_EXPLOSION_ACID; VFX.Beam = VFX_BEAM_DISINTEGRATE;
VFX.Mirv = VFX_IMP_MIRV; break;
case 5: VFX.Save1 = SAVING_THROW_TYPE_COLD; VFX.Save2 = SAVING_THROW_TYPE_NONE;
VFX.Damage1 = DAMAGE_TYPE_COLD; VFX.Damage2 = DAMAGE_TYPE_BLUDGEONING;
VFX.S = VFX_IMP_FROST_S; VFX.M = VFX_IMP_FROST_S; VFX.L = VFX_IMP_FROST_L;
VFX.AOE = VFXPFC_FNF_OTIL_COLDSPHERE_2; VFX.Beam = VFX_BEAM_COLD;
VFX.Mirv = VFX_IMP_MIRV; break;
case 6: VFX.Save1 = SAVING_THROW_TYPE_ELECTRICITY; VFX.Save2 = SAVING_THROW_TYPE_FIRE;
VFX.Damage1 = DAMAGE_TYPE_ELECTRICAL; VFX.Damage2 = DAMAGE_TYPE_FIRE;
VFX.S = VFX_IMP_LIGHTNING_S; VFX.M = VFX_IMP_LIGHTNING_M; VFX.L = VFX_IMP_LIGHTNING_M;
VFX.AOE = VFX_FNF_ELECTRIC_EXPLOSION; VFX.Beam = VFX_BEAM_LIGHTNING;
VFX.Mirv = VFX_IMP_MIRV_ELECTRIC; break;
}
return VFX;
}