Initial upload
Initial upload. PRC8 has been added. Module compiles, PRC's default AI & treasure scripts have been integrated. Started work on top hak for SLA / Ability / Scripting modifications.
This commit is contained in:
103
_module/nss/jw_unlotrap_use.nss
Normal file
103
_module/nss/jw_unlotrap_use.nss
Normal file
@@ -0,0 +1,103 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Trap door that takes you to a waypoint that
|
||||
//:: is stored into the Destination local string.
|
||||
//:: FileName
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Robert Babiak
|
||||
//:: Created On: June 25, 2002
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
void main()
|
||||
{
|
||||
object oidUser;
|
||||
object oidDest;
|
||||
string sDest;
|
||||
int nGotkey=0;
|
||||
oidUser = GetLastUsedBy();
|
||||
object oKey;
|
||||
|
||||
if (!GetLocked(OBJECT_SELF) )
|
||||
{
|
||||
if ( GetIsOpen(OBJECT_SELF))
|
||||
{
|
||||
|
||||
|
||||
oidUser = GetLastUsedBy();
|
||||
oidDest = GetObjectByTag(GetTag(OBJECT_SELF)+"_wp");
|
||||
|
||||
AssignCommand(oidUser, ActionJumpToObject(oidDest,FALSE));
|
||||
DelayCommand(80.0,PlayAnimation(ANIMATION_PLACEABLE_CLOSE ));
|
||||
} else
|
||||
{
|
||||
PlayAnimation(ANIMATION_PLACEABLE_OPEN );
|
||||
DelayCommand(80.0,ActionDoCommand(PlayAnimation(ANIMATION_PLACEABLE_CLOSE )));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
|
||||
object oInv;
|
||||
|
||||
oInv=GetFirstItemInInventory(oidUser);
|
||||
|
||||
while (GetIsObjectValid(oInv))
|
||||
|
||||
{
|
||||
|
||||
if (GetTag(oInv)==GetLockKeyTag(OBJECT_SELF))
|
||||
{
|
||||
nGotkey=1;
|
||||
oKey=oInv;
|
||||
|
||||
}
|
||||
oInv=GetNextItemInInventory(oidUser);
|
||||
}
|
||||
|
||||
if (nGotkey==0)
|
||||
{
|
||||
|
||||
AssignCommand(oidUser,PlayAnimation(ANIMATION_LOOPING_GET_LOW,1.0,1.0));
|
||||
|
||||
//CreateObject(OBJECT_TYPE_ITEM,"jw_faketrap",GetLocation(OBJECT_SELF));
|
||||
//AssignCommand(oidUser,ActionUnlockObject(GetObjectByTag("jw_faketrap")));
|
||||
//DelayCommand(0.5,DestroyObject(GetObjectByTag("jw_faketrap")));
|
||||
DelayCommand(0.3,PlaySound("as_dr_locked3"));
|
||||
FloatingTextStringOnCreature("*Locked*",oidUser);
|
||||
//DelayCommand(0.3,SpeakString("This trap door is locked"));
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
|
||||
//AssignCommand(oidUser,PlayAnimation(ANIMATION_LOOPING_GET_LOW,1.0,1.0));
|
||||
|
||||
|
||||
SetLocked(OBJECT_SELF,FALSE);
|
||||
AssignCommand(oidUser,PlayAnimation(ANIMATION_LOOPING_GET_LOW,1.0,1.0));
|
||||
SendMessageToPC(oidUser,"You used a key");
|
||||
DelayCommand(0.5,PlayAnimation(ANIMATION_PLACEABLE_OPEN));
|
||||
|
||||
if (GetTag(oKey)=="jw_zraela_key")
|
||||
{
|
||||
DestroyObject(oKey);
|
||||
}
|
||||
|
||||
DelayCommand(80.0,PlayAnimation(ANIMATION_PLACEABLE_CLOSE));
|
||||
DelayCommand(80.0,SetLocked(OBJECT_SELF,TRUE));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user