datablock TriggerData(GravityFlipTrigger)
{
tickPeriodMS = 100;
};
$gravityDir = 1;
function GravityFlipTrigger::onEnterTrigger(%this, %trigger, %obj)
{
if ($gravityDir == 1)
{
setGravityDir("1 0 0 0 1 0 0 0 1");
}
else
{
setGravityDir("1 0 0 0 -1 0 0 0 -1");
}
}
function GravityFlipTrigger::onLeaveTrigger(%this, %trigger, %obj)
{
if ($gravityDir == 1)
{
$gravityDir = -1;
}
else
{
$gravityDir = 1;
}
}

package mismod {
function setGameState(%state)
{
Parent::setGameState(%state);
$gravityDir = 1;
echo ("Called setGameState");
}
};
activatePackage(mismod);
//--- OBJECT WRITE BEGIN ---
new SimGroup(MissionGroup) {

   new ScriptObject(MissionInfo) {
         Time = "0";
         artist = "Dave";
         desc = "The level is rather easy, but can you get the best time?";
         goldTime = "90000";
         level = "4";
         name = "Castle of Inversion";
         startHelpText = "Roll onto the center grid to flip the gravity!";
         type = "Custom";
         ultimateTime = "70000";
   };
   new MissionArea(MissionArea) {
      area = "-360 -648 720 1296";
      flightCeiling = "300";
      flightCeilingRange = "20";
         locked = "true";
   };
   new Sky(Sky) {
      position = "336 136 0";
      rotation = "1 0 0 0";
      scale = "1 1 1";
      cloudHeightPer[0] = "0";
      cloudHeightPer[1] = "0";
      cloudHeightPer[2] = "0";
      cloudSpeed1 = "0.0001";
      cloudSpeed2 = "0.0002";
      cloudSpeed3 = "0.0003";
      visibleDistance = "500";
      useSkyTextures = "1";
      renderBottomTexture = "1";
      SkySolidColor = "0.600000 0.600000 0.600000 1.000000";
      fogDistance = "300";
      fogColor = "0.600000 0.600000 0.600000 1.000000";
      fogVolume1 = "-1 7.45949e-031 1.3684e-038";
      fogVolume2 = "-1 1.07208e-014 8.756e-014";
      fogVolume3 = "-1 5.1012e-010 2.05098e-008";
      materialList = "~/data/skies/Intermediate/Intermediate_Sky.dml";
      windVelocity = "1 0 0";
      windEffectPrecipitation = "0";
      noRenderBans = "1";
      fogVolumeColor1 = "128.000000 128.000000 128.000000 0.000000";
      fogVolumeColor2 = "128.000000 128.000000 128.000000 0.000004";
      fogVolumeColor3 = "128.000000 128.000000 128.000000 14435505.000000";
   };
   new Sun() {
      direction = "0.638261 0.459006 -0.61801";
      color = "1.400000 1.200000 0.400000 1.000000";
      ambient = "0.300000 0.300000 0.400000 1.000000";
   };
   new InteriorInstance() {
      position = "0 0 0";
      rotation = "1 0 0 0";
      scale = "1 1 1";
      interiorFile = "~/data/lbinteriors_custom/mbp/castleofinversion.dif";
      showTerrainInside = "0";
   };
   new Item() {
      position = "13.7876 16.6814 -0.5";
      rotation = "1 0 0 0";
      scale = "1 1 1";
      dataBlock = "TimeTravelItem";
      collideable = "0";
      static = "1";
      rotate = "1";
         skin = "base";
         timeBonus = "12000";
   };
   new StaticShape(StartPoint) {
      position = "0 0 2";
      rotation = "1 0 0 0";
      scale = "1 1 1";
      dataBlock = "StartPad";
   };
   new Item() {
      position = "-32.5 26 1";
      rotation = "1 0 0 0";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-12 26 6";
      rotation = "1 0 0 0";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "0 17 -0.75";
      rotation = "1 0 0 0";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-9 9 2.25";
      rotation = "1 0 0 0";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-7 9 1.75";
      rotation = "1 0 0 0";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-9 7 1.75";
      rotation = "1 0 0 0";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-7 7 1.25";
      rotation = "1 0 0 0";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "0 17 4.25";
      rotation = "1 0 0 0";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-15 4 -0.25";
      rotation = "1 0 0 0";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-25 4 -0.25";
      rotation = "1 0 0 0";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-25 -6 -0.25";
      rotation = "1 0 0 0";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-15 -6 -0.25";
      rotation = "1 0 0 0";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-21 0 -0.25";
      rotation = "1 0 0 0";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-33 20 -0.25";
      rotation = "1 0 0 0";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-33 18 -0.25";
      rotation = "1 0 0 0";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-33 14 0.75";
      rotation = "1 0 0 0";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-29 12 -0.75";
      rotation = "1 0 0 0";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-29 10 -0.25";
      rotation = "1 0 0 0";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-27 12 -0.25";
      rotation = "1 0 0 0";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-27 10 0.25";
      rotation = "1 0 0 0";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-8.875 21 2.57335";
      rotation = "1 0 0 0";
      scale = "1 1 1";
      dataBlock = "TimeTravelItem";
      collideable = "0";
      static = "1";
      rotate = "1";
         skin = "base";
         timeBonus = "2000";
   };
   new Item() {
      position = "-8.875 13 2.625";
      rotation = "1 0 0 0";
      scale = "1 1 1";
      dataBlock = "TimeTravelItem";
      collideable = "0";
      static = "1";
      rotate = "1";
         skin = "base";
         timeBonus = "2000";
   };
   new Item() {
      position = "-28 25 19.7015";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-12 25 19.7213";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-28 9 19.7065";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-12 9 20.2048";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new StaticShape(EndPoint) {
      position = "-6.00485 8.92992 20.2556";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "EndPad";
   };
   new Trigger(Bounds) {
      position = "-59.8163 56.6191 -13.0187";
      rotation = "1 0 0 0";
      scale = "80 80 50";
      dataBlock = "InBoundsTrigger";
      polyhedron = "0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 -1.0000000 0.0000000 0.0000000 0.0000000 1.0000000";
   };
   new Trigger() {
      position = "-21.5741 18.5032 -2.18088";
      rotation = "1 0 0 0";
      scale = "3 3 25";
      dataBlock = "GravityFlipTrigger";
      polyhedron = "0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 -1.0000000 0.0000000 0.0000000 0.0000000 1.0000000";
   };
   new Item() {
      position = "-34.1952 21.0069 15.4281";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "TimeTravelItem";
      collideable = "0";
      static = "1";
      rotate = "1";
         skin = "base";
         timeBonus = "6000";
   };
   new Item() {
      position = "-26.9017 3.93946 20.208";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-22.9074 1.97251 20.193";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-18.9897 4.11675 20.1996";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-2.98221 19.0207 20.2008";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-12.949 16.0497 15.953";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-16.962 0.101797 20.1966";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-10.9418 0.0301077 20.2";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-6.8443 4.14715 20.202";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-32.9577 6.0325 20.201";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-33.9125 11.7603 20.1997";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-33.9386 15.8691 20.2007";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-35.4721 20.9252 20.1965";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-32.9596 30.1757 20.2072";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-22.8999 34.0228 20.2038";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-4.93232 28.057 20.1903";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-6.9679 22.0271 20.1963";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-12.9425 4.05459 19.6593";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "TimeTravelItem";
      collideable = "0";
      static = "1";
      rotate = "1";
         skin = "base";
         timeBonus = "3000";
   };
   new Item() {
      position = "-6.83961 15.7058 19.7203";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "TimeTravelItem";
      collideable = "0";
      static = "1";
      rotate = "1";
         skin = "base";
         timeBonus = "3000";
   };
   new Item() {
      position = "-2.90075 31.9136 19.7398";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "TimeTravelItem";
      collideable = "0";
      static = "1";
      rotate = "1";
         skin = "base";
         timeBonus = "3000";
   };
   new Item() {
      position = "-10.8969 30.1736 19.6646";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "TimeTravelItem";
      collideable = "0";
      static = "1";
      rotate = "1";
         skin = "base";
         timeBonus = "2000";
   };
   new Item() {
      position = "-18.9046 33.9415 19.7365";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "TimePenaltyItem";
      collideable = "0";
      static = "1";
      rotate = "1";
         skin = "base";
         timePenalty = "2000";
   };
   new Item() {
      position = "-32.2051 24.4375 18.0422";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "TimeTravelItem";
      collideable = "0";
      static = "1";
      rotate = "1";
         skin = "base";
         timeBonus = "4000";
   };
   new StaticShape() {
      position = "-43.1771 17.1647 20.2521";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "RoundBumper";
   };
   new Item() {
      position = "-16.9451 27.9967 15.9564";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-6.84958 28.0211 15.9353";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-13.9475 20.9838 15.9498";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-44.6922 17.1179 20.1988";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-44.3673 25.1333 20.2002";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new Item() {
      position = "-48.2923 20.8204 20.2197";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "GemItem";
      collideable = "0";
      static = "1";
      rotate = "1";
   };
   new StaticShape() {
      position = "-41.5273 22.5061 20.2541";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "Nuke";
         resetTime = "Default";
   };
   new StaticShape() {
      position = "-44.7351 22.2507 20.2496";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "Nuke";
         resetTime = "Default";
   };
   new StaticShape() {
      position = "-41.6715 17.9946 20.2548";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "Nuke";
         resetTime = "Default";
   };
   new StaticShape() {
      position = "-47.2583 16.8706 20.2549";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "Nuke";
         resetTime = "Default";
   };
   new StaticShape() {
      position = "-44.3078 19.5898 20.2512";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "Nuke";
         resetTime = "Default";
   };
   new StaticShape() {
      position = "-48.8424 25.7061 20.2499";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "Nuke";
         resetTime = "Default";
   };
   new StaticShape() {
      position = "-46.4184 20.2784 20.0575";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "TriangleBumper";
   };
   new StaticShape() {
      position = "-42.858 24.5169 20.2528";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "Nuke";
         resetTime = "Default";
   };
   new StaticShape() {
      position = "-46.6657 24.0022 20.0498";
      rotation = "0.949236 -0.314566 1.37501e-008 180";
      scale = "1 1 1";
      dataBlock = "TriangleBumper";
   };
   new StaticShape() {
      position = "-43.0471 20.769 20.0478";
      rotation = "0.877582 0.479426 -2.09564e-008 180";
      scale = "1 1 1";
      dataBlock = "TriangleBumper";
   };
   new StaticShape() {
      position = "-41.0091 24.9961 20.0516";
      rotation = "0.707388 0.706825 -3.08963e-008 180";
      scale = "1 1 1";
      dataBlock = "TriangleBumper";
   };
   new StaticShape() {
      position = "-43.1896 25.7714 20.2475";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "RoundBumper";
   };
   new StaticShape() {
      position = "-43.7901 22.6417 20.2514";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "RoundBumper";
   };
   new StaticShape() {
      position = "-40.6245 21.4829 20.2492";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "RoundBumper";
   };
   new StaticShape() {
      position = "-46.9751 22.0153 20.2472";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "RoundBumper";
   };
   new StaticShape() {
      position = "-47.4046 18.4491 20.2472";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "RoundBumper";
   };
   new SimGroup(PathNodeGroup) {

      new StaticShape(CameraPath1) {
         position = "6.85374 -8.25307 16.2134";
         rotation = "0.609311 0.255023 -0.750802 58.2761";
         scale = "1 1 1";
         dataBlock = "PathNode";
            FinalRotOffset = "1 0 0 0";
            RotationMultiplier = "1";
            Smooth = "0";
            SmoothEnd = "0";
            SmoothStart = "0";
            Spline = "1";
            bezier = "0";
            branchNodes = " ";
            delay = "1000";
            nextNode = "CameraPath2";
            placed = "1";
            reverseRotation = "0";
            speed = "0";
            timeToNext = "4000";
            usePosition = "1";
            useRotation = "1";
            useScale = "0";
      };
      new StaticShape(CameraPath2) {
         position = "2.82377 -1.00421 2.61112";
         rotation = "-0.629201 -0.267043 -0.729928 60.3514";
         scale = "1 1 1";
         dataBlock = "PathNode";
            FinalRotOffset = "1 0 0 0";
            RotationMultiplier = "1";
            Smooth = "0";
            SmoothEnd = "0";
            SmoothStart = "0";
            Spline = "0";
            bezier = "0";
            branchNodes = " ";
            delay = "1000";
            nextNode = "CameraPath1";
            placed = "1";
            reverseRotation = "0";
            speed = "0";
            timeToNext = "4000";
            usePosition = "1";
            useRotation = "1";
            useScale = "0";
      };
   };
   new Item() {
      position = "-46.4176 22.7958 19.7448";
      rotation = "1 0 0 180";
      scale = "1 1 1";
      dataBlock = "TimeTravelItem";
      collideable = "0";
      static = "1";
      rotate = "1";
         skin = "base";
         timeBonus = "2500";
   };
};
//--- OBJECT WRITE END ---
