Added Dynamic Kobolds
Added Dynamic Kobolds. Fixed ghoul / wight texture. Added Jann model. Made PnP Zombie, Ghoul, Ghast, Wight & Mohrg creatures. Full Compile
This commit is contained in:
63
_module/nss/lvl_drain_onhit.nss
Normal file
63
_module/nss/lvl_drain_onhit.nss
Normal file
@@ -0,0 +1,63 @@
|
||||
//::
|
||||
//:: lvl_drain_onhit.nss
|
||||
//::
|
||||
//:: Modified by: Jaysyn 20221215
|
||||
//::
|
||||
|
||||
#include "NW_I0_GENERIC"
|
||||
#include "nw_i0_spells"
|
||||
#include "nw_i0_plot"
|
||||
#include "prc_inc_racial"
|
||||
|
||||
|
||||
void DoLevelDrain(object oTarget, object oCaster)
|
||||
{
|
||||
// Setup oCaster's healing
|
||||
effect eDrain = EffectTemporaryHitpoints(5);
|
||||
eDrain = ExtraordinaryEffect(eDrain);
|
||||
effect eVis1 = EffectVisualEffect(VFX_IMP_HEALING_L);
|
||||
|
||||
// Setup Level Drain
|
||||
effect eVis2 = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
|
||||
effect eNeg = EffectNegativeLevel(1);
|
||||
eNeg = SupernaturalEffect(eNeg);
|
||||
|
||||
// Drain levels from oTarget
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget);
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eNeg, oTarget, HoursToSeconds(24));
|
||||
// Apply Temp HP to oCaster
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis1, oCaster);
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDrain, oCaster, HoursToSeconds(1));
|
||||
|
||||
}
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
//:: Declare major variables
|
||||
object oCaster = OBJECT_SELF ; //:: Where the spell came from
|
||||
object oTarget = GetSpellTargetObject(); //:: What the spell is aimed at
|
||||
|
||||
int nRaceType = MyPRCGetRacialType(oTarget);
|
||||
int nChaMod = GetAbilityModifier(5, oCaster);
|
||||
int nMobHD = GetHitDice(oCaster);
|
||||
int nDC = 10 + (nMobHD / 2) + nChaMod;
|
||||
int nSave = FortitudeSave( oTarget, nDC );
|
||||
|
||||
//:: Check for Negative Level Immunity
|
||||
if ( GetIsImmune(oTarget, IMMUNITY_TYPE_NEGATIVE_LEVEL) )
|
||||
{
|
||||
SendMessageToPC(oTarget, "Immune to level drain.");
|
||||
return;
|
||||
}
|
||||
|
||||
//:: Saving throw
|
||||
if ( nSave )
|
||||
return;
|
||||
|
||||
//:: if you got this far, you're taking a negative level.
|
||||
|
||||
DelayCommand(0.1, DoLevelDrain(oTarget,oCaster));
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user