50 lines
1.9 KiB
Plaintext
50 lines
1.9 KiB
Plaintext
// Create LandGate shafts based on trigger activation
|
|
void main()
|
|
{
|
|
int iShaft = 1;
|
|
string sShaft = "";
|
|
string sColor = "";
|
|
string sLandGateCode = "";
|
|
string sLandGate = GetTag(OBJECT_SELF);
|
|
object oEntering = GetEnteringObject();
|
|
AssignCommand(oEntering, PlaySound("as_mg_telepin1"));
|
|
while (iShaft <= 3)
|
|
{
|
|
// Cycle for 3 Shafts
|
|
if (iShaft == 1)
|
|
sShaft = GetSubString(sLandGate, 8, 1);
|
|
if (iShaft == 2)
|
|
sShaft = GetSubString(sLandGate, 9,1);
|
|
if (iShaft == 3)
|
|
sShaft = GetSubString(sLandGate, 10,1);
|
|
// Determine Shaft Color based on trigger variables
|
|
if (sShaft == "B") // blue
|
|
sColor = "zep_lightshft001";
|
|
if (sShaft == "C") // cyan
|
|
sColor = "zep_lightshft002";
|
|
if (sShaft == "G") // green
|
|
sColor = "zep_lightshft003";
|
|
if (sShaft == "O") // orange
|
|
sColor = "zep_lightshft004";
|
|
if (sShaft == "P") // purple
|
|
sColor = "zep_lightshft005";
|
|
if (sShaft == "R") // red
|
|
sColor = "zep_lightshft006";
|
|
if (sShaft == "W") // white
|
|
sColor = "zep_lightshft007";
|
|
if (sShaft == "Y") // yellow
|
|
sColor = "zep_lightshft008";
|
|
sLandGateCode = sLandGateCode + sShaft;
|
|
CreateObject(OBJECT_TYPE_PLACEABLE, sColor, GetLocation(GetNearestObjectByTag("LandGateShaftSource" + IntToString(iShaft))), FALSE, "LandGateShaftColor" + IntToString(iShaft));
|
|
iShaft ++;
|
|
}
|
|
string sLandGateNote = "LandGateNote" + sLandGateCode;
|
|
// AssignCommand(oEntering, SpeakString(sLandGateNote));
|
|
SetLocalString(oEntering, "CurrentLandGate", sLandGateNote);
|
|
if (GetItemPossessedBy(oEntering, sLandGateNote) == OBJECT_INVALID)
|
|
{
|
|
AssignCommand(oEntering, ClearAllActions());
|
|
BeginConversation("lg_learn", oEntering);
|
|
}
|
|
}
|