Aantioch_Infernum/_module/nss/chk_item_ent_gso.nss
Jaysyn904 22947ad4b6 Initial Upload
Initial Upload
2023-08-08 16:22:17 -04:00

39 lines
1.3 KiB
Plaintext

void main()
{
object oClicker = GetClickingObject();
object oTarget = GetTransitionTarget(OBJECT_SELF);
location lLoc = GetLocation(oTarget);
string sKey = "MG_tdskey";
object firstItemInInv;
object currentItemInInv;
firstItemInInv = GetFirstItemInInventory(oClicker);
currentItemInInv = firstItemInInv;
SetLocalInt(OBJECT_SELF, "KEY_CHECK", FALSE);
// Insure they have at least one object
if(currentItemInInv != OBJECT_INVALID)
{
do
{
string sItem = GetTag(currentItemInInv); // get the tag of the Item
string s1 = GetStringLeft(sItem, 9); // get the first 9 chartacters
if(s1 == sKey)
{
SetLocalInt(OBJECT_SELF, "KEY_CHECK", TRUE); // Set Local Int to True
}
// get next item
currentItemInInv = GetNextItemInInventory(oClicker);
// loop while we have a new item to check
}while(currentItemInInv != OBJECT_INVALID &&
currentItemInInv != firstItemInInv);
}
if (GetLocalInt(OBJECT_SELF, "KEY_CHECK") == 1)
{
AssignCommand(oClicker,JumpToLocation(lLoc));
}
else
{
SpeakString( "You need to have the G.S.O Guild key to access this area.");
}
}