//::///////////////////////////////////////////////
//:: Death Script
//:: NW_O0_DEATH.NSS
//:: Copyright © 2008 Bioware Corp.
//:://////////////////////////////////////////////
/*
This script handles the default behavior
that occurs when a player dies.
BK: October 8 2002: Overriden for Expansion
Deva Winblood: April 21th, 2008: Modified to
handle dismounts when PC dies while mounted.
*/
//:://////////////////////////////////////////////
//:: Created By: Brent Knowles
//:: Created On: November 6, 2001
//:://////////////////////////////////////////////
#include "x3_inc_horse"
/*
void ClearAllFactionMembers(object oMember, object oPlayer)
{
// AssignCommand(oMember, SpeakString("here"));
AdjustReputation(oPlayer, oMember, 100);
SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad
object oClear = GetFirstFactionMember(oMember, FALSE);
while (GetIsObjectValid(oClear) == TRUE)
{
ClearPersonalReputation(oPlayer, oClear);
oClear = GetNextFactionMember(oMember, FALSE);
}
} */
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);
}
///////////////////////////////////////////////////////////////[ MAIN ]/////////
void main()
{
//Information Gathering
object oPlayer = GetLastPlayerDied();
int iCurrentHour = GetTimeHour();
int iCurrentMinute = GetTimeMinute();
int iCurrentSecond = GetTimeSecond();
int iCurrentMilli = GetTimeMillisecond();
//Fade To Black
ActionDoCommand(FadeToBlack(oPlayer, FADE_SPEED_MEDIUM));
//Clear surrounding hostiles
//Advance CLock
SetTime(8 + iCurrentHour, 0 + iCurrentMinute, 0 + iCurrentSecond, 0 + iCurrentMilli);
//Raise the dead
Raise (oPlayer);
//Fade From Black
ActionDoCommand(FadeFromBlack(oPlayer, FADE_SPEED_MEDIUM));
}
This is my death script.
I'm trying to figure out a way to destroy hostile objects that surround a player, without destroying all hostile objects in an entire area or without having to use triggers, using the same radius that 'can't rest when hostile creature's are near' scheme.
My OnDying script I am utterly cluess on how how to begin.
I want to have a player character stay in the OnDying stage (preferablly at 0HP, or -1HP) until all Henchman fall. If Henchman win the battle, then the player character survives and comes back from 'unconsciousness'. If not, then he dies and the above script kicks in.
I also want the reverse to be true for Henchman.
Unfortunately, without a good working knowledge of script functions I am a little lost on how to proceed =/ Can anyone help?