LoT_PRC8/_module/nss/trap_holy_minor.nss
Jaysyn904 ec287507a1 Initial upload
Initial upload.
2023-09-25 21:32:17 -04:00

55 lines
1.8 KiB
Plaintext

void CreateObject2(int nObjectType, string sTemplate, location lLocation, int bUseAppearAnimation=FALSE);
//::///////////////////////////////////////////////
//:: Minor Holy Trap
//:: NW_T1_HolyMinoC
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Strikes the entering undead with a beam of pure
sunlight for 2d10 damage.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: July 4th, 2001
//:://////////////////////////////////////////////
#include "prc_inc_racial"
void main()
{
//Declare major variables
object oTarget = GetEnteringObject();
int nAC = GetAC(oTarget);
//Make attack roll
int nRoll = d20(1) + 10 + 2;
effect eDam = EffectDamage(d10(4), DAMAGE_TYPE_DIVINE);
effect eVis = EffectVisualEffect(VFX_IMP_SUNSTRIKE);
if (nRoll > 0)
{
if (MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD)
{
//Apply Holy Damage and VFX impact
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
else
{
eDam = EffectDamage(d4(2), DAMAGE_TYPE_DIVINE);
//Apply Holy Damage and VFX impact
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
}
//respawn trap
DelayCommand(598.0, CreateObject2(GetObjectType(OBJECT_SELF), GetResRef(OBJECT_SELF), GetLocation(OBJECT_SELF)));
DelayCommand(600.0, DestroyObject(OBJECT_SELF));
}
void CreateObject2(int nObjectType, string sTemplate, location lLocation, int bUseAppearAnimation=FALSE)
{
CreateObject(nObjectType, sTemplate, lLocation, bUseAppearAnimation);
return;
}