ACTOR RubyWand : Weapon //replaces MWeaponPiece3
{
	//$Category Weapons
	Inventory.PickupMessage "Ruby Wand"
	Weapon.AmmoType1 "Mana1"
	Weapon.AmmoGive1 0
	Weapon.AmmoGive2 0
	Weapon.SelectionOrder 3
	Weapon.AmmoUse1 2
	Weapon.KickBack 100
	Weapon.AmmoType2 "Mana1"
	Weapon.AmmoUse2 3
	+UNDROPPABLE
	Tag "Ruby Wand"
	AttackSound "Mage/JadeWand/Fire"
	Weapon.BobStyle InverseSmooth
	Weapon.BobSpeed 2.1
	Weapon.BobRangeY 0.4
	Weapon.BobRangeX 0.5
	States
	{
	Spawn:
		RBYW C -1 Bright
		Loop
	Ready:
		RBYW A 1 A_WeaponReady
		Loop
	Deselect:
		RBYW A 1 A_Lower
		TNT1 A 0 A_Lower
		Loop
	Select:
		RBYW A 1 A_Raise
		TNT1 A 0 A_Raise
		Loop
	Fire:
		RBYW B 0 A_PlaySoundEx("Mage/RubyWand/Fire2","auto")
		WEMB FFFF 0 A_FireCustomMissile("RubyWandBall", FRandom(-2, 2), 0, 0, 0, 0, FRandom(-0.75, 0.75))
		WEMB F 0 A_FireCustomMissile("RubyWandBall", 0, 1, 0, 0, 0, 0)
		RBYW B 1 Bright Offset(0, 48) //A_FireBullets (6, 4.25, 5, ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(3,24), INTELLECT, 0, ACTIVATOR),"JadePuff",FBF_USEAMMO|FBF_NORANDOM)
		RBYW B 1 bright offset(0,42) A_SetPitch(Pitch-.4)
		RBYW B 1 bright offset(0,42) A_SetPitch(Pitch+.2)
		RBYW A 1 offset(0,49) A_SetPitch(Pitch+.2)
		RBYW A 1 offset(0,50)
		RBYW A 1 offset(0,49)
		RBYW A 1 offset(0,46)
		RBYW A 1 offset(0,43)
		RBYW A 1 offset(0,40)
		RBYW A 1 offset(0,37)
		RBYW A 1 offset(0,35)
		RBYW A 0 offset(0,35) a_refire
		goto ready
	AltFire:
		RBYW B 0 A_PlaySoundEx("Mage/RubyWand/Fire","auto")
		RBYW B 1 Bright Offset(0, 48) A_FireCustomMissile("RubyWandBomb")
		RBYW B 1 bright offset(0,42) A_SetPitch(Pitch-.4)
		RBYW B 1 bright offset(0,42) A_SetPitch(Pitch+.2)
		RBYW A 1 offset(0,49) A_SetPitch(Pitch+.2)
		RBYW A 1 offset(0,50)
		RBYW A 1 offset(0,49)
		RBYW A 1 offset(0,47)
		RBYW A 1 offset(0,46)
		RBYW A 1 offset(0,44)
		RBYW A 1 offset(0,43)
		RBYW A 1 offset(0,42)
		RBYW A 1 offset(0,40)
		RBYW A 1 offset(0,37)
		RBYW A 1 offset(0,35)
		RBYW A 0 offset(0,35) a_refire
		goto ready
	}
}

ACTOR JadeShot
{
	Radius 6
	Height 8
	Speed 40
	Damage (ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(15,30), INTELLECT, 0, WOCTARGET))
	PROJECTILE
	+DOOMBOUNCE
	-NOGRAVITY
	+MTHRUSPECIES +NODAMAGETHRUST
	+DONTFALL
	+THRUGHOST
	+WINDTHRUST
	+DONTBLAST
	+HITTRACER
	Gravity 0.25
	RENDERSTYLE Add
	SeeSound "Mage/JadeWand/Proj"
	DeathSound "Mage/JadeWand/Break"
	Damagetype "Poison"
	States
	{
	Spawn:
		JWPR AAAAAABBBBBBCCCCCC 1 Bright A_SpawnItemEx("JadeTrail",0,0,0,0,0,0,0,8)
		loop
	Death:
		JWPR E 0 ACS_NamedExecuteWithResult("WOC DAMAGE OVER TIME", ACS_ExecuteWithResult(WOC_DECORATE,STATS,WOCTID,WOCTRACER), ACS_NamedExecuteWithResult("WOC Player Scale", 5, INTELLECT, 0, WOCTARGET), 5, POISONDOT)
		JWPR E 0 A_CustomMissile("JadeDart", 4, 2, 0)
		JWPR E 0 A_CustomMissile("JadeDart", 4, 2, 40)
		JWPR E 0 A_CustomMissile("JadeDart", 4, 2, 80)
		JWPR E 0 A_CustomMissile("JadeDart", 4, 2, 120)
		JWPR E 0 A_CustomMissile("JadeDart", 4, 2, 160)
		JWPR E 0 A_CustomMissile("JadeDart", 4, 2, 200)
		JWPR E 0 A_CustomMissile("JadeDart", 4, 2, 240)
		JWPR E 0 A_CustomMissile("JadeDart", 4, 2, 280)
		JWPR E 0 A_CustomMissile("JadeDart", 4, 2, 320)
		JWPR E 0 A_CustomMissile("JadeDart", 4, 2, 350)
		JWPR D 5 Bright A_NoGravity
		JWPR EFG 5 Bright
		Stop
	}
}

