PRC8/nwn/nwnprc/trunk/scripts/prc_hm_rdlinter.nss
Jaysyn904 6ec137a24e Updated AMS marker feats
Updated AMS marker feats.  Removed arcane & divine marker feats.  Updated Dread Necromancer for epic progression. Updated weapon baseitem models.  Updated new weapons for crafting & npc equip.
 Updated prefix.  Updated release archive.
2024-02-11 14:01:05 -05:00

49 lines
1.7 KiB
Plaintext

/*********************************************
* Feat: Riddle of Interaction
* Description: Charm Monster 3 per day:
*
* by Jeremiah Teague
*********************************************/
#include "prc_inc_spells"
#include "prc_add_spell_dc"
void main()
{
//Declare major variables
object oTarget = PRCGetSpellTargetObject();
effect eVis = EffectVisualEffect(VFX_IMP_CHARM);
effect eCharm = EffectCharmed();
eCharm = PRCGetScaledEffect(eCharm, oTarget);
effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_NEGATIVE);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
//Link effects
effect eLink = EffectLinkEffects(eMind, eCharm);
eLink = EffectLinkEffects(eLink, eDur);
int nMetaMagic = PRCGetMetaMagicFeat();
int nCasterLevel = GetCasterLevel(OBJECT_SELF);
int nDuration = 3 + nCasterLevel/2;
nDuration = PRCGetScaledDuration(nDuration, oTarget);
int nRacial = MyPRCGetRacialType(oTarget);
//Metamagic extend check
if (nMetaMagic & METAMAGIC_EXTEND)
{
nDuration = nDuration * 2;
}
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_CHARM_MONSTER, FALSE));
// Make Will save vs Mind-Affecting
if (!/*Will Save*/ PRCMySavingThrow(SAVING_THROW_WILL, oTarget, PRCGetSaveDC(oTarget, OBJECT_SELF), SAVING_THROW_TYPE_MIND_SPELLS))
{
//Apply impact and linked effect
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
}