ACTOR PainLordSoul : CustomInventory 17756
{
//$Category Powerups/DUST
//$Sprite SOITA0
//$Title "Pain Lord Soul"
   Inventory.Amount 1
   Inventory.MaxAmount 2
   Inventory.PickupSound "Soul/Fire"
   Inventory.PickupMessage "You have acquired the Pain Lord's soul!"
   Inventory.Icon SOITA0
   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("OccultCanUpgrade")
	  TNT1 A 0 A_GiveInventory("OccultDarkMatterToken")
	  Stop
   } 
}
Actor PainLordSoulItemFX
{
	+CLIENTSIDEONLY
	+NOINTERACTION
	RenderStyle Add
	Alpha 0.45
	Scale 0.6
	States
	{
	Spawn:
		TNT1 A 2
		PUF6 BDFHJLNPRTVXZ 1
		PUF7 B 1 A_FadeOut(0.2)
		Wait
	}
}

ACTOR ChaosEssence : PainLordSoul 17757
{
//$Category Powerups/DUST
//$Sprite SOITD0
//$Title "Chaos Essence"
   Inventory.PickupMessage "You have acquired an essence of Chaos!"
   Inventory.Icon SOITD0
   Tag "Chaos Essence - Acts as a portable Life Sphere, or upgrades a certain weapon..."
   States
   {
   Spawn:
      TNT1 A 1 A_SpawnItemEx("ChaosEssenceItemFX",0,0,18,frandom(-1,1),frandom(-1,1),frandom(-1,1))
      Loop
   Use:
      TNT1 A 0 A_JumpIfInventory("OccultChaosLightningToken",1,"GiveItem")
      TNT1 A 0 A_JumpIfInventory("OccultSpellbook",1,"SpellbookUpgrade")
   GiveItem:
	  TNT1 A 0 A_Playsound("Soul/Hit")
	  TNT1 A 0 A_GiveInventory("LifeSphere")
      Stop
   SpellbookUpgrade:
	  TNT1 A 0 A_Print("The Occult Spellbook now has the ability to use Chaos Lightning!")
	  TNT1 A 0 A_Playsound("Soul2/Hit")
	  TNT1 A 0 A_GiveInventory("OccultCanUpgrade")
	  TNT1 A 0 A_GiveInventory("OccultChaosLightningToken")
	  Stop
   } 
}
Actor ChaosEssenceItemFX : PainLordSoulItemFX
{
	States
	{
	Spawn:
		TNT1 A 2
		GSL1 BDFHJLNPRTVXZ 1
		GSL2 B 1 A_FadeOut(0.2)
		Wait
	}
}