ACTOR Lichstaff : Weapon
{  
	Weapon.AmmoType1 "Mana2" 
	Weapon.AmmoType2 "Mana2" 
	Weapon.AmmoGive1 0
	Weapon.AmmoGive2 0
	Weapon.AmmoUse1 5
	Weapon.AmmoUse2 4
	Weapon.KickBack 100
	Weapon.SelectionOrder 3
	+UNDROPPABLE
	Inventory.PickupMessage "LICH STAFF"
	Tag "Lich Staff"
	Weapon.BobStyle InverseSmooth
	Weapon.BobSpeed 2.1
	Weapon.BobRangeY 0.4
	Weapon.BobRangeX 0.5
	States
	{
	Ready: 
		LICS A 1 A_WeaponReady 
		Loop 
	Deselect: 
		LICS A 1 A_Lower 
		TNT1 A 0 A_Lower
		Loop
	Select: 
		LICS A 1 A_Raise 
		TNT1 A 0 A_Raise
		Loop
	Fire: 
		LICS B 1 Bright Offset(-2, 36)
		LICS B 1 Bright Offset(-1, 38)
		LICS B 1 Bright Offset(1, 39)
		LICS C 1 Bright Offset(-2, 40)
		LICS C 1 Bright Offset(1, 41)
		LICS C 1 Bright Offset(-1, 43)
		LICS D 1 BRIGHT Offset(2, 45)
		LICS D 1 BRIGHT Offset(1, 47)
		LICS E 0 BRIGHT A_PlayWeaponSound ("NecromancerLichStaffFire")
		LICS E 1 BRIGHT Offset(0, 50) A_FireCustomMissile ("LichStaffFireball", 0, 1, 0, 0)
		LICS E 1 BRIGHT Offset(0, 47) A_SetPitch(Pitch-1.5)
		LICS D 1 BRIGHT Offset(0, 44) A_SetPitch(Pitch+.5)
		LICS D 1 BRIGHT Offset(0, 42) A_SetPitch(Pitch+.5)
		LICS D 1 BRIGHT Offset(0, 41) A_SetPitch(Pitch+.5)
		LICS C 1 Bright Offset(0, 39)
		LICS C 1 Bright Offset(0, 37)
		LICS C 1 Bright Offset(0, 36)
		LICS B 2 Bright Offset(0, 35)
		LICS B 2 Bright Offset(0, 33)
		LICS A 5
		Goto Ready
	AltFire:
		LICS B 1 bright offset(1,35)
		LICS B 1 bright offset(-1,34)
		LICS B 1 bright offset(1,32)
		LICS B 1 bright offset(-1,34)
		LICS C 1 bright offset(1,35)
		LICS C 1 bright offset(-1,35)
		LICS C 1 bright offset(1,32)
		LICS C 1 bright offset(-1,32)
		LICS D 1 bright offset(1,33)
		LICS D 1 bright offset(-1,34) A_PlayWeaponSound ("weapons/lichstaff/altfire")
		LICS D 1 bright offset(1,35)
		LICS D 1 bright offset(-1,34)
		LICS E 0 Bright A_FireCustomMissile ("SpikeShot",3,0,0,0)
		LICS E 0 Bright A_FireCustomMissile ("SpikeShot",-3,0,0,0)
		LICS E 1 bright offset(1,35) A_FireCustomMissile ("SpikeShot")
		LICS E 1 bright offset(-1,35)
		LICS E 1 bright offset(1,32)
		LICS E 1 bright offset(-1,32)
		LICS D 1 bright offset(1,33)
		LICS D 1 bright offset(-1,34)
		LICS D 1 bright offset(1,35)
		LICS D 1 bright offset(-1,34)
		LICS C 1 bright offset(1,35)
		LICS C 1 bright offset(-1,35)
		LICS B 1 bright offset(-1,34)
		LICS B 1 bright offset(1,32)
		LICS A 4
		Goto Ready 
	} 
}

