//:: Created On: 2003-09-10 //::////////////////////////////////////////////// //modified by Blasco-Yang //filename: bh_redcont_ou void main() { object oPC; oPC=GetLastUsedBy(); object oBlue = GetObjectByTag("BH_BlueControl"); object oYellow = GetObjectByTag("BH_YellowControl"); object oGreen = GetObjectByTag("BH_GreenControl"); object oRed = GetObjectByTag("BH_RedControl"); // * note that nActive == 1 does not necessarily mean the placeable is active // * that depends on the initial state of the object int nActive = GetLocalInt (OBJECT_SELF,"X2_L_PLC_ACTIVATED_STATE"); // * Play Appropriate Animation int nTrigsActive = GetLocalInt(oPC,"nColorTrigsActivated"); if (!nActive && nTrigsActive == 3) { ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE); SetLocalInt(oPC,"nColorTrigsActivated",4); FloatingTextStringOnCreature(" Red powered up!",oPC); PlaySound("al_mg_crystalev1"); return; } else { ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE); AssignCommand(oBlue,ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE)); AssignCommand(oYellow,ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE)); AssignCommand(oGreen,ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE)); SetLocalInt(oPC,"nColorTrigsActivated",0); FloatingTextStringOnCreature(" Red powered down!",oPC); } // * Store New State SetLocalInt(OBJECT_SELF,"X2_L_PLC_ACTIVATED_STATE",!nActive); SetLocalInt(oBlue,"X2_L_PLC_ACTIVATED_STATE",!nActive); SetLocalInt(oYellow,"X2_L_PLC_ACTIVATED_STATE",!nActive); SetLocalInt(oGreen,"X2_L_PLC_ACTIVATED_STATE",!nActive); }