44 lines
1.6 KiB
Plaintext
44 lines
1.6 KiB
Plaintext
//:://////////////////////////////////////////////
|
|
//:: Name: OnPlayerDeath
|
|
//:: FileName: js_onplayerdeath
|
|
//:://////////////////////////////////////////////
|
|
/*
|
|
When a PC dies the GUI automatically pops up,
|
|
and we have to clear all the actions and delay
|
|
it so we can set local int of HPs and string.
|
|
*/
|
|
//:://////////////////////////////////////////////
|
|
//:: Created By: SPBTooL
|
|
//:: Created By: Jer Wolfe
|
|
//::
|
|
//:: Created On: Aug 04, 2002
|
|
//:://////////////////////////////////////////////
|
|
#include "js_include"
|
|
|
|
void main()
|
|
{
|
|
object oPC = GetLastPlayerDied();
|
|
AssignCommand(oPC, ClearAllActions());
|
|
location lWhereDied = GetLocation(oPC);
|
|
|
|
|
|
// * make friendly to Each of the 3 common factions
|
|
// * Note: waiting for Sophia to make SetStandardFactionReptuation to clear all personal reputation
|
|
if (GetStandardFactionReputation(STANDARD_FACTION_COMMONER, oPC) <= 10)
|
|
{ SetLocalInt(oPC, "NW_G_Playerhasbeenbad", 10); // * Player bad
|
|
SetStandardFactionReputation(STANDARD_FACTION_COMMONER, 80, oPC);
|
|
}
|
|
if (GetStandardFactionReputation(STANDARD_FACTION_MERCHANT, oPC) <= 10)
|
|
{ SetLocalInt(oPC, "NW_G_Playerhasbeenbad", 10); // * Player bad
|
|
SetStandardFactionReputation(STANDARD_FACTION_MERCHANT, 80, oPC);
|
|
}
|
|
if (GetStandardFactionReputation(STANDARD_FACTION_DEFENDER, oPC) <= 10)
|
|
{ SetLocalInt(oPC, "NW_G_Playerhasbeenbad", 10); // * Player bad
|
|
SetStandardFactionReputation(STANDARD_FACTION_DEFENDER, 80, oPC);
|
|
}
|
|
|
|
//SetLocalInt(oPCCorpse, "PCCorpse" + GetName(oPC), 1);
|
|
DelayCommand(2.5, PopUpDeathGUIPanel(oPC, TRUE, TRUE, 0, sDeathGUIMessage));
|
|
}
|
|
|