ACTOR "Skullstaff" : Weapon //replaces MWeaponPiece2
{
	Tag "Skull Staff"
	//$Category Pickups
	Scale .75
	Weapon.SelectionOrder 2
	Weapon.KickBack 100
	Weapon.YAdjust 0
	Weapon.AmmoUse1 2
	Weapon.AmmoGive1 0
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "Mana2"
	Weapon.AmmoUse2 7
	Weapon.AmmoType2 "Mana2"
	+UNDROPPABLE
	Inventory.PickupMessage "SKULL STAFF"
	Weapon.BobStyle InverseSmooth
	Weapon.BobSpeed 2.1
	Weapon.BobRangeY 0.4
	Weapon.BobRangeX 0.5
	States
	{
	Select:
		SKST B 1 A_Raise
		TNT1 B 0 A_Raise
		Loop
	Deselect:
		SKST B 1 A_Lower
		TNT1 A 0 A_Lower
		Loop
	Ready:
		SKST B 1 A_WeaponReady
		Loop
	Fire:
		SKST B 2 Bright
	Hold:
		SKST C 2 Bright
		SKST D 2 Bright
		SKST E 2 Bright
		SKST F 1 Bright A_FireCustomMissile ("SkullStafProj")
		SKST F 1 Bright A_SetPitch(Pitch-.25)
		SKST F 0 Bright A_SetPitch(Pitch+.25)
		SKST E 2 Bright A_ReFire
		Goto Ready
	AltFire:
		SKST G 2 Bright
		SKST H 2 Bright
		SKST I 3 Bright
		SKST J 1 Bright A_FireCustomMissile ("SkullStafProjRed")
		SKST J 1 Bright A_SetPitch(Pitch-.5)
		SKST I 1 Bright A_SetPitch(Pitch+.25)
		SKST I 1 Bright A_SetPitch(Pitch+.25)
		SKST H 3 Bright
		SKST G 2 Bright
		SKST B 2 Bright A_ReFire
		Goto Ready
	SPAWN:
		SKST A -1 Bright
		Stop
	}
}

ACTOR SkullStafProj
{
	Radius 12
	Height 8
	Speed 40
	Damage (ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(35,55), INTELLECT, 0, WOCTARGET))
	Damagetype "Arcane"
	Scale .75
	Projectile
	RenderStyle Add
	+SEEKERMISSILE
	+MTHRUSPECIES /*+NODAMAGETHRUST*/
	+DONTBLAST
	SeeSound "Mage/SkullStaff/FireA"
	DeathSound "Mage/SkullStaff/ImpactA"
	States
	{
	Spawn:
		SKPJ A 0 Bright
		SKPJ AAA 1 BRIGHT A_CustomMissile("SpikeLightSpawner",0,0,0,4)//A_SpawnItemEx("SkullStaffTrailer")
		SKPJ B 0 Bright A_SeekerMissile(10, 30, SMF_PRECISE|SMF_LOOK)
		SKPJ BBB 1 BRIGHT A_CustomMissile("SpikeLightSpawner",0,0,0,4)//A_SpawnItemEx("SkullStaffTrailer")
		SKPJ CCC 1 BRIGHT A_CustomMissile("SpikeLightSpawner",0,0,0,4)//A_SpawnItemEx("SkullStaffTrailer")
		SKPJ D 0 Bright A_SeekerMissile(10, 30, SMF_PRECISE|SMF_LOOK)
		SKPJ DDD 1 BRIGHT A_CustomMissile("SpikeLightSpawner",0,0,0,4)//A_SpawnItemEx("SkullStaffTrailer")
		Loop
	Death:
		SKPJ EFGHIJ 3 BRIGHT
		SKPJ K 3
		Stop
	}
}

Actor SkullStafProjRed : HornRodFX2
{
	SeeSound "weapons/hornrodpowshoot"
	+SPAWNSOUNDSOURCE
	+MTHRUSPECIES +NODAMAGETHRUST
	+DONTBLAST
	DeathSound "Mage/SkullStaff/ImpactA"
	Speed 35
	Damage (ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(35,55), INTELLECT, 0, WOCTARGET))
	Damagetype "Shadow"
	States
	{
	Spawn:
		FX00 CCC 1 Bright A_CustomMissile("RedLightSpawner",0,0,0,4)
		FX00 D 0 Bright A_SeekerMissile(10, 30, SMF_PRECISE|SMF_LOOK)
		FX00 DDDEEE 1 Bright A_CustomMissile("RedLightSpawner",0,0,0,4)
		FX00 F 0 Bright A_SeekerMissile(10, 30, SMF_PRECISE|SMF_LOOK)
		FX00 FFF 1 Bright A_CustomMissile("RedLightSpawner",0,0,0,4)
		Loop
	Death:
		FX00 G 0 A_SpawnItemEx("SkullStaffRedExplode")
		FX00 G 0 Bright A_AddPlayerRain
		FX00 G 0 A_HideInCeiling
		FX00 G 1 Bright A_SkullRodStorm
		Wait
	}
}

ACTOR SkullStaffRedExplode
{
	+Missile
	+NoBlockmap
	+NoInteraction
	-Solid
	+CLIENTSIDEONLY +DONTBLAST
	Radius 0
	Height 0
	RenderStyle Add
	States
	{
	Spawn:
		FX00 H 2 Bright
		FX00 I 2 Bright
		FX00 J 2 Bright
		FX00 KLM 2 Bright
		FX00 G 1
		FX00 G 1
		Stop
	}
}

