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:
91
_module/nss/jw_ashiatrap_use.nss
Normal file
91
_module/nss/jw_ashiatrap_use.nss
Normal file
@@ -0,0 +1,91 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: 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();
|
||||
|
||||
if (!GetLocked(OBJECT_SELF) )
|
||||
{
|
||||
if ( GetIsOpen(OBJECT_SELF))
|
||||
{
|
||||
|
||||
|
||||
oidUser = GetLastUsedBy();
|
||||
oidDest = GetObjectByTag("WP_jw_aisha_frombelow");
|
||||
|
||||
AssignCommand(oidUser, ActionJumpToObject(oidDest,FALSE));
|
||||
PlayAnimation(ANIMATION_PLACEABLE_CLOSE );
|
||||
} else
|
||||
{
|
||||
PlayAnimation(ANIMATION_PLACEABLE_OPEN );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
object oInv;
|
||||
|
||||
oInv=GetFirstItemInInventory(oidUser);
|
||||
|
||||
while (GetIsObjectValid(oInv))
|
||||
|
||||
{
|
||||
|
||||
if (GetTag(oInv)=="jw_aisha_key")
|
||||
{
|
||||
nGotkey=1;
|
||||
|
||||
}
|
||||
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,SoundObjectPlay(GetObjectByTag("jw_locked_snd")));
|
||||
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));
|
||||
|
||||
DelayCommand(10.0,PlayAnimation(ANIMATION_PLACEABLE_CLOSE));
|
||||
DelayCommand(10.0,SetLocked(OBJECT_SELF,TRUE));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user