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

93 lines
2.6 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Planar Ally
//:: X0_S0_Planar.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Summons an outsider dependant on alignment, or
holds an outsider if the creature fails a save.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: April 12, 2001
//:://////////////////////////////////////////////
//:: Modified from Planar binding
//:: Hold ability removed for cleric version of spell
#include "NW_I0_SPELLS"
#include "x2_inc_spellhook"
#include "inc_multisummon"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
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
object oTarget = GetSpellTargetObject();
int nMetaMagic = GetMetaMagicFeat();
int nCasterLevel = GetCasterLevel(OBJECT_SELF);
int nDuration = GetCasterLevel(OBJECT_SELF);
effect eSummon;
effect eGate;
if(nDuration == 0)
{
nDuration == 1;
}
//Check for metamagic extend
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2; //Duration is +100%
}
int nAlign = GetAlignmentGoodEvil(OBJECT_SELF);
string sSummon;
int nFNF_Effect;
float fSummonDelay;
switch (nAlign)
{
case ALIGNMENT_EVIL:
sSummon = "NW_S_SUCCUBUS";
nFNF_Effect = VFX_FNF_SUMMON_GATE;
fSummonDelay = 3.0;
break;
case ALIGNMENT_GOOD:
sSummon = "NW_S_CHOUND";
nFNF_Effect = VFX_FNF_SUMMON_CELESTIAL;
fSummonDelay = 3.0;
break;
case ALIGNMENT_NEUTRAL:
sSummon = "NW_S_SLAADGRN";
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_3;
fSummonDelay = 1.0;
break;
}
//Apply the VFX impact and summon effect
if(GetLocalInt(GetModule(), "PnPSummonDuration")==FALSE)
PrimoEffectSummonCreature(sSummon, nFNF_Effect,
GetSpellTargetLocation(), DURATION_TYPE_TEMPORARY, HoursToSeconds(nDuration), fSummonDelay);
else
PrimoEffectSummonCreature(sSummon, nFNF_Effect,
GetSpellTargetLocation(), DURATION_TYPE_TEMPORARY, RoundsToSeconds(nDuration), fSummonDelay);
}