ACTOR PainLordSoul : CustomInventory
{
   Inventory.Amount 1
   Inventory.MaxAmount 2
   Inventory.PickupSound "Soul/Fire"
   Inventory.PickupMessage "You have acquired the Pain Lord's soul!"
   Inventory.Icon SOITA0
   Scale 0.6
   Renderstyle Add
   Alpha 1
   Tag "Pain Lord Soul - Acts as a portable Soulsphere, or upgrades a certain weapon..."
   +INVBAR
   +FLOORCLIP
   States
   {
   Spawn:
      TNT1 A 1 A_SpawnItemEx("PainLordSoulItemFX",0,0,18,frandom(-1,1),frandom(-1,1),frandom(-1,1))
      Loop
   Use:
      TNT1 A 0 A_JumpIfInventory("OccultDarkMatterToken",1,"GiveItem")
      TNT1 A 0 A_JumpIfInventory("OccultSpellbook",1,"SpellbookUpgrade")
   GiveItem:
	  TNT1 A 0 A_Playsound("Soul/Hit")
	  TNT1 A 0 A_GiveInventory("SoulSphere")
      Stop
   SpellbookUpgrade:
	  TNT1 A 0 A_Print("The Occult Spellbook now has the ability to use Dark Matter!")
	  TNT1 A 0 A_Playsound("Soul2/Hit")
	  TNT1 A 0 A_GiveInventory("OccultDarkMatterToken")
	  Stop
   } 
}
Actor PainLordSoulItemFX
{
	Projectile
	+CLIENTSIDEONLY
	+NOINTERACTION
	Damage 0
	RenderStyle Add
	Alpha 0.45
	Scale 0.6
	States
	{
	Spawn:
		TNT1 A 2
		PUF6 BDFHJLNPRTVXZ 1
		PUF7 B 1 A_FadeOut(0.2)
		Wait
	}
}