HoS_PRC8/_mod/_removed/nw_s0_grshconj.nss
Jaysyn904 04165202c0 Initial upload
Initial upload
2024-11-25 19:36:07 -05:00

154 lines
4.7 KiB
Plaintext

// Modified by Deva Winblood.
//::///////////////////////////////////////////////
//:: Greater Shadow Conjuration
//:: NW_S0_GrShConj.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
If the opponent is clicked on Shadow Bolt is cast.
If the caster clicks on himself he will cast
Clarity and Mirror Image. If they click on
the ground they will summon a Shadow Assassin.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: April 12, 2001
//:://////////////////////////////////////////////
void ShadowBolt (object oTarget, int nMetaMagic);
void fnWatch(object oMaster)
{ // PURPOSE: For summone critter to know when to despawn
effect eUnsum=EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1);
object oMe=OBJECT_SELF;
SetLocalInt(oMe,"bWatcher",TRUE);
//SendMessageToPC(oMaster,"DEBUG: '"+GetName(oMe)+"' Watching");
if (GetIsObjectValid(oMaster)==TRUE)
{ // valid master
if (GetIsDead(oMaster)||GetCurrentAction(oMaster)==ACTION_REST||GetLocalInt(oMe,"bUnsummon"))
{ // despawn
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY,eUnsum,GetLocation(oMe),4.0);
RemoveHenchman(oMaster,oMe);
SetIsDestroyable(TRUE,FALSE,FALSE);
DelayCommand(1.0,DestroyObject(oMe));
} // despawn
DelayCommand(6.0,fnWatch(oMaster));
} // valid master
else
{ // destroy self
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY,eUnsum,GetLocation(oMe),4.0);
RemoveHenchman(oMaster,oMe);
SetIsDestroyable(TRUE,FALSE,FALSE);
DelayCommand(1.0,DestroyObject(oMe));
DelayCommand(6.0,fnWatch(oMaster));
} // destroy self
} // fnWatch()
void fnSetWatchers(object oMaster,float fDur)
{ // PURPOSE: Fire the watcher routines
int nN=1;
object oSum;
oSum=GetAssociate(ASSOCIATE_TYPE_SUMMONED,oMaster,nN);
while(GetIsObjectValid(oSum))
{ // check for watch
//SendMessageToPC(oMaster,"DEBUG: Summoned '"+GetName(oSum)+"'");
if (GetLocalInt(oSum,"bWatcher")!=TRUE)
{ // fire watch
AssignCommand(oSum,fnWatch(oMaster));
DelayCommand(fDur,SetLocalInt(oSum,"bUnsummon",TRUE));
} // fire watch
nN++;
oSum=GetAssociate(ASSOCIATE_TYPE_SUMMONED,oMaster,nN);
} // check for watch
} // fnSetWatchers()
void main()
{
int nMetaMagic = GetMetaMagicFeat();
object oTarget = GetSpellTargetObject();
int nCast;
int nDuration = GetCasterLevel(OBJECT_SELF);
effect eMirror;
effect eClarity;
effect eMind;
effect eLink;
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2; //Duration is +100%
}
if (GetIsObjectValid(oTarget))
{
if (oTarget == OBJECT_SELF)
{
nCast = 1;
}
else
{
nCast = 2;
}
}
else
{
nCast = 3;
}
switch (nCast)
{
case 1:
/*
Cast Clarity and Mirror Image on the caster
*/
eMirror = EffectVisualEffect(VFX_DUR_BLUR);
eClarity = EffectVisualEffect(VFX_IMP_REMOVE_CONDITION);
eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_POSITIVE);
eLink = EffectLinkEffects(eMirror, eMind);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink,oTarget, RoundsToSeconds(2));
case 2:
if (!ResistSpell(OBJECT_SELF, oTarget))
{
ShadowBolt(oTarget, nMetaMagic);
}
case 3:
int nCasterLevel = GetCasterLevel(OBJECT_SELF);
effect eSummon = EffectSummonCreature("sumshadassa");
effect eGate = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD);
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, GetSpellTargetLocation(), HoursToSeconds(nDuration));
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eGate, GetSpellTargetLocation());
DelayCommand(3.0,fnSetWatchers(OBJECT_SELF,HoursToSeconds(nDuration)));
}
}
void ShadowBolt (object oTarget, int nMetaMagic)
{
int nDamage;
int nBolts = GetCasterLevel(OBJECT_SELF)/5;
int nCnt;
for (nCnt = 0; nCnt < nBolts; nCnt++)
{
int nDam = d6(3);
//Enter Metamagic conditions
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDamage = 18;//Damage is at max
}
else if (nMetaMagic == METAMAGIC_EMPOWER)
{
nDamage = nDamage + nDamage/2; //Damage/Healing is +50%
}
if (ReflexSave(oTarget, GetSpellSaveDC()))
{
nDamage = nDamage/2;
}
effect eDam = EffectDamage(nDamage, DAMAGE_TYPE_NEGATIVE);
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}