195 lines
6.9 KiB
Plaintext
195 lines
6.9 KiB
Plaintext
//::///////////////////////////////////////////////
|
|
//:: Death Script
|
|
//:: NW_O0_DEATH.NSS
|
|
//:: Copyright (c) 2001 Bioware Corp.
|
|
//:://////////////////////////////////////////////
|
|
/*
|
|
This script handles the default behavior
|
|
that occurs when a player dies.
|
|
|
|
BK: October 8 2002: Overriden for Expansion
|
|
*/
|
|
//:://////////////////////////////////////////////
|
|
//:: Created By: Brent Knowles
|
|
//:: Created On: November 6, 2001
|
|
//::
|
|
//::
|
|
//::
|
|
//::
|
|
//:://////////////////////////////////////////////
|
|
#include "x0_i0_campaign"
|
|
#include "prc_inc_racial"
|
|
#include "prc_inc_template"
|
|
|
|
|
|
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.
|
|
if(GetEffectSubType(eBad) != SUBTYPE_SUPERNATURAL)
|
|
{
|
|
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);
|
|
}
|
|
|
|
void main()
|
|
{
|
|
|
|
object oPlayer = GetLastPlayerDied();
|
|
// * increment global tracking number of times that I died
|
|
SetLocalInt(oPlayer, "NW_L_PLAYER_DIED", GetLocalInt(oPlayer, "NW_L_PLAYER_DIED") + 1);
|
|
|
|
|
|
|
|
|
|
// This section removes any quest items they may have had. This is a penalty for dying and
|
|
// not finishing the quest. They will have to redo the quest.
|
|
{
|
|
ExecuteScript("death_qst_item", oPlayer);
|
|
ExecuteScript("death_qst_item", oPlayer);
|
|
ExecuteScript("death_qst_item", oPlayer);
|
|
ExecuteScript("death_qst_item", oPlayer);
|
|
}
|
|
|
|
|
|
// * Handle Spirit of the Wood Death
|
|
string sArea = GetTag(GetArea(oPlayer));
|
|
|
|
if (sArea == "TheArena" )
|
|
|
|
{
|
|
int bValid;
|
|
|
|
DelayCommand(2.0 , Raise(oPlayer)); // Raise(oPlayer);
|
|
/* string sDestTag = "arena_island";
|
|
object oSpawnPoint = GetObjectByTag(sDestTag);
|
|
AssignCommand(oPlayer,JumpToLocation(GetLocation(oSpawnPoint))); */
|
|
return;
|
|
}
|
|
|
|
|
|
if (sArea == "TheArenaDevs" )
|
|
{
|
|
int bValid;
|
|
|
|
DelayCommand(2.0 , Raise(oPlayer));
|
|
/* string sDestTag = "Valleyarena";
|
|
object oSpawnPoint = GetObjectByTag(sDestTag);
|
|
AssignCommand(oPlayer,JumpToLocation(GetLocation(oSpawnPoint))); */
|
|
return;
|
|
}
|
|
|
|
|
|
// * make friendly to Each of the 3 common factions moved script close from line 140 to here >>>> */
|
|
AssignCommand(oPlayer, ClearAllActions());
|
|
|
|
|
|
// * Note: waiting for Sophia to make SetStandardFactionReptation to clear all personal reputation
|
|
|
|
int iRace = GetRacialType(oPlayer);
|
|
|
|
//string subrace = GetStringLowerCase(GetSubRace(oPlayer));
|
|
|
|
if(MyPRCGetRacialType(oPlayer) != RACIAL_TYPE_UNDEAD &&
|
|
MyPRCGetRacialType(oPlayer) != RACIAL_TYPE_HUMANOID_GOBLINOID &&
|
|
MyPRCGetRacialType(oPlayer) != RACIAL_TYPE_HUMANOID_ORC &&
|
|
iRace != RACIAL_TYPE_DROW_FEMALE &&
|
|
iRace != RACIAL_TYPE_DROW_MALE &&
|
|
iRace != RACIAL_TYPE_GNOLL &&
|
|
iRace != RACIAL_TYPE_TROLL &&
|
|
iRace != RACIAL_TYPE_FERAL_GARGUN &&
|
|
iRace != RACIAL_TYPE_HAGSPAWN &&
|
|
iRace != RACIAL_TYPE_TAER &&
|
|
iRace != RACIAL_TYPE_FLIND &&
|
|
iRace != RACIAL_TYPE_OGRE &&
|
|
iRace != RACIAL_TYPE_ILLITHID &&
|
|
iRace != RACIAL_TYPE_MINOTAUR &&
|
|
iRace != RACIAL_TYPE_HALFOGRE)
|
|
/* if(subrace != "drow"
|
|
&& subrace != "vampire"
|
|
&& subrace != "giant-hill"
|
|
&& subrace != "ogre"
|
|
&& subrace != "ogre-mage"
|
|
&& subrace != "goblin"
|
|
&& subrace != "lich"
|
|
&& subrace != "eyeball"
|
|
&& subrace != "illithid"
|
|
&& subrace != "gnoll") */
|
|
{
|
|
if (GetStandardFactionReputation(STANDARD_FACTION_COMMONER, oPlayer) <= 10)
|
|
{ SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad
|
|
SetStandardFactionReputation(STANDARD_FACTION_COMMONER, 80, oPlayer);
|
|
}
|
|
if (GetStandardFactionReputation(STANDARD_FACTION_MERCHANT, oPlayer) <= 10)
|
|
{ SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad
|
|
SetStandardFactionReputation(STANDARD_FACTION_MERCHANT, 80, oPlayer);
|
|
}
|
|
if (GetStandardFactionReputation(STANDARD_FACTION_DEFENDER, oPlayer) <= 10)
|
|
{ SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad
|
|
SetStandardFactionReputation(STANDARD_FACTION_DEFENDER, 80, oPlayer);
|
|
}
|
|
}
|
|
|
|
if( MyPRCGetRacialType(OBJECT_SELF) == RACIAL_TYPE_UNDEAD &&
|
|
GetHasTemplate(TEMPLATE_ARCHLICH, OBJECT_SELF) == FALSE ||
|
|
GetLevelByClass(CLASS_TYPE_BAELNORN, OBJECT_SELF) == FALSE )
|
|
{
|
|
if (GetStandardFactionReputation(STANDARD_FACTION_COMMONER, oPlayer) <= 10)
|
|
{ SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad
|
|
SetStandardFactionReputation(STANDARD_FACTION_COMMONER, 80, oPlayer);
|
|
}
|
|
if (GetStandardFactionReputation(STANDARD_FACTION_MERCHANT, oPlayer) <= 10)
|
|
{ SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad
|
|
SetStandardFactionReputation(STANDARD_FACTION_MERCHANT, 80, oPlayer);
|
|
}
|
|
if (GetStandardFactionReputation(STANDARD_FACTION_DEFENDER, oPlayer) <= 10)
|
|
{ SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad
|
|
SetStandardFactionReputation(STANDARD_FACTION_DEFENDER, 80, oPlayer);
|
|
}
|
|
}
|
|
|
|
SetCampaignDBInt(oPlayer, "PLAYERHASDIED", TRUE);
|
|
|
|
|
|
ExecuteScript("s_pc_death", oPlayer);
|
|
|
|
{
|
|
object oHench = GetHenchman(oPlayer);
|
|
if (GetTag(oHench) == "RHUN_SUDEMON"){
|
|
ApplyEffectAtLocation(DURATION_TYPE_PERMANENT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oHench));
|
|
AssignCommand(oHench, SetIsDestroyable(TRUE));
|
|
DelayCommand(0.0 , DestroyObject(oHench));}
|
|
else {
|
|
//Do Nothing
|
|
}
|
|
}
|
|
|
|
}
|