Actor EnchantedBow : Weapon
{
	Inventory.PickUpMessage "ENCHANTED BOW"
	Weapon.AmmoUse 2
	Tag "Enchanted Bow"
	Weapon.AmmoGive1 0
	Weapon.AmmoGive2 0
	Weapon.AmmoType "Mana1"
	Weapon.KickBack 100
	Weapon.SelectionOrder 4
	+UNDROPPABLE
	+AMMO_OPTIONAL
	+NOALERT
	AttackSound "weapons/lightningbow"
	Weapon.BobStyle InverseSmooth
	Weapon.BobSpeed 2.1
	Weapon.BobRangeY 0.4
	Weapon.BobRangeX 0.5
	States
	{
	Select:
		TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_TakeInventory("PowerZoomLevel2")
		TNT1 A 0 A_TakeInventory("PowerZoomLevel1")
		TNT1 A 0 A_JumpIfInventory("Mana1",2,"Select_Mana")
		DBOW A 1 A_Raise
	    TNT1 A 0 A_Raise
	    Loop
	Select_Mana:
		TNT1 A 0 A_JumpIfInventory("IceSpellInv",1,"Select_Ice")
	    TNT1 A 0 A_JumpIfInventory("FireSpellInv",1,"Select_Fire")
	    TNT1 A 0 A_JumpIfInventory("ThunderSpellInv",1,"Select_Thunder")
	    EBOW A 1 A_Raise
	    TNT1 A 0 A_Raise
	    Loop
	Select_Ice:
	    PBOW A 1 A_Raise
	    TNT1 A 0 A_Raise
	    Loop
	Select_Fire:
	    PBO2 A 1 A_Raise
	    TNT1 A 0 A_Raise
	    Loop
	Select_Thunder:
	    PBO3 A 1 A_Raise
	    TNT1 A 0 A_Raise
	    Loop
	Deselect:
		TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_TakeInventory("PowerZoomLevel2")
		TNT1 A 0 A_TakeInventory("PowerZoomLevel1")
		TNT1 A 0 A_TakeInventory("EnchantedBowHoldCheck",1)
		TNT1 A 0 A_TakeInventory("PowerEnchantedBowSpeed",1)
		TNT1 A 0 A_JumpIfInventory("Mana1",2,"DeSelect_Mana")
		TNT1 A 0 A_GiveInventory("EnchantedBowHoldCheck",1)
		TNT1 A 0 A_Lower
		DBOW A 1 A_Lower
	    Loop
	Deselect_Mana:
	    TNT1 A 0 A_JumpIfInventory("IceSpellInv",1,"Deselect_Ice")
	    TNT1 A 0 A_JumpIfInventory("FireSpellInv",1,"Deselect_Fire")
	    TNT1 A 0 A_JumpIfInventory("ThunderSpellInv",1,"Deselect_Thunder")
	    TNT1 A 0 A_GiveInventory("EnchantedBowHoldCheck",1)
		TNT1 A 0 A_Lower
		EBOW A 1 A_Lower
	    Loop
	Deselect_Ice:
		TNT1 A 0 A_GiveInventory("EnchantedBowHoldCheck",1)
		TNT1 A 0 A_Lower
	    PBOW A 1 A_Lower
	    Loop
	Deselect_Fire:
		TNT1 A 0 A_GiveInventory("EnchantedBowHoldCheck",1)
		TNT1 A 0 A_Lower
	    PBO2 A 1 A_Lower
	    Loop
	Deselect_Thunder:
		TNT1 A 0 A_GiveInventory("EnchantedBowHoldCheck",1)
		TNT1 A 0 A_Lower
	    PBO3 A 1 A_Lower
	    Loop
	Ready:
		DBOW A 0 A_JumpIfInventory("IsMarksman",1,"ReadyZoom")
		TNT1 A 0 A_JumpIfInventory("Mana1",2,"Ready_Mana")
		DBOW A 1 A_WeaponReady
	    Loop
	ReadyZoom:
		TNT1 A 0 A_JumpIfInventory("Mana1",2,"Ready_ManaZoom")
		DBOW A 1 A_WeaponReady(WRF_ALLOWZOOM)
	    Loop
	Ready_Mana:
	    TNT1 A 0 A_JumpIfInventory("IceSpellInv",1,"Ready_Ice")
	    TNT1 A 0 A_JumpIfInventory("FireSpellInv",1,"Ready_Fire")
	    TNT1 A 0 A_JumpIfInventory("ThunderSpellInv",1,"Ready_Thunder")
	    EBOW AAAEEE 1 A_WeaponReady
	    Goto Ready
	Ready_ManaZoom:
	    TNT1 A 0 A_JumpIfInventory("IceSpellInv",1,"Ready_IceZoom")
	    TNT1 A 0 A_JumpIfInventory("FireSpellInv",1,"Ready_FireZoom")
	    TNT1 A 0 A_JumpIfInventory("ThunderSpellInv",1,"Ready_ThunderZoom")
	    EBOW AAAEEE 1 A_WeaponReady(WRF_ALLOWZOOM)
	    Goto Ready
	Ready_Ice:
		PBOW A 0 A_JumpIfInventory("MP", 6, 2)
		PBOW A 0 A_TakeInventory("IceSpellInv")
		Goto Ready
		PBOW AAAEEE 1 A_WeaponReady
		Goto Ready
	Ready_Fire:
		PBOW A 0 A_JumpIfInventory("MP", 4, 2)
		PBOW A 0 A_TakeInventory("FireSpellInv")
		Goto Ready
		PBO2 AAAEEE 1 A_WeaponReady
		Goto Ready
	Ready_Thunder:
		PBOW A 0 A_JumpIfInventory("MP", 8, 2)
		PBOW A 0 A_TakeInventory("ThunderSpellInv")
		Goto Ready
		PBO3 AAAEEE 1 A_WeaponReady
		Goto Ready
	Ready_IceZoom:
		PBOW A 0 A_JumpIfInventory("MP", 6, 2)
		PBOW A 0 A_TakeInventory("IceSpellInv")
		Goto Ready
		PBOW AAAEEE 1 A_WeaponReady(WRF_ALLOWZOOM)
		Goto Ready
	Ready_FireZoom:
		PBOW A 0 A_JumpIfInventory("MP", 4, 2)
		PBOW A 0 A_TakeInventory("FireSpellInv")
		Goto Ready
		PBO2 AAAEEE 1 A_WeaponReady(WRF_ALLOWZOOM)
		Goto Ready
	Ready_ThunderZoom:
		PBOW A 0 A_JumpIfInventory("MP", 8, 2)
		PBOW A 0 A_TakeInventory("ThunderSpellInv")
		Goto Ready
		PBO3 AAAEEE 1 A_WeaponReady(WRF_ALLOWZOOM)
		Goto Ready
	Spawn:
		BWPU A -1
		Stop
	Fire:
		TNT1 A 0 A_TakeInventory("EnchantedBowHoldCheck",1)
		TNT1 A 0 A_JumpIfInventory("Mana1",2,1)
		Goto NoMana
		TNT1 A 0 A_JumpIfInventory("IceSpellInv",1,"Fire_Ice")
		TNT1 A 0 A_JumpIfInventory("FireSpellInv",1,"Fire_Fire")
		TNT1 A 0 A_JumpIfInventory("ThunderSpellInv",1,"Fire_Thunder")
		EBOW B 3
		EBOW C 3 A_PlayWeaponSound("HunterBowPull")
		EBOW D 3 A_GunFlash
		Goto Hold
	NoMana:
		DBOW B 3
		DBOW C 3 A_PlayWeaponSound("HunterBowPull")
		DBOW D 3 A_GunFlash
		Goto Hold
	Hold:
		TNT1 A 0 A_JumpIfInventory("Mana1",2,1)
		Goto NoManaHold
		TNT1 A 0 A_JumpIfInventory("IceSpellInv",1,"Hold_Ice")
		TNT1 A 0 A_JumpIfInventory("FireSpellInv",1,"Hold_Fire")
		TNT1 A 0 A_JumpIfInventory("ThunderSpellInv",1,"Hold_Thunder")
		EBOW D 1
		EBOW D 0 A_Refire
		EBOW D 0 A_GiveInventory("MarksmanFocusCheck", 1)
		EBOW D 0 A_GiveInventory("EnchantedBowHoldCheck",1)
		TNT1 A 0 A_AlertMonsters
		NULL A 0 A_FireCustomMissile("MagicalArrow",0,1,8,0)
		DBOW E 4 A_PlayWeaponSound("HunterBowFire")
		DBOW F 4
		EBOW BA 4
		Goto Ready
	NoManaHold:
		DBOW D 1
		DBOW D 0 A_Refire
		DBOW D 0 A_GiveInventory("MarksmanFocusCheck", 1)
		DBOW D 0 A_GiveInventory("EnchantedBowHoldCheck",1)
		TNT1 A 0 A_AlertMonsters
		NULL A 0 A_FireCustomMissile("NormalArrow",0,0,8,0)
		DBOW E 4 A_PlayWeaponSound("HunterBowFire")
		DBOW F 4
		DBOW BA 4
		Goto Ready
	Fire_Ice:
		PBOW B 4
		PBOW C 4 A_PlayWeaponSound("HunterBowPull")
		PBOW D 3 A_GunFlash
		Goto Hold
	Hold_Ice:
		PBOW D 1
		PBOW D 0 A_Refire
		PBOW D 0 A_GiveInventory("MarksmanFocusCheck", 1)
		PBOW D 0 A_GiveInventory("EnchantedBowHoldCheck",1)
		TNT1 A 0 A_TakeInventory("MP", 6)
		TNT1 A 0 A_JumpIfInventory("IceArrowSkill", 7, "Hold_Ice3")
		TNT1 A 0 A_JumpIfInventory("IceArrowSkill", 4, "Hold_Ice2")
		TNT1 A 0 A_AlertMonsters
		NULL A 0 A_FireCustomMissile("IceArrow",frandom(-5,5),0,8,0)
		NULL A 0 A_FireCustomMissile("IceArrow2",0,1,8,0)
		NULL A 0 A_FireCustomMissile("IceArrow",frandom(-5,5),0,8,0)
		NULL A 0 A_PlaySoundEx("HunterIceArrowFire",0)
		DBOW E 4 A_PlayWeaponSound("HunterBowFire")
		DBOW F 4
		PBOW BA 4
		Goto Ready
	Hold_Ice2:
		TNT1 A 0 A_AlertMonsters
		NULL A 0 A_FireCustomMissile("IceArrow2", 0, 1, 8, 0)
		TNT1 A 0 A_FireCustomMissile("IceArrow", frandom(-5,5), 0, 8, 0)
		TNT1 A 0 A_FireCustomMissile("IceArrow", frandom(-5,5), 0, 8, 0)
		TNT1 A 0 A_FireCustomMissile("IceArrow", frandom(-5,5), 0, 8, 4)
		TNT1 A 0 A_FireCustomMissile("IceArrow", frandom(-5,5), 0, 8, -4)
		NULL A 0 A_PlaySoundEx("HunterIceArrowFire",0)
		DBOW E 4 A_PlayWeaponSound("HunterBowFire")
		DBOW F 4
		PBOW BA 4
		Goto Ready
	Hold_Ice3:
		TNT1 A 0 A_AlertMonsters
		NULL A 0 A_FireCustomMissile("IceArrow2", 0, 1, 8, 0)
		TNT1 A 0 A_FireCustomMissile("IceArrow", frandom(-5,5), 0, 8, 0)
		TNT1 A 0 A_FireCustomMissile("IceArrow", frandom(-5,5), 0, 8, 0)
		TNT1 A 0 A_FireCustomMissile("IceArrow", frandom(-5,5), 0, 8, 4)
		TNT1 A 0 A_FireCustomMissile("IceArrow", frandom(-5,5), 0, 8, -4)
		TNT1 A 0 A_FireCustomMissile("IceArrow", frandom(-5,5), 0, 8, 4)
		TNT1 A 0 A_FireCustomMissile("IceArrow", frandom(-5,5), 0, 8, -4)
		NULL A 0 A_PlaySoundEx("HunterIceArrowFire",0)
		DBOW E 4 A_PlayWeaponSound("HunterBowFire")
		DBOW F 4
		PBOW BA 4
		Goto Ready
	Fire_Fire:
		PBO2 B 4
		PBO2 C 4 A_PlayWeaponSound("HunterBowPull")
		PBO2 D 3 A_GunFlash
		Goto Hold
	Hold_Fire:
		PBO2 D 1
		PBO2 D 0 A_Refire
		PBO2 D 0 A_GiveInventory("MarksmanFocusCheck", 1)
		PBO2 D 0 A_GiveInventory("EnchantedBowHoldCheck",1)
		TNT1 A 0 A_TakeInventory("MP", 4)
		TNT1 A 0 A_AlertMonsters
		NULL A 0 A_FireCustomMissile("FlameArrow",0,1,8,0)
		//NULL A 0 A_PlaySoundEx("HunterFireArrowFire",0)
		DBOW E 4 A_PlayWeaponSound("HunterBowFire")
		DBOW F 4
		PBO2 BA 4
		Goto Ready
	Fire_Thunder:
		PBO3 B 4
		PBO3 C 4 A_PlayWeaponSound("HunterBowPull")
		PBO3 D 3 A_GunFlash
		Goto Hold
	Hold_Thunder:
		PBO3 D 1
		PBO3 D 0 A_Refire
		PBO3 D 0 A_GiveInventory("MarksmanFocusCheck", 1)
		PBO3 D 0 A_GiveInventory("EnchantedBowHoldCheck",1)
		TNT1 A 0 A_TakeInventory("MP", 8)
		TNT1 A 0 A_JumpIfInventory("LightningArrow", 7, "Hold_Thunder2")
		TNT1 A 0 A_JumpIfInventory("LightningArrow", 4, "Hold_Thunder2")
		TNT1 A 0 A_AlertMonsters
		NULL A 0 A_RailAttack(ACS_NamedExecuteWithResult("WOC Player Scale", 100, AGILITY, ABIL_LIGHTNINGARROW, ACTIVATOR), 8, 1, "none", "yellow", 0, 999, "LightningArrowPuff")
		NULL A 0 A_PlaySoundEx("HunterLightningArrowFire",0)
		DBOW E 4 A_PlayWeaponSound("HunterBowFire")
		DBOW F 4
		PBO3 BA 4
		Goto Ready
	Hold_Thunder2:
		TNT1 A 0 A_AlertMonsters
		NULL A 0 A_RailAttack(ACS_NamedExecuteWithResult("WOC Player Scale", 110, AGILITY, ABIL_LIGHTNINGARROW, ACTIVATOR), 8, 1, "none", "yellow", 0, 999, "LightningArrowPuff")
		NULL A 0 A_RailAttack(00, 8, 0, "none", "yellow", 0, 999, "LightningArrowPuff")
		NULL A 0 A_RailAttack(00, 8, 0, "none", "yellow", 0, 999, "LightningArrowPuff")
		NULL A 0 A_PlaySoundEx("HunterLightningArrowFire",0)
		DBOW E 4 A_PlayWeaponSound("HunterBowFire")
		DBOW F 4
		PBO3 BA 4
		Goto Ready
	Hold_Thunder3:
		TNT1 A 0 A_AlertMonsters
		NULL A 0 A_RailAttack(ACS_NamedExecuteWithResult("WOC Player Scale", 120, AGILITY, ABIL_LIGHTNINGARROW, ACTIVATOR), 8, 1, "none", "yellow", 0, 999, "LightningArrowPuff")
		NULL A 0 A_RailAttack(00, 8, 0, "none", "yellow", 0, 999, "LightningArrowPuff")
		NULL A 0 A_RailAttack(00, 8, 0, "none", "yellow", 0, 999, "LightningArrowPuff")
		NULL A 0 A_RailAttack(00, 8, 0, "none", "yellow", 0, 999, "LightningArrowPuff")
		NULL A 0 A_RailAttack(00, 8, 0, "none", "yellow", 0, 999, "LightningArrowPuff")
		//NULL A 0 A_RailAttack(ACS_NamedExecuteWithResult("WOC Player Scale", 50, AGILITY, ABIL_LIGHTNINGARROW, ACTIVATOR), 8, 0, "none", "none", RGF_NOPIERCING, 0, "LightningArrowPuff")
		NULL A 0 A_PlaySoundEx("HunterLightningArrowFire",0)
		DBOW E 4 A_PlayWeaponSound("HunterBowFire")
		DBOW F 4
		PBO3 BA 4
		Goto Ready
	AltFire:
		DBOW A 1 A_JumpIfInventory("Mana1",2,1)
		Goto Ready
		EBOW A 0 A_JumpIfInventory("ThunderSpellInv", 1, "ThunderSpellInv")
		EBOW A 0 A_JumpIfInventory("IceSpellInv", 1, "IceSpellInv")
		EBOW A 0 A_JumpIfInventory("FireArrowSkill", 1, "FireSpellInv")
		EBOW AE 3
		Goto Ready
	FireSpellInv:
		EBOW A 0 A_JumpIfInventory("FireSpellInv", 1, 3)
		PBO2 AE 3 A_GiveInventory("FireSpellInv", 1)
		Goto Ready
		EBOW A 0 A_TakeInventory("FireSpellInv", 1)
		EBOW A 0 A_TakeInventory("IceSpellInv", 1)
		EBOW A 0 A_TakeInventory("ThunderSpellInv", 1)
		EBOW A 0 A_JumpIfInventory("IceArrowSkill", 1, "IceSpellInv")
		EBOW AE 3
		Goto Ready
	IceSpellInv:
		EBOW A 0 A_JumpIfInventory("IceSpellInv", 1, 3)
		PBOW AE 3 A_GiveInventory("IceSpellInv", 1)
		Goto Ready
		EBOW A 0 A_TakeInventory("FireSpellInv", 1)
		EBOW A 0 A_TakeInventory("IceSpellInv", 1)
		EBOW A 0 A_TakeInventory("ThunderSpellInv", 1)
		EBOW A 0 A_JumpIfInventory("LightningArrow", 1, "ThunderSpellInv")
		EBOW AE 3
		Goto Ready
	ThunderSpellInv:
		EBOW A 0 A_JumpIfInventory("ThunderSpellInv", 1, 3)
		PBO3 AE 3 A_GiveInventory("ThunderSpellInv", 1)
		Goto Ready
		EBOW A 0 A_TakeInventory("FireSpellInv", 1)
		EBOW A 0 A_TakeInventory("IceSpellInv", 1)
		EBOW AE 3 A_TakeInventory("ThunderSpellInv", 1)
		Goto Ready
	Flash:
		TNT1 A 0 A_JumpIfInventory("IsMarksman",1,2)
		TNT1 A 0 A_GiveInventory("EnchantedBowSpeed",1)
		TNT1 A 0 A_JumpIfInventory("Mana1",2,1)
		Goto Flash_Normal
		TNT1 A 0 A_JumpIfInventory("FireSpellInv",1,"Flash_Fire")
		TNT1 A 0 A_JumpIfInventory("IceSpellInv",1,"Flash_Ice")
		TNT1 A 0 A_JumpIfInventory("ThunderSpellInv",1,"Flash_Thunder")
		EBOW DDDDFFFF 1 A_JumpIfInventory("EnchantedBowHoldCheck",1,"Goaway")
		Goto Flash
	Flash_Fire:
		PBO2 DDDDFFFF 1 A_JumpIfInventory("EnchantedBowHoldCheck",1,"Goaway")
		Goto Flash
	Flash_Ice:
		PBOW DDDDFFFF 1 A_JumpIfInventory("EnchantedBowHoldCheck",1,"Goaway")
		Goto Flash
	Flash_Thunder:
		PBO3 DDDDFFFF 1 A_JumpIfInventory("EnchantedBowHoldCheck",1,"Goaway")
		Goto Flash
	Flash_Normal:
		TNT1 A 1 A_JumpIfInventory("EnchantedBowHoldCheck",1,"Goaway")
		Goto Flash
	Goaway:
		TNT1 A 0 A_TakeInventory("EnchantedBowHoldCheck",1)
		TNT1 A 0 A_TakeInventory("PowerEnchantedBowSpeed",1)
		stop
	Zoom:
		TNT1 A 0 A_JumpIfInventory("PowerIsZoom",1,"ReadyZoom")
		TNT1 A 0 A_JumpIfInventory("PowerZoomLevel2",1,"UnZoom")
		TNT1 A 0 A_JumpIfInventory("PowerZoomLevel1",1,"Zoom2")
		TNT1 A 0 A_ZoomFactor(2.0)
		TNT1 A 0 A_TakeInventory("PowerZoomLevel2",1)
		TNT1 A 0 A_GiveInventory("PowerZoomLevel1",1)
		TNT1 A 0 A_GiveInventory("PowerIsZoom",1)
		Goto Ready
	Zoom2:
		TNT1 A 0 A_ZoomFactor(4.0)
		TNT1 A 0 A_TakeInventory("PowerZoomLevel1",1)
		TNT1 A 0 A_GiveInventory("PowerZoomLevel2",1)
		TNT1 A 0 A_GiveInventory("PowerIsZoom",1)
		Goto Ready
	UnZoom:
		TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_GiveInventory("PowerIsZoom",1)
		TNT1 A 0 A_TakeInventory("PowerZoomLevel1",1)
		TNT1 A 0 A_TakeInventory("PowerZoomLevel2",1)
		Goto Ready
	}
}

