Actor "SerpentStaff" : CWeapStaff// replaces CWeapStaff
{
	Tag "Serpent Staff"
	Weapon.KickBack 100
	Weapon.YAdjust 0
	+UNDROPPABLE
	+MELEEWEAPON
	weapon.ammogive1 0
	Weapon.AmmoType2 "Mana1"
	Weapon.AmmoUse2 1
	Weapon.SelectionOrder 4
	Weapon.BobStyle InverseSmooth
	Weapon.BobSpeed 2.1
	Weapon.BobRangeY 0.4
	Weapon.BobRangeX 0.5
	MeleeRange 96
	States
	{
	Select:
		CSSF C 1 A_Raise
		TNT1 A 0 A_Raise
		Loop
	Deselect:
		CSSF B 1 A_Lower
		TNT1 A 0 A_Lower
		CSSF B 1 A_Lower
		TNT1 A 0 A_Lower
		CSSF B 1 A_Lower
		TNT1 A 0 A_Lower
		CSSF C 1 A_Lower
		CSSF C 0 A_Lower
		Goto Deselect+6
	Fire:
		CSSF A 1 Offset (0, 45)
		CSSF J 0 Offset (0, 50) A_PlayWeaponSound("ClericCStaffFire")
		CSSF J 0 Offset (0, 50) A_FireCustomMissile("NewCStaffMissile",3,0)
		CSSF J 1 Offset (0, 50) A_FireCustomMissile("NewCStaffMissile2",-3,1)
		CSSF J 1 Offset (0, 48) a_setpitch(pitch-.6)
		CSSF J 1 Offset (0, 46) a_setpitch(pitch+.2)
		CSSF J 1 Offset (0, 44) a_setpitch(pitch+.2)
		CSSF J 1 Offset (0, 42) a_setpitch(pitch+.2)
		CSSF A 2 Offset (0, 40)
		CSSF A 2 Offset (0, 36)
		Goto Ready + 2
	AltFire:
		CSSF BBB 1 A_JumpIfCloser(96 + Radius*2,"Sap")
	AltHold:
		CSSF C 1 offset(-1,36) A_JumpIfCloser(96 + Radius*2,"Sap")
		CSSF C 1 offset(1,36) A_JumpIfCloser(96 + Radius*2,"Sap")
		CSSF C 1 offset(-1,35) A_JumpIfCloser(96 + Radius*2,"Sap")
		CSSF C 1 offset(-1,35) A_JumpIfCloser(96 + Radius*2,"Sap")
		CSSF C 1 offset(1,36) A_JumpIfCloser(96 + Radius*2,"Sap")
		CSSF C 1 offset(2,36) A_JumpIfCloser(96 + Radius*2,"Sap")
		CSSF C 1 offset(-1,37) A_JumpIfCloser(96 + Radius*2,"Sap")
		CSSF C 1 offset(-2,35) A_JumpIfCloser(96 + Radius*2,"Sap")
		CSSF C 1 offset(-1,36) A_JumpIfCloser(96 + Radius*2,"Sap")
		CSSF C 1 offset(-2,37) A_JumpIfCloser(96 + Radius*2,"Sap")
		CSSF C 1 offset(-2,35) A_JumpIfCloser(96 + Radius*2,"Sap")
		CSSF C 1 offset(1,35) A_JumpIfCloser(96 + Radius*2,"Sap")
		CSSF C 0 A_Refire
		goto ready
		CSSF J 0 A_JumpIfCloser(96 + Radius*2,"Sap")
		CSSF J 5 A_PlaySound ("SerpentFXContinuous", CHAN_WEAPON)
		CSSF B 0 A_StopSound(CHAN_WEAPON)
	Sap:
		CSSF K 0 A_JumpIfInventory("PowerSacrificeIcon",1,"SapS")
		CSSF K 0 Offset (0, 36) A_FireBullets(0,0,1,ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(20, 35), STRENGTH, 0, ACTIVATOR), "SerpentStaffPuff", FBF_NORANDOM, 96)
		CSSF K 1 Offset(0,36)
		CSSF K 1 Offset(0,37)
		CSSF J 1 Offset(0,38)
		CSSF J 1 Offset(0,39)
		CSSF A 6 Offset(0,40)
		Goto ReadY + 2
	SapS:
		CSSF K 0 A_FireBullets(0,0,1,0,"SacrificePuffGhost",FBF_NORANDOM,96)
		CSSF K 0 Offset (0, 36) A_FireBullets(0,0,1,ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(20, 35), STRENGTH, 0, ACTIVATOR), "SerpentStaffPuff", FBF_NORANDOM, 96)
		CSSF K 1 Offset(0,36)
		CSSF K 1 Offset(0,37)
		CSSF J 1 Offset(0,38)
		CSSF J 1 Offset(0,39)
		CSSF A 6 Offset(0,40)
		Goto ReadY + 2
	}
}

