//This object is a tool controlled by setting its content value to a specified number.
//(Set in spawn.txt). Object is module specified and must be modified to be used
//elsewhere...
//Content commands:
//0 = drop items
//1 = create ambush <---- Not finished
//2 = show map
//3 = Spawn random magical item
//4 = Spawn random divine spell

//Module Setting: Bishopia Module

//------------------------------------------------------------------------------------
//Drop items held
tmpargument = 0
IfContentIs
  IfSpawned
    tmpargument = 80
    SetTime
  IfTimeOut
    DropItems
    GoPoof

  //DEBUG
  tmpargument = 1
  tmpdistance = 0
  PlayMusic
  //DEBUG END

  ShowMap
  ShowYouAreHere

//------------------------------------------------------------------------------------
//Display the map and play music
tmpargument = 2
IfContentIs
  ShowMap
  ShowYouAreHere
  tmpargument = 1
  tmpdistance = 0
  PlayMusic

  //Do last
  GoPoof

//------------------------------------------------------------------------------------
//Create some random magic stuff
tmpargument = 3
IfContentIs
  tmpargument = rand % 13		  //Randomize drop
  SetState

  tmpx = selfx
  tmpy = selfy
  tmpdistance = 0

 //Mana Potion			//(Thrice for 3X chance)
  IfStateIs0
    tmpargument = 72

  //Orbstorm wand
  IfStateIs1
    tmpargument = 117

  //Fireballwand
  IfStateIs2
    tmpargument = 72

  //Identify Scroll		//(Twice for 2X chance)
  IfStateIs3
    tmpargument = 88

 //Mana Potion			//(Thrice for 3X chance)
  IfStateIs4
    tmpargument = 72

  //Identify Scroll		//(Twice for 2X chance)
  IfStateIs5
    tmpargument = 88

 //Mana Potion			//(Thrice for 3X chance)
  IfStateIs6
    tmpargument = 72

 //Iceball wand
  IfStateIs7
    tmpargument = 116

 //Lightning wand
  IfStateIs8
    tmpargument = 114

 //Missile wand
  IfStateIs9
    tmpargument = 121		//(Twice for 2X chance)

 //Missile wand
  IfStateIs10
    tmpargument = 121		//(Twice for 2X chance)

 //Levitation Shoes
  IfStateIs11
    tmpargument = 147

  //Truesight Scroll
  IfStateIs12
    tmpargument = 140

  SpawnExactCharacterXYZ

  //Do last
  GoPoof

//------------------------------------------------------------------------------------
//Create some random divine shop stuff
tmpargument = 4
IfContentIs
  tmpargument = rand % 14		  //Randomize drop
  SetState

  tmpx = selfx
  tmpy = selfy
  tmpdistance = 0

 //Ressurection Spell
  IfStateIs0
    tmpargument = 63

  //Combat Bless
  IfStateIs1
    tmpargument = 115

  //Fireward
  IfStateIs2
    tmpargument = 125

  //Confusion
  IfStateIs3
    tmpargument = 119

  //Evilward
  IfStateIs4
    tmpargument = 124

  //Frostward
  IfStateIs5
    tmpargument = 126

  //Holy Bolt
  IfStateIs6
    tmpargument = 129

  //Scroll of Rebirth		TWICE FOR X2 CHANCE
  IfStateIs7
    tmpargument = 105

  //Scroll of Rebirth		TWICE FOR X2 CHANCE
  IfStateIs8
    tmpargument = 105

  //Warhammer			TWICE FOR X2 CHANCE
  IfStateIs9
    tmpargument = 95

  //Warhammer			TWICE FOR X2 CHANCE
  IfStateIs10
    tmpargument = 95

  //Shield of the Crusader
  IfStateIs11
    tmpargument = 134

  //Truesight scroll
  IfStateIs12
    tmpargument = 140

  //Moonbeam
  IfStateIs13
    tmpargument = 155

  SpawnExactCharacterXYZ

  //Do last
  GoPoof

//------------------------------------------------------------------------------------
End					// All done
//------------------------------------------------------------------------------------
