Further file organization
Further file organization
This commit is contained in:
76
nwn/nwnprc/trunk/spells/sp_etercharmmon.nss
Normal file
76
nwn/nwnprc/trunk/spells/sp_etercharmmon.nss
Normal file
@@ -0,0 +1,76 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: [Charm Monster]
|
||||
//:: [NW_S0_CharmMon.nss]
|
||||
//:: Copyright (c) 2000 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Will save or the target is charmed.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Jan 29, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Update Pass By: Preston W, On: July 25, 2001
|
||||
|
||||
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
#include "prc_inc_spells"
|
||||
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_ENCHANTMENT);
|
||||
/*
|
||||
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
|
||||
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);
|
||||
eLink = SupernaturalEffect(eLink);
|
||||
|
||||
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
|
||||
int nPenetr = CasterLvl + SPGetPenetr();
|
||||
int nRacial = MyPRCGetRacialType(oTarget);
|
||||
|
||||
if(!GetIsReactionTypeFriendly(oTarget))
|
||||
{
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_CHARM_MONSTER, FALSE));
|
||||
// Make SR Check
|
||||
if (!PRCDoResistSpell(OBJECT_SELF, oTarget,nPenetr))
|
||||
{
|
||||
// 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
|
||||
SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oTarget, 0.0f,TRUE,-1,CasterLvl);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user