Battledale_PRC8/_module/nss/jw_night_usd.nss
Jaysyn904 e5b3f6ad61 Finished PRC8 integration
Finished PRC8 integration.  Moved creature abilities to top hak.  Setup tooling.  Created release archive
2024-03-12 21:27:23 -04:00

107 lines
2.7 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Custom User Defined Event
//:: FileName
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
*/
//:://////////////////////////////////////////////
//:: Created By:
//:: Created On:
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"
void makesleep()
{
effect eVis = EffectVisualEffect(SPELLABILITY_DRAGON_BREATH_SLEEP);
effect eHowl = EffectSleep();
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eDur2 = EffectVisualEffect(VFX_DUR_PARALYZE_HOLD);
effect eImpact = EffectVisualEffect(VFX_FNF_HOWL_ODD);
effect eLink = EffectLinkEffects(eHowl, eDur);
eLink = EffectLinkEffects(eLink, eDur2);
float fDelay;
int nHD = GetHitDice(OBJECT_SELF);
int nDC = 18;
int nDuration = 1 + (nHD/2);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, OBJECT_SELF);
//Get first target in spell area
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(OBJECT_SELF));
while(GetIsObjectValid(oTarget))
{
if(!GetIsReactionTypeFriendly(oTarget) && !GetIsFriend(oTarget) && oTarget != OBJECT_SELF)
{
nDuration = GetScaledDuration(nDuration , oTarget);
//Fire cast spell at event for the specified target
//SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_HOWL_PARALYSIS));
fDelay = GetDistanceToObject(oTarget)/10;
//Make a saving throw check
if(FortitudeSave(oTarget,nDC,SAVING_THROW_TYPE_MIND_SPELLS)==0)
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(OBJECT_SELF));
}
}
void main()
{
ExecuteScript("prc_npc_userdef", OBJECT_SELF);
int nUser = GetUserDefinedEventNumber();
if(nUser == 1001) //HEARTBEAT
{
}
else if(nUser == 1002) // PERCEIVE
{
}
else if(nUser == 1003) // END OF COMBAT
{
}
else if(nUser == 1004) // ON DIALOGUE
{
}
else if(nUser == 1005) // ATTACKED
{
}
else if(nUser == 1006) // DAMAGED
{
if (GetLocalInt(OBJECT_SELF,"nDone")!=2)
{
makesleep();
SetLocalInt(OBJECT_SELF,"nDone",2);
}
else
if (d6()==1)
{
makesleep();
}
}
else if(nUser == 1007) // DEATH
{
}
else if(nUser == 1008) // DISTURBED
{
}
}