Amon_PRC8/_module/nss/editedondeath.nss
Jaysyn904 c5cffc37af Initial Commit
Initial Commit [v1.01]
2025-04-03 19:00:46 -04:00

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));
}