Files
PRC8/nwn/nwnprc/trunk/spells/sp_command.nss
Jaysyn904 306779349c 2026/06/05 Update
Added Sanctified damage type.
Added Holy damage type.
Added Unholy damage type.
Added Falling damage type.
Added Ballistic damage type.
Added Desiccation damage type.
Fixed Major Missile's LABEL in spells.2da.
Fixed Major Missile's LABEL in des_cft_spells.2da.
Fixed Major Missile's LABEL in des_cft_scrolls.2da.
Disabled incomplete PnP version of Shades spell.
Astaroth's free crafting feats should drop off onRest, when expelling a vestige & when rebinding a vestige.
Re-enabled caster level override variable clearing in GetInvokerLevel().
Change Piercing Cold's damagetype to Untyped.
Constanted new damagetypes correctly for scripting (@lightbeard)
Changed all force spells damagetype to force.
Fixed issue with Initiators using Shadows Blade, Ironheart Aura and Shadow Trickster with dual-stances.
Changed Eldritch Blast to Untyped damage.
Fixed Path of Shadow screwing up caster levels.
Changed Sanctify Martial strike to be Holy damage.
Changed Vile Martial strike to be Vile damage.
Updated Forsaker to work with Warforged "Armor".
Added a SignalEvent() to Invisible Needle so it would break Invisibility when it should.
Fixed equip exploit with Shou Disciple and monk weapons.
Changed Saint template's Holy Touch to do Holy Damage.
Changed Horrid Wilting to do Desiccation damage.
Fixed Break Enchantment's targeting.
Fixed the Command spell to obey mind immunity.
Changed Damning Darkness to do Unholy damage.
Change the Necrotic spells to do Vile damage.
Made Persistent Blade more like PnP and made it dispellable.
2026-06-05 21:33:30 -04:00

81 lines
2.6 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Name Command
//:: FileName sp_command.nss
//:://////////////////////////////////////////////
/**@file Command
Enchantment (Compulsion) [Mind-Affecting]
Level: Cleric 1
Components: V
Casting Time: 1 action
Range: Close (25 ft. + 5 ft/2 levels)
Targets: 1 living creature
Duration: 1 Round
Saving Throw: Will Negates
Spell Resistance: Yes
You give the subject a single command, which it obeys to the best of its ability.
Approach - The target runs directly towards you for one round.
Drop - The target drops what it is holding (This will not work on creatures that cannot be disarmed).
Fall - The target falls to the ground for one round.
Flee - The target runs away from the caster for one round.
Halt - The target stands in place and takes no action for one round.
Author: Stratovarius
Created: 29/4/06
Fixed by: Jaysyn
Date: 2026-05-29 00:57:05
*/
//:://////////////////////////////////////////////
//:://////////////////////////////////////////////
#include "prc_inc_spells"
#include "prc_add_spell_dc"
void main()
{
PRCSetSchool(SPELL_SCHOOL_ENCHANTMENT);
// Run the spellhook.
if (!X2PreSpellCastCode()) return;
//Define vars
object oCaster = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
int nSpellId = PRCGetSpellId();
int nMetaMagic = PRCGetMetaMagicFeat();
int nDC = PRCGetSaveDC(oTarget,OBJECT_SELF);
int nCaster = PRCGetCasterLevel(OBJECT_SELF);
int nDuration = 1;
//Enter Metamagic conditions
if (CheckMetaMagic(nMetaMagic, METAMAGIC_EXTEND))
{
nDuration = nDuration * 2; //Duration is +100%
}
effect eVis = EffectVisualEffect(VFX_IMP_CONFUSION_S);
effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectLinkEffects(eMind, eDur);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId()));
if (!PRCDoResistSpell(OBJECT_SELF, oTarget, nCaster+SPGetPenetr()) && PRCGetIsAliveCreature(oTarget))
{
if(!GetIsImmune(oTarget, IMMUNITY_TYPE_MIND_SPELLS))
{
if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS))
{
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration), TRUE,-1,nCaster);
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
DoCommandSpell(oCaster, oTarget, nSpellId, nDuration, nCaster);
}
}
}
PRCSetSchool();
}