Initial upload.
Adding base PRC 4.19a files to repository.
This commit is contained in:
102
trunk/spells/nw_s0_dompers.nss
Normal file
102
trunk/spells/nw_s0_dompers.nss
Normal file
@@ -0,0 +1,102 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: [Dominate Person]
|
||||
//:: [NW_S0_DomPers.nss]
|
||||
//:: Copyright (c) 2000 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Will save or the target is dominated for 1 round
|
||||
//:: per caster level.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Jan 29, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Last Updated By: Preston Watamaniuk, On: April 6, 2001
|
||||
//:: Last Updated By: Preston Watamaniuk, On: April 10, 2001
|
||||
//:: VFX Pass By: Preston W, On: June 20, 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 eDom = EffectCutsceneDominated(); // Allows multiple dominated creatures
|
||||
eDom = PRCGetScaledEffect(eDom, oTarget);
|
||||
effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DOMINATED);
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
|
||||
|
||||
//Link duration effects
|
||||
effect eLink = EffectLinkEffects(eMind, eDom);
|
||||
eLink = EffectLinkEffects(eLink, eDur);
|
||||
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_DOMINATE_S);
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
|
||||
int nCasterLevel = CasterLvl;
|
||||
int nDuration = 2 + nCasterLevel/3;
|
||||
nDuration = PRCGetScaledDuration(nDuration, oTarget);
|
||||
int nRacial = MyPRCGetRacialType(oTarget);
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_DOMINATE_PERSON, FALSE));
|
||||
nCasterLevel +=SPGetPenetr();
|
||||
//Make sure the target is a humanoid
|
||||
if(!GetIsReactionTypeFriendly(oTarget))
|
||||
{
|
||||
if ((nRacial == RACIAL_TYPE_DWARF) ||
|
||||
(nRacial == RACIAL_TYPE_ELF) ||
|
||||
(nRacial == RACIAL_TYPE_GNOME) ||
|
||||
(nRacial == RACIAL_TYPE_HALFLING) ||
|
||||
(nRacial == RACIAL_TYPE_HUMAN) ||
|
||||
(nRacial == RACIAL_TYPE_HALFELF) ||
|
||||
(nRacial == RACIAL_TYPE_HALFORC))
|
||||
{
|
||||
//Make SR Check
|
||||
if (!PRCDoResistSpell(OBJECT_SELF, oTarget,nCasterLevel))
|
||||
{
|
||||
//Make Will Save
|
||||
if (!/*Will Save*/ PRCMySavingThrow(SAVING_THROW_WILL, oTarget, (PRCGetSaveDC(oTarget,OBJECT_SELF)), SAVING_THROW_TYPE_MIND_SPELLS, OBJECT_SELF, 1.0))
|
||||
{
|
||||
//Check for metamagic extension
|
||||
if (nMetaMagic & METAMAGIC_EXTEND)
|
||||
{
|
||||
nDuration = nDuration * 2;
|
||||
}
|
||||
// Extra domination immunity check - using EffectCutsceneDominated(), which normally bypasses
|
||||
if(!GetIsImmune(oTarget, IMMUNITY_TYPE_DOMINATE) && !GetIsImmune(oTarget, IMMUNITY_TYPE_MIND_SPELLS))
|
||||
{
|
||||
//Apply linked effects and VFX impact
|
||||
DelayCommand(1.0, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration),TRUE,-1,CasterLvl));
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
Reference in New Issue
Block a user