generated from Jaysyn/ModuleTemplate
Initial Commit
Initial Commit.
This commit is contained in:
114
_module/nss/userdef_wweird.nss
Normal file
114
_module/nss/userdef_wweird.nss
Normal file
@@ -0,0 +1,114 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: WATER WEIRD SCRIPT
|
||||
//:: On UserDefined Script
|
||||
//:: By: Sir Otus
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
void WWeirdAttack(object oPC);
|
||||
|
||||
void main()
|
||||
{
|
||||
int nUser = GetUserDefinedEventNumber();
|
||||
|
||||
// *************************************************************
|
||||
// HEARTBEAT -
|
||||
// *************************************************************
|
||||
if(nUser == 1001)
|
||||
{
|
||||
}
|
||||
|
||||
// *************************************************************
|
||||
// PERCEIVE -
|
||||
// *************************************************************
|
||||
else if(nUser == 1002)
|
||||
{
|
||||
}
|
||||
|
||||
// *************************************************************
|
||||
// END OF COMBAT -
|
||||
// *************************************************************
|
||||
else if(nUser == 1003)
|
||||
{
|
||||
object oPC = GetAttackTarget();
|
||||
if(oPC == OBJECT_INVALID) oPC = GetAttemptedAttackTarget();
|
||||
if(GetDistanceToObject(oPC) < 4.0) WWeirdAttack(oPC);
|
||||
}
|
||||
|
||||
|
||||
// *************************************************************
|
||||
// ON CONVERSATION
|
||||
// *************************************************************
|
||||
else if(nUser == 1004)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// *************************************************************
|
||||
// ON ATTACKED
|
||||
// *************************************************************
|
||||
else if(nUser == 1005)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// *************************************************************
|
||||
// ON DAMAGED -
|
||||
// *************************************************************
|
||||
else if(nUser == 1006)
|
||||
{
|
||||
int iHP = GetCurrentHitPoints();
|
||||
string sTag = GetTag(OBJECT_SELF);
|
||||
if ((iHP <= 1)&&(!(GetLocalInt(OBJECT_SELF, ""+sTag+"Dispelled") == 1)))
|
||||
{
|
||||
int nHeal = GetMaxHitPoints(OBJECT_SELF);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_GAS_EXPLOSION_MIND), OBJECT_SELF);
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDisappearAppear(GetLocation(OBJECT_SELF)), OBJECT_SELF, 12.0f);
|
||||
DelayCommand(12.1, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(nHeal), OBJECT_SELF));
|
||||
}
|
||||
}
|
||||
|
||||
// *************************************************************
|
||||
// ON DEATH -
|
||||
// *************************************************************
|
||||
else if(nUser == 1007)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// *************************************************************
|
||||
// ON DISTURBED
|
||||
// *************************************************************
|
||||
else if(nUser == 1008)
|
||||
{
|
||||
}
|
||||
}
|
||||
// *************************************************************
|
||||
// WATER WEIRD ATTACK
|
||||
// *************************************************************
|
||||
#include "NW_I0_SPELLS"
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_inc_racial"
|
||||
|
||||
void WWeirdAttack(object oPC)
|
||||
{
|
||||
if(TouchAttackMelee(oPC))
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_FNF_GAS_EXPLOSION_MIND);
|
||||
// * certain racial types are immune to drowning
|
||||
if ((MyPRCGetRacialType(oPC) != RACIAL_TYPE_CONSTRUCT)
|
||||
&&(MyPRCGetRacialType(oPC) != RACIAL_TYPE_UNDEAD)
|
||||
&&(MyPRCGetRacialType(oPC) != RACIAL_TYPE_ELEMENTAL))
|
||||
{
|
||||
//Make a fortitude save vs. drowning
|
||||
if(PRCMySavingThrow(SAVING_THROW_FORT, oPC, 20) == FALSE)
|
||||
{
|
||||
FloatingTextStringOnCreature("Your lungs instantly fill with water!", oPC);
|
||||
//Apply the VFX impact and damage effect
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC);
|
||||
//Set damage effect to kill the target
|
||||
DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(), oPC));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user