Files
HeroesStone_PRC8/_removed/nw_s0_summshad.nss
Jaysyn904 1eefc84201 Initial Commit
Initial Commit.
2025-09-14 15:40:46 -04:00

79 lines
2.1 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Summon Shadow
//:: NW_S0_SummShad.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Spell powerful ally from the shadow plane to
battle for the wizard
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Oct 26, 2001
//:://////////////////////////////////////////////
#include "x2_inc_spellhook"
#include "inc_multisummon"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-23 by GeorgZ
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
int nMetaMagic = GetMetaMagicFeat();
int nCasterLevel = GetCasterLevel(OBJECT_SELF);
int nDuration = nCasterLevel;
if(nDuration < SUMMON_DURATION_MIN)
nDuration = SUMMON_DURATION_MIN;
if(GetLocalInt(GetModule(), "PnPSummonDuration")==FALSE)
nDuration = nCasterLevel;
//Check for metamagic extend
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2; //Duration is +100%
}
//Set the summoned undead to the appropriate template based on the caster level
string sSummon;
if (nCasterLevel <= 7)
{
sSummon = "NW_S_SHADOW";
}
else if ((nCasterLevel >= 8) && (nCasterLevel <= 10))
{
sSummon = "NW_S_SHADMASTIF";
}
else if ((nCasterLevel >= 11) && (nCasterLevel <= 14))
{
sSummon = "NW_S_SHFIEND";
}
else if ((nCasterLevel >= 15))
{
sSummon = "NW_S_SHADLORD";
}
int nFNF_Effect = VFX_FNF_SUMMON_UNDEAD;
if(GetLocalInt(GetModule(), "PnPSummonDuration")==FALSE)
PrimoEffectSummonCreature(sSummon, nFNF_Effect,
GetSpellTargetLocation(), DURATION_TYPE_TEMPORARY, HoursToSeconds(nDuration));
else
PrimoEffectSummonCreature(sSummon, nFNF_Effect,
GetSpellTargetLocation(), DURATION_TYPE_TEMPORARY, RoundsToSeconds(nDuration));
}