//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	
  DropItems

//DEBUG REMOVE THIS
  tmpargument = 1
  tmpdistance = 0
  PlayMusic
//DEBUG REVMO THIS


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


//------------------------------------------------------------------------------------
//Create some random magic stuff
tmpargument = 3
IfContentIs
  tmpargument = rand % 12		  //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
  SpawnExactCharacterXYZ



//------------------------------------------------------------------------------------
//Create some random divine shop stuff
tmpargument = 4
IfContentIs
  tmpargument = rand % 11		  //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
  SpawnExactCharacterXYZ


//------------------------------------------------------------------------------------
//Do last
GoPoof

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