Sunteți pe pagina 1din 3

//File name: bmp_trig_door_en

//Created by: Shawn Lucas


//Created on: February 17, 2008

/*This script should go in each door trigger's OnEnter tab. It allows certain
doors to be opened by specific NPCs. The PC must position the correct NPC within
the trigger next to the door, which will unlock & open the door.*/

void main()
{
//Defines entering object.
object oPC = GetEnteringObject();

//Defines NPCs.
object oRed = GetObjectByTag("RED_NPC");
object oBlue = GetObjectByTag("BLUE_NPC");
object oGreen = GetObjectByTag("GREEN_NPC");
object oCyan = GetObjectByTag("CYAN_NPC");
object oYellow = GetObjectByTag("YELLOW_NPC");
object oMagenta = GetObjectByTag("MAGENTA_NPC");

//Defines doors that entering NPCs unlock & open.


object oDoor;
object oRedDoor01 = GetObjectByTag("DT_RED_DOOR_01");
object oRedDoor02 = GetObjectByTag("DT_RED_DOOR_02");
object oRedDoor03 = GetObjectByTag("DT_RED_DOOR_03");
object oBlueDoor = GetObjectByTag("DT_BLUE_DOOR");
object oGreenDoor = GetObjectByTag("DT_GREEN_DOOR");
object oCyanDoor = GetObjectByTag("DT_CYAN_DOOR");
object oYellowDoor = GetObjectByTag("DT_YELLOW_DOOR");
object oMagentaDoor = GetObjectByTag("DT_MAGENTA_DOOR");

//If it's red trigger 01.


if(GetTag(OBJECT_SELF) == "TT_RED_DOOR_01")
{
//Check entering object is Red NPC.
if(oPC == oRed)

//Set value.
oDoor = oRedDoor01;
}

//If it's red trigger 02.


else if(GetTag(OBJECT_SELF) == "TT_RED_DOOR_02")
{
//Check entering object is Red NPC.
if(oPC == oRed)

//Set value.
oDoor = oRedDoor02;
}

//If it's red trigger 03.


else if(GetTag(OBJECT_SELF) == "TT_RED_DOOR_03")
{
//Check entering object is Red NPC.
if(oPC == oRed)

//Set value.
oDoor = oRedDoor03;
}

//If it's blue trigger.


else if(GetTag(OBJECT_SELF) == "TT_BLUE_DOOR")
{
//Check entering object is Blue NPC.
if(oPC == oBlue)

//Set value.
oDoor = oBlueDoor;
}

//If it's green trigger.


else if(GetTag(OBJECT_SELF) == "TT_GREEN_DOOR")
{
//Check entering object is Green NPC.
if(oPC == oGreen)

//Set value.
oDoor = oGreenDoor;
}

//If it's cyan trigger.


else if(GetTag(OBJECT_SELF) == "TT_CYAN_DOOR")
{
//Check entering object is Cyan NPC.
if(oPC == oCyan)

//Set value.
oDoor = oCyanDoor;
}

//If it's yellow trigger.


else if(GetTag(OBJECT_SELF) == "TT_YELLOW_DOOR")
{
//Check entering object is Yellow NPC.
if(oPC == oYellow)

//Set value.
oDoor = oYellowDoor;
}

//If it's magenta trigger.


else if(GetTag(OBJECT_SELF) == "TT_MAGENTA_DOOR")
{
//Check entering object is Magenta NPC.
if(oPC == oMagenta)

//Set value.
oDoor = oMagentaDoor;
}
//Unlock & open correct door.
AssignCommand(oDoor, ActionUnlockObject(oDoor));
AssignCommand(oDoor, ActionOpenDoor(oDoor));
}

S-ar putea să vă placă și