ACTOR LichStaffFireball
{
	Radius 8
	Height 8
	Speed 25
	Damage 0
	Damagetype "Shadow"
	PROJECTILE
	-NOGRAVITY
	+MTHRUSPECIES +NODAMAGETHRUST +DONTBLAST
	+FORCERADIUSDMG
	Gravity 0.35
	Renderstyle Add
	SeeSound "NecromancerLichStaffFire"
	DeathSound "NecromancerLichStaffExplode"
	States
	{
	Spawn:
		LIC1 AAAABBBB 1 BRIGHT A_spawnitemEx("LichStaffFireballPuff")
		Loop
	Death:
		TNT1 A 0 A_Explode(ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(60,80), INTELLECT, 0, WOCTARGET),128,0)
		TNT1 A 0 A_NoGravity
		TNT1 A 0 Radius_Quake (2, 10, 0, 2, 0)
		TNT1 A 0 Radius_Quake (1, 5, 0, 3, 0)
		TNT1 AA 0 A_CustomMissile("LichFireball2",0,0,frandom(0,359),6,frandom(0,90))
		TNT1 AA 0 A_CustomMissile("LichFireball2",0,0,frandom(0,359),6,frandom(0,90))
		TNT1 AA 0 A_CustomMissile("LichFireball2",0,0,frandom(0,359),6,frandom(0,90))
		TNT1 AA 0 A_CustomMissile("LichFireball2",0,0,frandom(0,359),6,frandom(0,90))
		LIC1 CDEFGH 4 BRIGHT
		Stop
	}
}

ACTOR LichStaffFireballPuff
{
    Radius 1
    Height 1
	Gravity 0
	Speed 1
	Scale 1.0
    +NOBLOCKMAP
    +NOTELEPORT
    +DONTSPLASH
	+MISSILE
	+CLIENTSIDEONLY
	+FORCEXYBILLBOARD
	+NOINTERACTION
	Renderstyle Add
    States
    {
    Spawn:
        LICP CDEFG 4
        Stop
    }
}

ACTOR LichFireball2
{
	Radius 4
	Height 3
	Speed 10
	Damage (1)
	PROJECTILE
	-NOGRAVITY
	+DONTREFLECT
	+DONTSPLASH
	+MTHRUSPECIES
	+NODAMAGETHRUST
	+FORCERADIUSDMG
	Renderstyle Add
	DeathSound "NecromancerLichStaffSear"
	Damagetype "Shadow"
	States
	{
	Spawn:
		LIC2 AB 4 BRIGHT
		Loop
	Death:
		LIC2 EDCD 4 BRIGHT A_Explode (ACS_NamedExecuteWithResult("WOC Player Scale", 2, INTELLECT, 0, WOCTARGET), 64, 0)
		LIC2 DCDC 4 BRIGHT A_Explode (ACS_NamedExecuteWithResult("WOC Player Scale", 2, INTELLECT, 0, WOCTARGET), 64, 0)
		LIC2 DCDC 4 BRIGHT A_Explode (ACS_NamedExecuteWithResult("WOC Player Scale", 2, INTELLECT, 0, WOCTARGET), 64, 0)
		LIC2 DCDC 4 BRIGHT A_Explode (ACS_NamedExecuteWithResult("WOC Player Scale", 2, INTELLECT, 0, WOCTARGET), 64, 0)
		LIC2 DCD 4 BRIGHT A_Explode (ACS_NamedExecuteWithResult("WOC Player Scale", 2, INTELLECT, 0, WOCTARGET), 64, 0)
		LIC2 EFG 4 BRIGHT A_Explode (ACS_NamedExecuteWithResult("WOC Player Scale", 2, INTELLECT, 0, WOCTARGET), 64, 0)
		Stop
	}
}

ACTOR SpikeShot
{
	Radius 8
	Height 10
	Speed 70
	Damage 0
	ReactionTime 30
	PROJECTILE
	RENDERSTYLE Normal
	+RIPPER
	+FLOORHUGGER
	+THRUGHOST
	+MTHRUSPECIES +NODAMAGETHRUST +DONTBLAST
	-NOGRAVITY
	DeathSound "weapons/stab"
	States
	{
	Spawn:
		TNT1 A 1 A_CustomMissile("Impaler",0,0,0,4)
		TNT1 A 0 A_CustomMissile("SpikeLightSpawner",0,0,0,4)
		TNT1 A 0 A_Countdown
		loop
	Death:
		TNT1 A 2 Bright
		stop
	}
}

ACTOR Impaler
{   
	Radius 1
	Height 1
	Damage 0
	Speed 0
	PROJECTILE
	Damagetype "Physical"
	RENDERSTYLE Normal
	+FLOORHUGGER
	-NOGRAVITY
	+NODAMAGETHRUST +DONTBLAST
	+RIPPER
	+BLOODLESSIMPACT
	+NODAMAGETHRUST +DONTBLAST
	+DONTSPLASH
	+FORCERADIUSDMG
	States
	{
	Spawn:
		SPIK ABCDE 3
		SPIK E 0 A_Explode (ACS_NamedExecuteWithResult("WOC Player Scale", 32, INTELLECT, 0, WOCTARGET),36,0)
		SPIK DCBA 3
		Stop 
	}
}