PRC8/trunk/spells/sp_sphereud.nss
Jaysyn904 1662218bb4 Initial upload.
Adding base PRC 4.19a files to repository.
2022-10-07 13:51:24 -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);
}