ACTOR JadeTrail
{   
	Radius 0
	Height 1
	Damage 0
	Speed 0
	PROJECTILE
	+CLIENTSIDEONLY +DONTBLAST
	+NOINTERACTION
	+NOCLIP
	+DONTSPLASH
	RENDERSTYLE ADD
	States
	{
	Spawn:
		JWPR AAAAABBBBBCCCCC 1 Bright A_Fadeout(0.1)
		Stop 
	}
}

ACTOR JadeDart
{
	Speed 20
	Radius 4
	Height 4
	SeeSound "weapons/jadedart"
	Damage (ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(3,24), INTELLECT, 0, WOCTARGET))
	Damagetype "Poison"
	PROJECTILE
	+MTHRUSPECIES +NODAMAGETHRUST
	+PAINLESS
	-NOGRAVITY
	+DOOMBOUNCE
	+THRUGHOST
	+WINDTHRUST
	+DONTBLAST
	+HITTRACER
	BounceCount 3
	Renderstyle Add
	States
	{
	Spawn:
		JWPR HHHIIIJJJ 1 Bright A_SpawnItemEx("JadeDartTrail",0,0,0,0,0,0,0,8)
		Loop
	Death:
		TNT1 A 5 Bright ACS_NamedExecuteWithResult("WOC DAMAGE OVER TIME", ACS_ExecuteWithResult(WOC_DECORATE,STATS,WOCTID,WOCTRACER), ACS_NamedExecuteWithResult("WOC Player Scale", 3, INTELLECT, 0, WOCTARGET), 5, POISONDOT)
		Stop
	}
}

ACTOR JadeDartTrail
{   
	Radius 0
	Height 1
	Damage 0
	Speed 0
	PROJECTILE
	+CLIENTSIDEONLY +DONTBLAST
	+NOINTERACTION
	+NOCLIP
	+DONTSPLASH
	RENDERSTYLE ADD
	States
	{
	Spawn:
		JWPR HHHIIIJJJ 1 Bright A_Fadeout(0.2)
		Stop 
	}
}

actor JadePuff
{
	renderstyle Add
	+NOBLOCKMAP
	+NOGRAVITY
	+PUFFONACTORS
	+PAINLESS
	+BLOODLESSIMPACT
	+MTHRUSPECIES
	+PUFFGETSOWNER
	+HITTRACER
	Damagetype "Poison"
	Scale .5
	states
	{
	Spawn:
		IDSE A 0
		IDSE A 0 ACS_NamedExecuteWithResult("WOC DAMAGE OVER TIME", ACS_ExecuteWithResult(WOC_DECORATE,STATS,WOCTID,WOCTRACER), ACS_NamedExecuteWithResult("WOC Player Scale", 3, INTELLECT, 0, WOCTARGET), 5, POISONDOT)
		IDSE AABBCCDD 1 bright A_FadeOut(0.05)
		Stop
	}
}

Actor RubyWandBall
{
  Radius 4
  Height 4
  Speed 40
  Damage (ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(3,24), INTELLECT, 0, WOCTARGET))
  DamageType Fire
  RenderStyle Add
  Scale 0.75
  Projectile
  -BloodSplatter
  +BloodlessImpact
  +MTHRUSPECIES
  +DONTBLAST
  DeathSound "Mage/RubyWand/Proj"
  Decal EmberWandScorch
  States
  {
  Spawn:
    RUBP AABBB 1 Bright A_SpawnItemEx("RubyWandBallTrail", 0, 0, 0, 0, 0, 0, 0, 128)
    Loop
  Death:
    RUBP CDEFG 3 Bright
    Stop
  }
}