Actor LightningArrowPuff : BulletPuff
{
	Damagetype "LightningPlayer"
	+MTHRUSPECIES /*+NODAMAGETHRUST*/ +DONTBLAST
}

ACTOR EnchantedBowHoldCheck : WoC_Boolean {}
ACTOR EnchantedBowSpeedCheck : WoC_Boolean {}

Actor EnchantedBowSpeed : PowerupGiver
{
	+INVENTORY.AUTOACTIVATE
	Inventory.MaxAmount 0
	Powerup.Type EnchantedBowSpeed
}

Actor PowerEnchantedBowSpeed : PowerSpeed
{
	Speed 0.6
	Powerup.Duration 35
	+PowerSpeed.NoTrail
	Inventory.Icon ""
}

ACTOR FlameArrow : FastProjectile
{ 
	Obituary "%o was burned alive by %k's fire arrows." 
	Radius 7 
	Height 6 
	Speed 132
	Decal "Scorch"
	Scale .5
	Obituary "%o was scorched by %k's fire arrows." 
	PROJECTILE 
	+NOGRAVITY
	/*+NODAMAGETHRUST*/ +DONTBLAST
	+FORCERADIUSDMG
	+MTHRUSPECIES /*+NODAMAGETHRUST*/ +DONTBLAST
	Damagetype "Fire"
	renderstyle add
	alpha 1.0
	SeeSound "firearrow/shoot"
	DeathSound "HunterFireArrowImpact"
	States 
	{ 
	Spawn:
		FARW A 1 bright A_SpawnItemEx("Flamearrowtrail",0,0,0,0,0,0,0,128)
		Loop
	Death: 
		FARW A 0 A_Explode(ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(60,80), AGILITY, ABIL_FIREARROW, WOCTARGET),128,0,0,8)
		FARW A 0 A_JumpIfInTargetInventory("FireArrowSkill",7,"SuperDeath2")
		FARW A 0 A_JumpIfInTargetInventory("FireArrowSkill",4,"SuperDeath1")
		MSP1 GHIJKLMNOP 2 bright A_FadeOut(0.05)
		Stop 
	SuperDeath1:
		FARW AAAAA 0 A_CustomMissile("FlameArrowVolcanoTBlast",0,0,frandom(0,359),6,frandom(40,60))
		MSP1 GHIJKLMNOP 2 bright A_FadeOut(0.05)
		Stop
	SuperDeath2:
		FARW AAAAAAAAAA 0 A_CustomMissile("FlameArrowVolcanoTBlast",0,0,frandom(0,359),6,frandom(40,60))
		MSP1 GHIJKLMNOP 2 bright A_FadeOut(0.05)
		Stop 
	} 
}

