Alangara_PRC8/_module/nss/rose_check_cancs.nss
Jaysyn904 86feb9ca6f Initial commit
Initial commit.
2024-06-05 21:21:06 -04:00

32 lines
1.0 KiB
Plaintext

#include "zep_inc_craft"
int StartingConditional() {
object oPC = GetPCSpeaker();
object oShield = GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oPC);
if (!GetIsObjectValid(oShield) || !ZEP_GetIsShield(oShield))
return FALSE;
if (GetIsDM(oPC)) return TRUE;
string sRequired = "ZEP_CR_SHIELD";
object oNPC = GetLocalObject(oPC, "ZEP_CR_NPC");
if (GetIsObjectValid(oNPC)) {
if (GetLocalInt(oNPC, sRequired) == 1)
return TRUE;
else return FALSE;
} else if (ZEP_CR_REQUIRE_PLACEABLE) {
int i=1;
object oPlaceable = GetNearestObjectByTag(ZEP_CR_PLACEABLE_TAG, oPC, 1);
while (GetIsObjectValid(oPlaceable) && GetArea(oPC) == GetArea(oPlaceable)
&& GetDistanceBetween(oPC, oPlaceable) <= ZEP_CR_REQUIRED_DISTANCE) {
if (GetLocalInt(oPlaceable, sRequired) == 1)
return TRUE;
oPlaceable = GetNearestObjectByTag(ZEP_CR_PLACEABLE_TAG, oPC, ++i);
}
return FALSE;
}
return TRUE;
}