ACTOR SkullRainPillar replaces RainPillar
{
	Radius 6
	Height 12
	Speed 20
	Damage (ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(3,24), INTELLECT, 0, WOCTARGET))
	Damagetype "Shadow"
	Mass 5
	Projectile
	-ACTIVATEPCROSS
	-ACTIVATEIMPACT
	+MTHRUSPECIES +NODAMAGETHRUST
	-NOGRAVITY
	+DONTBLAST
	RenderStyle Add
	Obituary "$OB_MPPSKULLROD"
	States
	{
	Spawn:
		FX22 A -1 Bright
		Stop
	Death:
		FX22 B 0 Bright A_ChangeFlag("NOGRAVITY", 1)
		FX22 B 0 Bright A_CheckFloor("NotFloor")
		FX22 B 0 Bright A_Jump(38, "Disappear")
		FX22 GHI 4 Bright
		Stop
	NotFloor:
		FX22 B 0 Bright A_Jump(38, "Disappear")
		FX22 BCDEF 4 Bright
		Stop
	Disappear:
		TNT1 A 1 Bright
		Stop
	}
}

actor SpikeLightSpawner
{
	+NoBlockMap +NoGravity +NoSector +NoInteraction +NoClip -Solid +CLIENTSIDEONLY +DONTBLAST
	states
	{
	Spawn:
	Active:
		TNT1 A 0
		TNT1 A 0 A_JumpIf(Args[1], "Circle")
		TNT1 A 2
		TNT1 A 0 A_SpawnItemEx ("SpikeLight", 0, frandom(-4, 4), frandom(-3, 3), 0, (0.1)*frandom(-3, 3), (0.1)*frandom(-3, 3), frandom(0,360), 129, Args[2])
		TNT1 A 0 A_SpawnItemEx ("SpikeLight", 0, frandom(-4, 4), frandom(-3, 3), 0, (0.1)*frandom(-3, 3), (0.1)*frandom(-3, 3), frandom(0,360), 129, Args[2]) 
		Stop
	Circle:
		TNT1 A 0
		TNT1 A 2 A_SpawnItemEx ("SpikeLight", frandom(-Args[0], Args[0]), 0, frandom(0, 8), (0.1)*frandom(1, 3), 0, (0.1)*frandom(1, 10), frandom(0, 360), 129, Args[2]) 
		Loop
	Inactive:
		TNT1 A 1
		Loop
	}     
}

ACTOR SpikeLight
{
	+Missile
	+NoBlockmap
	+NoInteraction
	-Solid
	+CLIENTSIDEONLY +DONTBLAST
	Radius 0
	Height 0
	RenderStyle Add
	Alpha 0.01
	Scale 0.06
	Gravity 0.25
	States
	{
	Spawn:
		SKLT AAAA 1 Bright A_FadeIn(0.25)
		TNT1 A 0 A_Jump(80,8)
		TNT1 A 0 A_Jump(80,6)
		TNT1 A 0 A_Jump(80,4)   
		TNT1 A 0 A_Jump(80,2)   
		SKLT AAAAA 4 Bright
		SKLT AAAAAAAAAAAAAAAAAAAA 1 Bright A_FadeOut(0.06)
		Stop
	}
}

actor RedLightSpawner
{
	+NoBlockMap +NoGravity +NoSector +NoInteraction +NoClip -Solid +CLIENTSIDEONLY +DONTBLAST
	States
	{
	Spawn:
	Active:
		TNT1 A 0
		TNT1 A 0 A_JumpIf(Args[1], "Circle")
		TNT1 A 2
		TNT1 A 0 A_SpawnItemEx ("RedSpikeLight", 0, frandom(-8, 8), frandom(-8, 8), 0, (0.3)*frandom(-3, 3), (0.3)*frandom(-3, 3), frandom(0,360), 129, Args[2])
		TNT1 A 0 A_SpawnItemEx ("RedSpikeLight", 0, frandom(-8, 8), frandom(-8, 8), 0, (0.3)*frandom(-3, 3), (0.3)*frandom(-3, 3), frandom(0,360), 129, Args[2]) 
		Stop
	Circle:
		TNT1 A 0
		TNT1 A 2 A_SpawnItemEx ("SpikeLight", frandom(-Args[0], Args[0]), 0, frandom(0, 8), (0.1)*frandom(1, 3), 0, (0.1)*frandom(1, 10), frandom(0, 360), 129, Args[2]) 
		Loop
	Inactive:
		TNT1 A 1
		Loop
	}         
}

ACTOR RedSpikeLight
{
	+Missile
	+NoBlockmap
	+NoInteraction
	-Solid
	+CLIENTSIDEONLY +DONTBLAST
	Radius 0
	Height 0
	RenderStyle Add
	Alpha 0.01
	Scale 0.1
	Gravity 0.25
	States
	{
	Spawn:
		SKLT BBBB 1 Bright A_FadeIn(0.25)
		TNT1 A 0 A_Jump(80,8)
		TNT1 A 0 A_Jump(80,6)
		TNT1 A 0 A_Jump(80,4)   
		TNT1 A 0 A_Jump(80,2)   
		SKLT BBBBB 4 Bright
		SKLT BBBBBBBBBBBBBBBBBBBB 1 Bright A_FadeOut(0.06)
		Stop
	}
}


actor SkullStaffTrailer
{
	+CLIENTSIDEONLY +DONTBLAST
	Speed		1
	Damage		0
	Radius 8
	Height 6
	PROJECTILE
	Renderstyle Add
	alpha	0.8
	scale 0.75
	States
	{
	Spawn:
		SKPJ AAABBBCCCDDD 1 A_Fadeout
		Stop
	}
}