ACTOR FlameArrowVolcanoTBlast
{
	Radius 4
	Height 3
	Speed 10
	Damage (ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(6,10), AGILITY, ABIL_FIREARROW, WOCTARGET))
	+MTHRUSPECIES /*+NODAMAGETHRUST*/ +DONTBLAST
	Scale 0.75
	+NOBLOCKMAP
	+MISSILE
	+DROPOFF
	+NOTELEPORT
	Damagetype "Fire"
	Renderstyle Add
	States
	{
	Spawn:
		VTFB AB 4 BRIGHT
		Loop
	Death:
		SFFI CBABCDE 4 BRIGHT
		Stop
	}
}

ACTOR Flamearrowtrail
{
	- SOLID
	+NOGRAVITY
	+CLIENTSIDEONLY
	+NOCLIP
	+NOINTERACTION
	alpha 0.7
	renderstyle add
	States
	{
	Spawn:
		WBAL CCDDEE 1 bright A_Fadeout(0.05)
		Stop
	}
}

ACTOR IceSpellInv : WoC_Boolean {}
ACTOR FireSpellInv : WoC_Boolean {}
ACTOR ThunderSpellInv : WoC_Boolean {}


actor MagicalArrow : FastProjectile
{
	PROJECTILE
	+MTHRUSPECIES /*+NODAMAGETHRUST*/ +DONTBLAST
	scale 0.4
	Speed 140
	Height	7
	Radius	6
	renderstyle add
	DeathSound "HunterManaArrowImpact"
	Damage (ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(60,80), AGILITY, ABIL_RANGEDMASTERY, WOCTARGET))
	Damagetype "Arcane"
	states
	{
	Spawn:
		GOSS A 1 Bright A_SpawnItemEx("MagicalArrowTrail", -(MomX/1.2), -(MomY/1.2), (MomZ/1.2*-1), (MomX/1.5), (MomY/1.5), (MomZ/1.5), 0, 138)
		Loop
		Death:
		OXPL ABCDEFGHIJKLM 1 Bright A_FadeOut(0.01)
		stop
	}
}

