PRC8/nwn/trunk/spells/sp_sphereud.nss
Jaysyn904 5914ed2ab5 Updated Release Archive
Updated Release Archive.  Fixed Mage-killer prereqs.  Removed old LETO & ConvoCC related files.  Added organized spell scroll store.  Fixed Gloura spellbook. Various TLK fixes.  Reorganized Repo.  Removed invalid user folders. Added DocGen back in.
2023-08-22 10:00:21 -04:00

27 lines
1.0 KiB
Plaintext

#include "prc_inc_spells"
#include "prc_add_spell_dc"
void main()
{
if (!X2PreSpellCastCode()) return;
// Calculate spell duration.
int nCasterLvl = PRCGetCasterLevel();
float fDuration = RoundsToSeconds(nCasterLvl);
if(GetPRCSwitch(PRC_SUMMON_ROUND_PER_LEVEL))
fDuration = RoundsToSeconds(nCasterLvl*GetPRCSwitch(PRC_SUMMON_ROUND_PER_LEVEL));
fDuration = PRCGetMetaMagicDuration(fDuration);
// Apply summon and vfx at target location.
location lTarget = PRCGetSpellTargetLocation();
MultisummonPreSummon();
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY,
EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_3), lTarget);
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY,
EffectSummonCreature("sp_sphereofud"), lTarget, fDuration);
// Save the spell DC and SR for the spell so the sphere can use it.
int nSaveDC = PRCGetSaveDC(OBJECT_SELF,OBJECT_SELF);
SetLocalInt(OBJECT_SELF, "SP_SPHEREOFUD_DC", nSaveDC);
SetLocalInt(OBJECT_SELF, "SP_SPHEREOFUD_SR", nCasterLvl);
}