117 lines
3.1 KiB
Plaintext
117 lines
3.1 KiB
Plaintext
//::
|
|
//:: bld_drain_onhit.nss
|
|
//::
|
|
//:: Modified by: Jaysyn 20221216
|
|
//::
|
|
|
|
#include "prc_inc_combmove"
|
|
#include "prc_misc_const"
|
|
|
|
/*void DoBloodDrain(object oTarget, object oCaster)
|
|
{
|
|
//:: Setup oCaster's healing
|
|
effect eVis1 = EffectVisualEffect(VFX_IMP_HEALING_L);
|
|
effect eDrain = EffectTemporaryHitpoints(5);
|
|
|
|
eDrain = ExtraordinaryEffect(eDrain);
|
|
|
|
//:: Setup Blood Drain
|
|
effect eVis2 = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
|
|
effect eBlood = EffectAbilityDecrease(2, d4(1));
|
|
|
|
eBlood = SupernaturalEffect(eBlood);
|
|
|
|
//:: Drain blood from oTarget
|
|
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget);
|
|
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBlood, oTarget);
|
|
|
|
//:: Apply Temp HP to oCaster
|
|
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis1, oCaster);
|
|
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDrain, oCaster, HoursToSeconds(1));
|
|
|
|
if (GetGrapple(oTarget) == TRUE)
|
|
{
|
|
DelayCommand(6.0f, DoBloodDrain(oTarget, oCaster));
|
|
}
|
|
|
|
}
|
|
*/
|
|
|
|
|
|
void main()
|
|
{
|
|
//:: Declare major variables
|
|
object oCaster = OBJECT_SELF ; //:: Where the spell came from
|
|
object oTarget = PRCGetSpellTargetObject(); //:: 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 );
|
|
int GrappleBonus = GetLocalInt(oCaster, "GRAPPLE_BONUS");
|
|
int CasterSize = PRCGetSizeModifier(oCaster);
|
|
int TargetSize = PRCGetSizeModifier(oTarget);
|
|
int GrappleChance = d100();
|
|
|
|
int nEvent = GetRunningEvent();
|
|
|
|
//:: Check for Entangle Immunity
|
|
if ( GetIsImmune(oTarget, IMMUNITY_TYPE_ENTANGLE) )
|
|
{
|
|
SendMessageToPC(oTarget, "Immune to grappling.");
|
|
SendMessageToPC(oCaster, "Target is immune to grappling.");
|
|
return;
|
|
}
|
|
|
|
//:: Check for Freedom Itemprop
|
|
if ( IPGetHasItemPropertyOnCharacter(oTarget, ITEM_PROPERTY_FREEDOM_OF_MOVEMENT) )
|
|
{
|
|
SendMessageToPC(oTarget, "Immune to grappling.");
|
|
SendMessageToPC(oCaster, "Target is immune to grappling.");
|
|
return;
|
|
}
|
|
|
|
//:: Don't try to grapple on every attack.
|
|
/* if (GetGrapple(oTarget) == FALSE)
|
|
{
|
|
if (GrappleChance >= 66)
|
|
{
|
|
return;
|
|
}
|
|
}*/
|
|
|
|
//:: Can't grapple target if two or more size categories larger than you are.
|
|
if (TargetSize - 2 >= CasterSize)
|
|
{
|
|
FloatingTextStringOnCreature("This creature is too large to grapple.", oCaster);
|
|
return;
|
|
}
|
|
|
|
//:: If you got this far, you're getting grappled.
|
|
|
|
DoGrapple(oCaster, oTarget, 0, TRUE, TRUE);
|
|
|
|
//:: Hook in the events if grapple is successful
|
|
if (GetGrapple(oTarget) == TRUE)
|
|
{
|
|
if(DEBUG) DoDebug("Blood Drain: Adding eventhooks");
|
|
FloatingTextStringOnCreature("Blood Drain: Adding eventhooks.", oCaster);
|
|
FloatingTextStringOnCreature("Blood Drain: Adding eventhooks.", oTarget);
|
|
AddEventScript(oTarget, EVENT_HEARTBEAT, "hb_vamp_bl_drain", TRUE, FALSE);
|
|
}
|
|
|
|
/* if (GetGrapple(oTarget) == FALSE)
|
|
{
|
|
DoGrapple(oCaster, oTarget, 0, TRUE, TRUE);
|
|
|
|
if (GetGrapple(oTarget) == TRUE)
|
|
{
|
|
DoBloodDrain(oTarget, oCaster);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
DoBloodDrain(oTarget, oCaster);
|
|
}*/
|
|
} |