actor NormalArrow : FastProjectile
{
	PROJECTILE
	+MTHRUSPECIES /*+NODAMAGETHRUST*/ +DONTBLAST
	+THRUGHOST
	+WINDTHRUST
	+BLOODSPLATTER
	Speed 140
	Scale 0.5
	Height	7
	Radius	6
	renderstyle Translucent
	DeathSound "HunterBowHit"
	Damage (ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(30,40), AGILITY, ABIL_RANGEDMASTERY, WOCTARGET))
	Damagetype "Physical"
	states
	{
	Spawn:
		ARRO AAAAAAAAAA 1 A_SpawnItemEx("NormalArrowTrail", -(MomX/1.2), -(MomY/1.2), (MomZ/1.2*-1), (MomX/1.5), (MomY/1.5), (MomZ/1.5), 0, 138)
		ARRO A 0 A_Changeflag("NOGRAVITY", 0)
		ARRO A 0 A_Changeflag("LOWGRAVITY", 1)
		Loop
	Death:
		ARRO A 1 A_SpawnItemEx("NormalArrowDrop",0,0,0,0,0,0,0,32,0)
		Stop
	}
}

ACTOR NormalArrowDrop
{ 
	Scale .5
	Radius 6
	Height 2 
	States 
	{ 
	Spawn: 
		ARRO A 35
		ARRO A 1 A_FadeOut(0.1)
		Wait
	} 
}

