NWNDS/nwnds_module/ps_plnrg_pos.nss
Jaysyn904 de24f81734 Added NWN Dark Sun module contents
Added NWN Dark Sun module contents.
2021-07-12 21:24:46 -04:00

32 lines
1.2 KiB
Plaintext

/************************************
* Summon Planar Energy (Positive) *
* *
* Cost: 16 *
* Power Score: Int *
* *
************************************/
#include "lib_psionic"
void main()
{
object oPC=OBJECT_SELF;
int nCost=16;
int nPowerScore=GetAbilityScore(oPC, ABILITY_INTELLIGENCE);
int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_SUMMON_PLANAR_ENERGY);
effect eVis=EffectVisualEffect(VFX_COM_HIT_DIVINE);
object oTarget=GetSpellTargetObject();
int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_INTELLIGENCE);
int nDamage=(GetRacialType(oTarget)==IP_CONST_RACIALTYPE_UNDEAD?2*d12(3):d12(3));
if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_SUMMON_PLANAR_ENERGY)) return;
effect eLink=EffectDamage(GetEnhancedEffect(nDamage, FEAT_PSIONIC_SUMMON_PLANAR_ENERGY), DAMAGE_TYPE_POSITIVE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eLink, oTarget);
SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_SUMMON_PLANAR_ENERGY));
}