//-----------------------------------------------------------
// This initializes music and spawns some debris around the map and goes away
//Play the default module music track
tmpargument = 0
IfContentIs
  tmpargument = 22
  tmpdistance = 0
  PlayMusic

  //ELVEN WOODS
  tmpargument = rand % 6 + 4        //Two grass types, mushroom and rock
  tmpdistance = 0
  tmpx = rand & 255 - 128
  tmpy = rand & 255 - 128
  tmpx = 54 < 7 + tmpx
  tmpy = 69 < 7 + tmpy
  SpawnExactParticle

  tmpargument = rand % 6 + 4        //Two grass types, mushroom and rock
  tmpx = rand & 255 - 128
  tmpy = rand & 255 - 128
  tmpx = 63 < 7 + tmpx
  tmpy = 65 < 7 + tmpy
  SpawnExactParticle

  tmpargument = rand % 6 + 4        //Two grass types, mushroom and rock
  tmpx = rand & 255 - 128
  tmpy = rand & 255 - 128
  tmpx = 67 < 7 + tmpx
  tmpy = 61 < 7 + tmpy
  SpawnExactParticle
  
  tmpargument = rand % 6 + 4        //Two grass types, mushroom and rock
  tmpx = rand & 255 - 128
  tmpy = rand & 255 - 128
  tmpx = 63 < 7 + tmpx
  tmpy = 55 < 7 + tmpy
  SpawnExactParticle
  
  tmpargument = rand % 6 + 4        //Two grass types, mushroom and rock
  tmpx = rand & 255 - 128
  tmpy = rand & 255 - 128
  tmpx = 67 < 7 + tmpx
  tmpy = 52 < 7 + tmpy
  SpawnExactParticle
  
  tmpargument = rand % 6 + 4        //Two grass types, mushroom and rock
  tmpx = rand & 255 - 128
  tmpy = rand & 255 - 128
  tmpx = 72 < 7 + tmpx
  tmpy = 55 < 7 + tmpy
  SpawnExactParticle
  
  tmpargument = rand % 6 + 4        //Two grass types, mushroom and rock
  tmpx = rand & 255 - 128
  tmpy = rand & 255 - 128
  tmpx = 50 < 7 + tmpx
  tmpy = 72 < 7 + tmpy
  SpawnExactParticle
  
  tmpargument = rand % 6 + 4        //Two grass types, mushroom and rock
  tmpx = rand & 255 - 128
  tmpy = rand & 255 - 128
  tmpx = 76 < 7 + tmpx
  tmpy = 53 < 7 + tmpy
  SpawnExactParticle
  
  tmpargument = rand % 6 + 4        //Two grass types, mushroom and rock
  tmpx = rand & 255 - 128
  tmpy = rand & 255 - 128
  tmpx = 70 < 7 + tmpx
  tmpy = 45 < 7 + tmpy
  SpawnExactParticle
  
  tmpargument = rand % 6 + 4        //Two grass types, mushroom and rock
  tmpx = rand & 255 - 128
  tmpy = rand & 255 - 128
  tmpx = 72 < 7 + tmpx
  tmpy = 42 < 7 + tmpy
  SpawnExactParticle

  tmpargument = rand % 6 + 4        //Two grass types, mushroom and rock
  tmpx = rand & 255 - 128
  tmpy = rand & 255 - 128
  tmpx = 65 < 7 + tmpx
  tmpy = 56 < 7 + tmpy
  SpawnExactParticle
  
  tmpargument = rand % 6 + 4        //Two grass types, mushroom and rock
  tmpx = rand & 255 - 128
  tmpy = rand & 255 - 128
  tmpx = 62 < 7 + tmpx
  tmpy = 61 < 7 + tmpy
  SpawnExactParticle

  tmpargument = rand % 6 + 4        //Two grass types, mushroom and rock
  tmpx = rand & 255 - 128
  tmpy = rand & 255 - 128
  tmpx = 56 < 7 + tmpx
  tmpy = 60 < 7 + tmpy
  SpawnExactParticle

  tmpargument = rand % 6 + 4        //Two grass types, mushroom and rock
  tmpx = rand & 255 - 128
  tmpy = rand & 255 - 128
  tmpx = 51 < 7 + tmpx
  tmpy = 66 < 7 + tmpy
  SpawnExactParticle

  tmpargument = rand % 6 + 4        //Two grass types, mushroom and rock
  tmpx = rand & 255 - 128
  tmpy = rand & 255 - 128
  tmpx = 44 < 7 + tmpx
  tmpy = 73 < 7 + tmpy
  SpawnExactParticle

  //PLAINS OF BISHOPIA
  tmpargument = rand % 4 + 4        //Two grass types, mushroom and rock
  tmpdistance = 0
  tmpx = rand & 255 - 128
  tmpy = rand & 255 - 128
  tmpx = 53 < 7 + tmpx
  tmpy = 45 < 7 + tmpy
  SpawnExactParticle

  tmpargument = rand % 4 + 4        //Two grass types, mushroom and rock
  tmpx = rand & 255 - 128
  tmpy = rand & 255 - 128
  tmpx = 58 < 7 + tmpx
  tmpy = 42 < 7 + tmpy
  SpawnExactParticle

  tmpargument = rand % 4 + 4        //Two grass types, mushroom and rock
  tmpx = rand & 255 - 128
  tmpy = rand & 255 - 128
  tmpx =  57 < 7 + tmpx
  tmpy =  38 < 7 + tmpy
  SpawnExactParticle

  tmpargument = rand % 4 + 4        //Two grass types, mushroom and rock
  tmpx = rand & 255 - 128
  tmpy = rand & 255 - 128
  tmpx =  53 < 7 + tmpx
  tmpy =  40 < 7 + tmpy
  SpawnExactParticle

  tmpargument = rand % 4 + 4        //Two grass types, mushroom and rock
  tmpx = rand & 255 - 128
  tmpy = rand & 255 - 128
  tmpx =  59 < 7 + tmpx
  tmpy =  35 < 7 + tmpy
  SpawnExactParticle

  tmpargument = rand % 4 + 4        //Two grass types, mushroom and rock
  tmpx = rand & 255 - 128
  tmpy = rand & 255 - 128
  tmpx =  66 < 7 + tmpx
  tmpy =  37 < 7 + tmpy
  SpawnExactParticle

  tmpargument = rand % 4 + 4        //Two grass types, mushroom and rock
  tmpx = rand & 255 - 128
  tmpy = rand & 255 - 128
  tmpx =  64 < 7 + tmpx
  tmpy =  44 < 7 + tmpy
  SpawnExactParticle

  tmpargument = rand % 4 + 4        //Two grass types, mushroom and rock
  tmpx = rand & 255 - 128
  tmpy = rand & 255 - 128
  tmpx =  57 < 7 + tmpx
  tmpy =  48 < 7 + tmpy
  SpawnExactParticle

  tmpargument = rand % 4 + 4        //Two grass types, mushroom and rock
  tmpx = rand & 255 - 128
  tmpy = rand & 255 - 128
  tmpx =  54 < 7 + tmpx
  tmpy =  53 < 7 + tmpy
  SpawnExactParticle

  tmpargument = rand % 4 + 4        //Two grass types, mushroom and rock
  tmpx = rand & 255 - 128
  tmpy = rand & 255 - 128
  tmpx =  48 < 7 + tmpx
  tmpy =  59 < 7 + tmpy
  SpawnExactParticle

  tmpargument = rand % 4 + 4        //Two grass types, mushroom and rock
  tmpx = rand & 255 - 128
  tmpy = rand & 255 - 128
  tmpx =  41 < 7 + tmpx
  tmpy =  52 < 7 + tmpy
  SpawnExactParticle

  tmpargument = rand % 4 + 4        //Two grass types, mushroom and rock
  tmpx = rand & 255 - 128
  tmpy = rand & 255 - 128
  tmpx =  36 < 7 + tmpx
  tmpy =  52 < 7 + tmpy
  SpawnExactParticle

  tmpargument = rand % 4 + 4        //Two grass types, mushroom and rock
  tmpx = rand & 255 - 128
  tmpy = rand & 255 - 128
  tmpx =  32 < 7 + tmpx
  tmpy =  52 < 7 + tmpy
  SpawnExactParticle

  tmpargument = rand % 4 + 4        //Two grass types, mushroom and rock
  tmpx = rand & 255 - 128
  tmpy = rand & 255 - 128
  tmpx =  31 < 7 + tmpx
  tmpy =  56 < 7 + tmpy
  SpawnExactParticle

  tmpargument = rand % 4 + 4        //Two grass types, mushroom and rock
  tmpx = rand & 255 - 128
  tmpy = rand & 255 - 128
  tmpx =  37 < 7 + tmpx
  tmpy =  46 < 7 + tmpy
  SpawnExactParticle

  tmpargument = rand % 4 + 4        //Two grass types, mushroom and rock
  tmpx = rand & 255 - 128
  tmpy = rand & 255 - 128
  tmpx =  44 < 7 + tmpx
  tmpy =  45 < 7 + tmpy
  SpawnExactParticle
  
  tmpargument = rand % 4 + 4        //Two grass types, mushroom and rock
  tmpx = rand & 255 - 128
  tmpy = rand & 255 - 128
  tmpx =  48 < 7 + tmpx
  tmpy =  41 < 7 + tmpy
  SpawnExactParticle
  
  tmpargument = rand % 4 + 4        //Two grass types, mushroom and rock
  tmpx = rand & 255 - 128
  tmpy = rand & 255 - 128
  tmpx =  50 < 7 + tmpx
  tmpy =  50 < 7 + tmpy
  SpawnExactParticle

  //THE GREAT DESERT  
  tmpargument = 2        //Skull
  tmpx = rand & 255 - 128
  tmpy = rand & 255 - 128
  tmpx =  24 < 7 + tmpx
  tmpy =  54 < 7 + tmpy
  SpawnExactParticle

  tmpargument = 2        //Skull
  tmpx = rand & 255 - 128
  tmpy = rand & 255 - 128
  tmpx =  22 < 7 + tmpx
  tmpy =  60 < 7 + tmpy
  SpawnExactParticle

  tmpargument = 2        //Skull
  tmpx = rand & 255 - 128
  tmpy = rand & 255 - 128
  tmpx =  14 < 7 + tmpx
  tmpy =  50 < 7 + tmpy
  SpawnExactParticle

  
  //Show the map
  ShowMap
  ShowYouAreHere

  //all done!
  GoPoof