Actor NormalArrowTrail
{
	Radius 6
	Height 7
	-SOLID
	+NOBLOCKMAP
	RenderStyle Add
	Alpha 0.5
	Scale 0.5
	+PAINLESS
	+CLIENTSIDEONLY
	+NOGRAVITY
	+NOTELEPORT
	+NOINTERACTION
	States
	{
	Spawn:
		ARRO A 1 Bright A_FadeOut(0.1)
		Loop
	}
}

Actor MagicalArrowTrail
{
	Radius 6
	Height 7
	-SOLID
	+NOBLOCKMAP
	RenderStyle Add
	Alpha 0.5
	Scale 0.8
	+PAINLESS
	+CLIENTSIDEONLY
	+NOGRAVITY
	+NOTELEPORT
	+NOINTERACTION
	States
	{
	Spawn:
		MART AABBCCDDEE 1 Bright A_FadeOut(0.05)
		Loop
	}
}

ACTOR IceArrow
{ 
	Obituary "%o was frozen by %k's ice arrows." 
	Radius 6
	Height 8
	Speed 76
	Scale 1
	Damage (ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(15,30), AGILITY, ABIL_ICEARROW, WOCTARGET))
	PROJECTILE 
	damagetype "Ice"
	renderstyle add
	+NOGRAVITY 
	+NOEXTREMEDEATH
	+THRUGHOST
	+WINDTHRUST
	+MTHRUSPECIES /*+NODAMAGETHRUST*/ +DONTBLAST
	+SPAWNSOUNDSOURCE
	+DOOMBOUNCE
	BounceFactor 1.0
	BounceCount 4
	alpha 1.0
	SeeSound "HunterIceArrowFire"
	DeathSound "HunterIceArrowImpact"
	States 
	{ 
	Spawn:
		SHRD A 0 bright A_SpawnItemEx("Icearrowtrail",0,0,0,0,0,0,0,128) 
		SHRD A 1 Bright A_SpawnItemEx("FrostMissileFog", 0, 0, 1, 4, 0, frandom(-0.5, 0.5), frandom(-10, 10), 128)
		SHRD A 0 bright A_SpawnItemEx("Icearrowtrail",0,0,0,0,0,0,0,128) 
		SHRD A 1 Bright A_SpawnItemEx("FrostMissileFog", 0, 0, 1, 4, 0, frandom(-0.5, 0.5), frandom(-10, 10), 128)
		SHRD B 0 bright A_SpawnItemEx("Icearrowtrail",0,0,0,0,0,0,0,128) 
		SHRD B 1 Bright A_SpawnItemEx("FrostMissileFog", 0, 0, 1, 4, 0, frandom(-0.5, 0.5), frandom(-10, 10), 128)
		SHRD B 0 bright A_SpawnItemEx("Icearrowtrail",0,0,0,0,0,0,0,128) 
		SHRD B 1 Bright A_SpawnItemEx("FrostMissileFog", 0, 0, 1, 4, 0, frandom(-0.5, 0.5), frandom(-10, 10), 128)
		SHRD C 0 bright A_SpawnItemEx("Icearrowtrail",0,0,0,0,0,0,0,128) 
		SHRD C 1 Bright A_SpawnItemEx("FrostMissileFog", 0, 0, 1, 4, 0, frandom(-0.5, 0.5), frandom(-10, 10), 128)
		SHRD C 0 bright A_SpawnItemEx("Icearrowtrail",0,0,0,0,0,0,0,128) 
		SHRD C 1 Bright A_SpawnItemEx("FrostMissileFog", 0, 0, 1, 4, 0, frandom(-0.5, 0.5), frandom(-10, 10), 128)
		Loop
	Death: 
		SHEX ABCDEFGHIJ 2 bright A_FadeOut(0.05)
		Stop 
	} 
} 

Actor IceArrow2 : IceArrow
{
	Damage (ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(35,55), AGILITY, ABIL_ICEARROW, WOCTARGET))
}

ACTOR Icearrowtrail
{
	- SOLID
	+NOGRAVITY
	+CLIENTSIDEONLY
	+DONTBLAST
	alpha 1
	renderstyle add
	scale 0.3
	States
	{
	Spawn:
		CRYT AABBCCDD 1 bright A_FadeOut
		Stop
	}
}