Actor NewCStaffMissile replaces CStaffMissile
{
	Damage (ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(15,30), INTELLECT, 0, WOCTARGET))
	+DONTBLAST
	Damagetype "Poison"
	+MTHRUSPECIES
	+HITTRACER
	Speed 22
	Radius 12
	Height 10
	RenderStyle Add
	Projectile
	DeathSound "ClericCStaffExplode"
	Obituary "$OB_MPCWEAPSTAFFR"
	States
	{
	Spawn:
		CSSF D 0 Bright A_CustomMissile("CStaffTrail",0,0,0,0)
		CSSF D 1 Bright A_CStaffMissileSlither
		CSSF D 0 Bright A_CustomMissile("CStaffTrail",0,0,0,0)
		CSSF D 1 Bright A_CStaffMissileSlither
		CSSF E 0 Bright A_CustomMissile("CStaffTrail",0,0,0,0)
		CSSF E 1 Bright A_CStaffMissileSlither
		CSSF E 0 Bright A_CustomMissile("CStaffTrail",0,0,0,0)
		CSSF E 1 Bright A_CStaffMissileSlither
		Loop
	Death:
		CSSF F 0 Bright ACS_NamedExecuteWithResult("WOC DAMAGE OVER TIME", ACS_ExecuteWithResult(WOC_DECORATE,STATS,WOCTID,WOCTRACER), ACS_NamedExecuteWithResult("WOC Player Scale", 5, INTELLECT, 0, WOCTARGET), 5, POISONDOT)
		CSSF FG 4 Bright
		CSSF HI 3 Bright
		Stop
    }
}

Actor NewCStaffMissile2 : NewCStaffMissile
{
	States
	{
	Spawn:
		CSSF D 0 Bright A_CustomMissile("CStaffTrail",0,0,0,0)
		CSSF D 1 Bright A_Weave(-3, 0, 1.0, 0.0)
		CSSF D 0 Bright A_CustomMissile("CStaffTrail",0,0,0,0)
		CSSF D 1 Bright A_Weave(-3, 0, 1.0, 0.0)
		CSSF E 0 Bright A_CustomMissile("CStaffTrail",0,0,0,0)
		CSSF E 1 Bright A_Weave(-3, 0, 1.0, 0.0)
		CSSF E 0 Bright A_CustomMissile("CStaffTrail",0,0,0,0)
		CSSF E 1 Bright A_Weave(-3, 0, 1.0, 0.0)
		Loop
	}
}

ACTOR CStaffTrail
{
	+NOINTERACTION
	+NOCLIP
	+CLIENTSIDEONLY
	PROJECTILE
	RENDERSTYLE ADD
	ALPHA 0.4
	Scale 0.25
	States
	{
	Spawn:
		SSFX CDEFGH 2 Bright
		Stop
	}
}

ACTOR SerpentStaffPuff
{
	+NOBLOCKMAP
	+NOGRAVITY
	Damagetype "Poison"
	+PUFFONACTORS
	+PUFFGETSOWNER
	+MTHRUSPECIES
	+HITTRACER
	RenderStyle Add
	Alpha 0.6
	SeeSound "ClericCStaffHitThing"
	States
	{
	Spawn:
		SSPF SS 0
		SSPF S 0 ACS_NamedExecuteWithResult("WOC DAMAGE OVER TIME", ACS_ExecuteWithResult(WOC_DECORATE,STATS,WOCTID,WOCTRACER), ACS_NamedExecuteWithResult("WOC Player Scale", 5, STRENGTH, 0, WOCTARGET), 5, POISONDOT)
		SSPF S 0 A_TakeFromTarget("Mana1", 1)
		SSPF S 4 A_GiveToTarget("SerpentStaffHealth")
		SSPF TUVW 4
		Stop
	}
}

Actor SerpentStaffHealth : CustomInventory
{
	Inventory.MaxAmount 0
	+INVENTORY.AUTOACTIVATE
	States
	{
	Use:
		TNT1 A 0 ACS_ExecuteAlways(WOC_HEALSCRIPT,0,ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(20, 35) >> 3, STRENGTH, 0, ACTIVATOR),0,0)
		Stop
	}
}