Initial upload
Initial upload. PRC8 has been added. Module compiles, PRC's default AI & treasure scripts have been integrated. Started work on top hak for SLA / Ability / Scripting modifications.
This commit is contained in:
73
_removed/nw_s0_mindfoga.nss
Normal file
73
_removed/nw_s0_mindfoga.nss
Normal file
@@ -0,0 +1,73 @@
|
||||
///::///////////////////////////////////////////////
|
||||
//:: Mind Fog: On Enter
|
||||
//:: NW_S0_MindFogA.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Creates a bank of fog that lowers the Will save
|
||||
of all creatures within who fail a Will Save by
|
||||
-10. Affect lasts for 2d6 rounds after leaving
|
||||
the fog
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Aug 1, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "X0_I0_SPELLS"
|
||||
#include "x2_inc_spellhook"
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
//Declare major variables
|
||||
object oTarget = GetEnteringObject();
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_NEGATIVE);
|
||||
effect eLower = EffectSavingThrowDecrease(SAVING_THROW_WILL, 10);
|
||||
effect eLink = EffectLinkEffects(eVis, eLower);
|
||||
int bValid = FALSE;
|
||||
float fDelay = GetRandomDelay(1.0, 2.2);
|
||||
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, GetAreaOfEffectCreator()))
|
||||
{
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_MIND_FOG));
|
||||
//Make SR check
|
||||
effect eAOE = GetFirstEffect(oTarget);
|
||||
if(GetHasSpellEffect(SPELL_MIND_FOG, oTarget))
|
||||
{
|
||||
while (GetIsEffectValid(eAOE))
|
||||
{
|
||||
//If the effect was created by the Mind_Fog then remove it
|
||||
if (GetEffectSpellId(eAOE) == SPELL_MIND_FOG && GetAreaOfEffectCreator() == GetEffectCreator(eAOE))
|
||||
{
|
||||
if(GetEffectType(eAOE) == EFFECT_TYPE_SAVING_THROW_DECREASE)
|
||||
{
|
||||
RemoveEffect(oTarget, eAOE);
|
||||
bValid = TRUE;
|
||||
}
|
||||
}
|
||||
//Get the next effect on the creation
|
||||
eAOE = GetNextEffect(oTarget);
|
||||
}
|
||||
//Check if the effect has been put on the creature already. If no, then save again
|
||||
//If yes, apply without a save.
|
||||
}
|
||||
if(bValid == FALSE)
|
||||
{
|
||||
if(!MyResistSpell(OBJECT_SELF, oTarget))
|
||||
{
|
||||
//Make Will save to negate
|
||||
if(!MySavingThrow(SAVING_THROW_WILL, oTarget, GetSpellSaveDC(), SAVING_THROW_TYPE_MIND_SPELLS))
|
||||
{
|
||||
//Apply VFX impact and lowered save effect
|
||||
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oTarget));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//Apply VFX impact and lowered save effect
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oTarget);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user