//-----------------------------------------------------------
// This makes it windy and snowy
tmpargument = 1
IfContentIs
  JoinEvilTeam
  
  //Howling wind
  IfTimeOut
    SetTargetToNearestEnemy
    IfTargetIsAPlayer
      tmpx = targetdistance
      tmpy = 128*8
      IfXIsLessThanY
        tmpargument = rand % 4
        PlayFullSound
    Else
      tmpargument = rand % 4
      PlaySound
    tmpargument = rand % 100 + 175
    SetTime
    
  //Snowfall
  tmpargument = selfstate + 1
  SetState
  tmpx = selfstate
  tmpy = 20
  IfXIsMoreThanY
    tmpargument = 0
    tmpx = selfx
    tmpy = selfy
    tmpdistance = 800
    SpawnExactParticle
    SpawnExactParticle
    SpawnExactParticle
    SpawnExactParticle
    SpawnExactParticle
    SetState    

// This spawns some rain
tmpargument = 2
IfContentIs
  JoinEvilTeam
  
  tmpargument = 1
  SetState
  
  //Rain mode
  IfStateIs1
    tmpx = rand % 5
    tmpy = 0
    IfXIsEqualToY
      tmpargument = 9
      tmpx = selfx
      tmpy = selfy
      tmpdistance = 800
      SpawnExactParticle

  //Check for rain
  IfTimeOut
    tmpargument = 1500      //30 seconds
    SetTime
    tmpargument = 0
    tmpx = rand % 100
    tmpy = 25
    IfXIsLessThanY
      tmpargument = 1
    SetState
    
//-----------------------------------------------------------
End					// All done
//-----------------------------------------------------------
