Files
Amon_PRC8/_module/nss/client_leave_cs.nss
Jaysyn904 8f76c0e5a5 2025/09/24 Update
Updates from @behindflayer
2025-09-24 16:04:25 -04:00

28 lines
993 B
Plaintext

#include "horse_include"
#include "nwnx_webhook"
//:: AmonBot Webhook
const string NWNX_DISCORD_URL = "/api/webhooks/1187525263693725706/oRFVnrx9qq7mxmpwOaslNgaQoaVAchTlK-NGFOHv4_2fJMdl-AIAVfpid8L_Lm3gs3Qq/slack";
void main()
{
//:: Declare Major Variables
object oPC = GetExitingObject();
string sPlayerName = GetName(oPC);
int bNWNxEE = NWNXGetIsAvailable();
GPA_HorseOCL(oPC);
// Mark down how low the player is in hitpoints, and whether or not they are
// in combat when they vanished.
SetLocalInt(GetModule(),"HPOff_"+GetName(oPC),GetMaxHitPoints(oPC) - GetCurrentHitPoints(oPC));
SetLocalInt(GetModule(),"CMBT_"+GetName(oPC),GetIsInCombat(oPC));
object oArea = GetLocalObject(oPC, "leaveArea");
SetLocalInt(oArea, "playerCount", GetLocalInt(oArea, "playerCount") - 1);
//:: AmonBot Player Announce
if (bNWNxEE) NWNX_WebHook_SendWebHookHTTPS("discordapp.com", NWNX_DISCORD_URL, sPlayerName+ " has left the World of Amon.", "AmonBot");
}