Amon_PRC8/_module/nss/client_enter_cs.nss

120 lines
3.2 KiB
Plaintext
Raw Permalink Normal View History

2025-04-03 19:00:46 -04:00
/*********************************
** Table Top Variant ruleset
**
** On Client Enter event
**
** This is used with the death-code and the
** rest code.
**
** Written by Jay Barnson, 2002
**
*************************************/
#include "horse_include"
#include "enterinc"
#include "pqj_inc"
#include "nwnx_webhook"
#include "nwnx_player"
2025-04-03 19:00:46 -04:00
#include "inc_examine"
#include "inc_gennui"
//:: AmonBot Webhook
const string NWNX_DISCORD_URL = "/api/webhooks/1187525263693725706/oRFVnrx9qq7mxmpwOaslNgaQoaVAchTlK-NGFOHv4_2fJMdl-AIAVfpid8L_Lm3gs3Qq/slack";
void SetTlkOverrideForMaximumLevel(object oPC);
void SetTlkOverrideForMaximumLevel(object oPC)
{
int nLevel = GetHitDice(oPC);
if (nLevel < 40)
{
NWNX_Player_SetTlkOverride(oPC, 315, "");
}
else
{
NWNX_Player_SetTlkOverride(oPC, 315, "Next Level: " + IntToString((nLevel + 1) * nLevel * 500) + "\n");
}
}
2025-04-03 19:00:46 -04:00
void main()
{
//:: Declare Major Variables
object oPC = GetEnteringObject();
object oAmulet;
object oCorpse;
int hp;
int hpOffset;
int inCombat = 0;
string sPlayerName = GetName(oPC);
location oPCLoc = GetLocation(oPC);
//:: NUI Magic by Daz
//Examine_DisablePanels(oPC);
PrintString(GetObjectUUID(oPC));
//:: AmonBot Player Announce
NWNX_WebHook_SendWebHookHTTPS("discordapp.com", NWNX_DISCORD_URL, sPlayerName+ " has entered the World of Amon.", "AmonBot");
SetLocalInt(oPC,"stables",1);
GPA_HorseOCL(oPC);
//:: Fix XP display for 40+ lvl PCs
SetTlkOverrideForMaximumLevel(oPC);
2025-04-03 19:00:46 -04:00
// Make sure PC isn't set to Plot, for reasons
SetPlotFlag(oPC, FALSE);
// Reset PC size
SetObjectVisualTransform(oPC, OBJECT_VISUAL_TRANSFORM_SCALE, 1.0f);
//:: KillSpells (oPC,oPCLoc);
RebuildJournalQuestEntries(GetEnteringObject());
/* if (GetIsPC(oPC))
{
//:: if hitpoints < 1, bring them up to 1, and kick them back down again
//:: to fire off their "on dying" script.
//:: I THINK this only occurs with server-vault characters.
hp = GetCurrentHitPoints(oPC);
if (hp<1)
{
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(1-hp),oPC);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(-(hp-1)),oPC);
}
else
{
hpOffset = GetLocalInt(GetModule(),"HPOff_"+GetName(oPC));
if (hpOffset>0)
{
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDamage(hpOffset),oPC);
}
}
//:: If they were in-combat, do some ADDITIONAL damage to them
//:: (1d4 damage per level of the character).
inCombat = GetLocalInt(GetModule(),"CMBT_"+GetName(oPC));
if (inCombat)
{
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDamage(d4(GetHitDice(oPC))),oPC);
}
}
//:: Set LastTimeRested = current time - 9 minutes
//:: (give them 1 minute of "wait time", to limit the exploits
//:: with exiting & returning...)
if (!inCombat)
SetLocalInt(oPC,"LastTimeRested",GetLocalInt(GetModule(),"SecondCount")-540);
else // They have to wait the full amount if they left in mid-combat.
SetLocalInt(oPC,"LastTimeRested",GetLocalInt(GetModule(),"SecondCount")); */
AddJournalQuestEntry("JRNL_XPCHART", 1, oPC, FALSE, FALSE, FALSE);
AddJournalQuestEntry("JRNL_LA_BUYOFF", 1, oPC, FALSE, FALSE, FALSE);
AddJournalQuestEntry("JRNL_PRC8", 1, oPC, FALSE, FALSE, FALSE);
}