Changed folder name.
Changed folder name.
This commit is contained in:
63
_module/nss/raise_immo.nss
Normal file
63
_module/nss/raise_immo.nss
Normal file
@@ -0,0 +1,63 @@
|
||||
//raise_immo
|
||||
|
||||
//This script will automatically ressurect the immortal back to life
|
||||
//This script is controlled from the OnPlayerDeath event!
|
||||
|
||||
//Prototype
|
||||
void Raise(object oPlayer);
|
||||
|
||||
//Main Script...
|
||||
void main()
|
||||
{
|
||||
//The caller of the script...
|
||||
object oPC = OBJECT_SELF;
|
||||
|
||||
//Raise the PC back to life..
|
||||
Raise(oPC);
|
||||
|
||||
//Do a fancy visual effect on them :)
|
||||
effect eVis = EffectVisualEffect(VFX_FNF_NATURES_BALANCE, FALSE);
|
||||
DelayCommand(0.3, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC, 0.0f));
|
||||
|
||||
//Restore their immortal powers
|
||||
DelayCommand(0.5, ExecuteScript("powerimmortal", oPC));
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
// Raise OnDeath function (Standard Bioware Function)
|
||||
void Raise(object oPlayer)
|
||||
{
|
||||
effect eVisual = EffectVisualEffect(VFX_IMP_RESTORATION);
|
||||
|
||||
effect eBad = GetFirstEffect(oPlayer);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oPlayer);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oPlayer)), oPlayer);
|
||||
|
||||
//Search for negative effects
|
||||
while(GetIsEffectValid(eBad))
|
||||
{
|
||||
if (GetEffectType(eBad) == EFFECT_TYPE_ABILITY_DECREASE ||
|
||||
GetEffectType(eBad) == EFFECT_TYPE_AC_DECREASE ||
|
||||
GetEffectType(eBad) == EFFECT_TYPE_ATTACK_DECREASE ||
|
||||
GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_DECREASE ||
|
||||
GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_IMMUNITY_DECREASE ||
|
||||
GetEffectType(eBad) == EFFECT_TYPE_SAVING_THROW_DECREASE ||
|
||||
GetEffectType(eBad) == EFFECT_TYPE_SPELL_RESISTANCE_DECREASE ||
|
||||
GetEffectType(eBad) == EFFECT_TYPE_SKILL_DECREASE ||
|
||||
GetEffectType(eBad) == EFFECT_TYPE_BLINDNESS ||
|
||||
GetEffectType(eBad) == EFFECT_TYPE_DEAF ||
|
||||
GetEffectType(eBad) == EFFECT_TYPE_PARALYZE ||
|
||||
GetEffectType(eBad) == EFFECT_TYPE_NEGATIVELEVEL)
|
||||
{
|
||||
//Remove effect if it is negative.
|
||||
RemoveEffect(oPlayer, eBad);
|
||||
}
|
||||
eBad = GetNextEffect(oPlayer);
|
||||
}
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oPlayer, EventSpellCastAt(OBJECT_SELF, SPELL_RESTORATION, FALSE));
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisual, oPlayer);
|
||||
|
||||
object oDeath = GetItemPossessedBy(oPlayer, "death");
|
||||
DestroyObject(oDeath, 0.0f);
|
||||
}
|
Reference in New Issue
Block a user