Initial Upload
Initial Upload
This commit is contained in:
38
_module/nss/item_enter_cho.nss
Normal file
38
_module/nss/item_enter_cho.nss
Normal file
@@ -0,0 +1,38 @@
|
||||
void main()
|
||||
{
|
||||
object oClicker = GetClickingObject();
|
||||
object oTarget = GetTransitionTarget(OBJECT_SELF);
|
||||
location lLoc = GetLocation(oTarget);
|
||||
string sKey = "chokey2";
|
||||
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 F.H.O key to access this area.");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user