2024-09-14 13:52:39 -04:00
// Place in the OnFailToOpen event for the <span class="highlight">door</span>
2024-06-14 10:48:20 -04:00
void main()
{
2024-09-14 13:52:39 -04:00
object oPC = GetClickingObject();
int nPCClass1 = GetClassByPosition(1, oPC);
int nPCClass2 = GetClassByPosition(2, oPC);
int nPCClass3 = GetClassByPosition(3, oPC);
int nCheck1 = CLASS_TYPE_ROGUE;
int nCheck2 = CLASS_TYPE_ASSASSIN;
if (!GetIsPC(oPC))
2024-06-14 10:48:20 -04:00
{
2024-09-14 13:52:39 -04:00
return;
2024-06-14 10:48:20 -04:00
}
2024-09-14 13:52:39 -04:00
else if ((nPCClass1 == nCheck1) || (nPCClass2 == nCheck1) || (nPCClass3 == nCheck1) || (nPCClass1 == nCheck2) || (nPCClass2 == nCheck2) || (nPCClass3 == nCheck2))
2024-06-14 10:48:20 -04:00
{
2024-09-14 13:52:39 -04:00
//FloatingTextStringOnCreature("The <span class="highlight">door</span> unlocks itself and opens.", oPC);
SetLocked(OBJECT_SELF, FALSE);
ActionOpenDoor(OBJECT_SELF);
DelayCommand(6.0f, ActionCloseDoor(OBJECT_SELF));
DelayCommand(6.2f, SetLocked(OBJECT_SELF, TRUE));
2024-06-14 10:48:20 -04:00
}
2024-09-14 13:52:39 -04:00
else
2024-06-14 10:48:20 -04:00
{
2024-09-14 13:52:39 -04:00
//FloatingTextStringOnCreature("The <span class="highlight">door</span> is locked. You must be a Rogue or Assassin to use this <span class="highlight">door</span>.", oPC);
2024-06-14 10:48:20 -04:00
}
2024-09-14 13:52:39 -04:00
}