RATDOG/_module/nss/sc_ck_ghoulchst.nss

31 lines
1.0 KiB
Plaintext
Raw Permalink Normal View History

int StartingConditional()
{
object oPC = GetPCSpeaker();
object oSelf = OBJECT_SELF;
string sPlacableTag = GetTag(OBJECT_SELF);
int nPlayerSearched = GetLocalInt(oPC, "PlayerSearched_" + sPlacableTag); // Unique flag for each player
int nBeenLooted2 = GetLocalInt(oSelf, "BeenLooted2_" + sPlacableTag);
// Check if the player has already attempted searching this placable
if (nPlayerSearched == 1 || nBeenLooted2 == 1)
{
return FALSE;
}
// Check if the player's search skill check is successful against DC 20
if (GetIsSkillSuccessful(oPC, SKILL_SEARCH, 20))
{
// Set the flag on the player to ensure it's only run once per player
SetLocalInt(oPC, "PlayerSearched_" + sPlacableTag, 1);
return TRUE; // Condition met, continue with the conversation
}
else
{
// Set the flag on the player to ensure it's only run once per player
SetLocalInt(oPC, "PlayerSearched_" + sPlacableTag, 1);
return FALSE;
}
}