Actor RubyWandBallTrail
{   
  Radius 2
  Height 2
  Damage 0
  Scale 0.75
  Projectile
  -BloodSplatter
  +BloodlessImpact
  +CLIENTSIDEONLY
  +NOINTERACTION
  +DONTBLAST
  RenderStyle Add
  //Alpha 0.75
  States
  {
  Spawn:
    //TNT1 A 2
    RUBP HHHIIIJJJ 1 Bright A_FadeOut
    Stop 
  }
}

ACTOR RubyWandBomb
{
	Speed 40
	Radius 8
	Height 8
	DamageType Fire
	Projectile
	-NOGRAVITY
	+MTHRUSPECIES
	+DONTBLAST
	Gravity 0.5
	RenderStyle Add
	DeathSound "Fireball"
	States
	{
	Spawn:
		FBL1 AAAABBBB 1 Bright A_spawnitemEx("RubyWandBombTrail")
		Loop
	Death:
		XPL1 A 0 Bright A_JumpIfInTargetInventory("IsPyro", 1, "Pyro")
		XPL1 E 0 Bright A_Explode(ACS_NamedExecuteWithResult("WOC Player Scale", 48, INTELLECT, 0, WOCTARGET), 64, 0)
		XPL1 E 0 Bright A_CustomMissile("RubyWandBallSmall", 4, 0, 0, CMF_TRACKOWNER)
		XPL1 E 0 Bright A_CustomMissile("RubyWandBallSmall", 4, 0, 45, CMF_TRACKOWNER)
		XPL1 E 0 Bright A_CustomMissile("RubyWandBallSmall", 4, 0, 90, CMF_TRACKOWNER)
		XPL1 E 0 Bright A_CustomMissile("RubyWandBallSmall", 4, 0, 135, CMF_TRACKOWNER)
		XPL1 E 0 Bright A_CustomMissile("RubyWandBallSmall", 4, 0, 180, CMF_TRACKOWNER)
		XPL1 E 0 Bright A_CustomMissile("RubyWandBallSmall", 4, 0, 225, CMF_TRACKOWNER)
		XPL1 E 0 Bright A_CustomMissile("RubyWandBallSmall", 4, 0, 270, CMF_TRACKOWNER)
		XPL1 E 0 Bright A_CustomMissile("RubyWandBallSmall", 4, 0, 315, CMF_TRACKOWNER)
		XPL1 A 0 Bright A_NoGravity
		XPL1 ABCDEF 3 Bright
		Stop
	Pyro:
		XPL1 E 0 Bright A_Explode(ACS_NamedExecuteWithResult("WOC Player Scale", 48, INTELLECT, 0, WOCTARGET), 64, 0, 0, 64)
		XPL1 E 0 Bright A_CustomMissile("RubyWandBallSmall", 4, 0, 0, CMF_TRACKOWNER)
		XPL1 E 0 Bright A_CustomMissile("RubyWandBallSmall", 4, 0, 45, CMF_TRACKOWNER)
		XPL1 E 0 Bright A_CustomMissile("RubyWandBallSmall", 4, 0, 90, CMF_TRACKOWNER)
		XPL1 E 0 Bright A_CustomMissile("RubyWandBallSmall", 4, 0, 135, CMF_TRACKOWNER)
		XPL1 E 0 Bright A_CustomMissile("RubyWandBallSmall", 4, 0, 180, CMF_TRACKOWNER)
		XPL1 E 0 Bright A_CustomMissile("RubyWandBallSmall", 4, 0, 225, CMF_TRACKOWNER)
		XPL1 E 0 Bright A_CustomMissile("RubyWandBallSmall", 4, 0, 270, CMF_TRACKOWNER)
		XPL1 E 0 Bright A_CustomMissile("RubyWandBallSmall", 4, 0, 315, CMF_TRACKOWNER)
		XPL1 A 0 Bright A_NoGravity
		XPL1 ABCDEF 3 Bright
		Stop
	}
}

Actor RubyWandBallSmall : RubyWandBall
{
	-NOGRAVITY
	Speed 15
	//Damage (ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(2,16), INTELLECT, 0, WOCTARGET))
	States
	{
	Death:
		RUBP C 0 Bright A_NoGravity
		RUBP CDEFG 3 Bright
		Stop
	}
}

ACTOR RubyWandBombTrail
{
	Radius 1
    Height 1
	Gravity 0
	Speed 1
	Scale 1.0
    +NOBLOCKMAP
    +NOTELEPORT
    +DONTSPLASH
	+MISSILE
	+CLIENTSIDEONLY
	+FORCEXYBILLBOARD
	+NOINTERACTION
	Renderstyle Add
	States
	{
	Spawn:
		RUBT ABCDE 4 Bright//A_FadeOut
		Stop
	}
}

Actor RubyWandBallSmallTrail : RubyWandBallTrail
{
	Scale 0.2
}