Ancordia_PRC8/_module/nss/sfpb_used.nss
Jaysyn904 102ba7dab6 Initial Commit
Initial Commit
2023-09-21 19:51:32 -04:00

50 lines
1.6 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Scarface's Persistent Banking
//:: sfpb_used
//:://////////////////////////////////////////////
/*
Written By Scarface
*/
//////////////////////////////////////////////////
#include "sfpb_config"
#include "x4_inc_functions"
void main()
{
// Vars
object oPC = GetLastUsedBy();
object oChest = OBJECT_SELF;
string sID = SF_GetPlayerID(oPC);
string sUserID = GetLocalString(oChest, "USER_ID");
string sModName = CharacterDB(oPC);
int nLocker = GetCampaignInt(CharacterDB(oPC), "LOCKER");
if (nLocker == 0)
{
FloatingTextStringOnCreature("You have not bought access to the private locker!", oPC);
AssignCommand(oPC, ClearAllActions());
SetCutsceneMode(oPC, TRUE);
AssignCommand(oPC, ActionMoveAwayFromObject(oChest, TRUE, 50.0));
DelayCommand(5.0, SetCutsceneMode(oPC, FALSE));
return;
}
// End script if any of these conditions are met
if (!GetIsPC(oPC) ||
GetIsDM(oPC) ||
GetIsDMPossessed(oPC) ||
GetIsPossessedFamiliar(oPC)) return;
// If the chest is already in use then this must be a thief
if (sUserID != "" && sUserID != sID)
{
AssignCommand(oPC, ClearAllActions());
SetCutsceneMode(oPC, TRUE);
AssignCommand(oPC, ActionMoveAwayFromObject(oChest, TRUE, 50.0));
FloatingTextStringOnCreature("Stop, thief!", oPC);
SendMessageToAllDMs(GetName(oPC) + " is trying to steal from a bank " +
"chest that is already in use.");
DelayCommand(5.0, SetCutsceneMode(oPC, FALSE));
}
}