@name The Dragon Slayer
@inputs 
@outputs 
@persist Crowbar
interval(100)

if(first()) {

owner():weapon():setMaterial("models/effects/vol_light001")

#Blade    
holoCreate(1)
holoModel(1,"prism")
holoScale(1,+vec(0.5,0.05,4))
holoColor(1,vec(255,255,255))
holoAng(1,owner():attachmentAng("anim_attachment_RH"))
holoPos(1,owner():attachmentPos("anim_attachment_RH"))
holoParentAttachment(1,owner(),"anim_attachment_RH")
holoMaterial(1,"phoenix_storms/chrome")
holoPos(1,holoEntity(1):toWorld(vec(0,0,33)))
holoAng(1,holoEntity(1):toWorld(ang(0,0,0)))

#Spikes on Blade
holoCreate(2)
holoModel(2,"tetra")
holoScale(2,+vec(0.03,0.5,0.5))
holoColor(2,vec(255,255,255))
holoAng(2,owner():attachmentAng("anim_attachment_RH"))
holoPos(2,owner():attachmentPos("anim_attachment_RH"))
holoParentAttachment(2,owner(),"anim_attachment_RH")
holoMaterial(2,"phoenix_storms/chrome")
holoPos(2,holoEntity(2):toWorld(vec(4,0,13)))
holoAng(2,holoEntity(2):toWorld(ang(0,90,58)))

holoCreate(3)
holoModel(3,"tetra")
holoScale(3,+vec(0.03,0.5,0.5))
holoColor(3,vec(255,255,255))
holoAng(3,owner():attachmentAng("anim_attachment_RH"))
holoPos(3,owner():attachmentPos("anim_attachment_RH"))
holoParentAttachment(3,owner(),"anim_attachment_RH")
holoMaterial(3,"phoenix_storms/chrome")
holoPos(3,holoEntity(3):toWorld(vec(-4,0,13)))
holoAng(3,holoEntity(3):toWorld(ang(0,-90,58)))

#Bar Between Blade and Handle
holoCreate(4)
holoModel(4,"cube")
holoScale(4,+vec(0.9,0.2,0.2))
holoColor(4,vec(255,255,255))
holoAng(4,owner():attachmentAng("anim_attachment_RH"))
holoPos(4,owner():attachmentPos("anim_attachment_RH"))
holoParentAttachment(4,owner(),"anim_attachment_RH")
holoMaterial(4,"models/XQM/BoxFull_diffuse")
holoPos(4,holoEntity(4):toWorld(vec(0,0,9.5)))
holoAng(4,holoEntity(4):toWorld(ang(0,0,0)))

holoCreate(5)
holoModel(5,"cube")
holoScale(5,+vec(0.7,0.2,0.2))
holoColor(5,vec(255,255,255))
holoAng(5,owner():attachmentAng("anim_attachment_RH"))
holoPos(5,owner():attachmentPos("anim_attachment_RH"))
holoParentAttachment(5,owner(),"anim_attachment_RH")
holoMaterial(5,"models/XQM/BoxFull_diffuse")
holoPos(5,holoEntity(5):toWorld(vec(-7.7,0,11.9)))
holoAng(5,holoEntity(5):toWorld(ang(40,0,0)))

holoCreate(6)
holoModel(6,"cube")
holoScale(6,+vec(0.7,0.2,0.2))
holoColor(6,vec(255,255,255))
holoAng(6,owner():attachmentAng("anim_attachment_RH"))
holoPos(6,owner():attachmentPos("anim_attachment_RH"))
holoParentAttachment(6,owner(),"anim_attachment_RH")
holoMaterial(6,"models/XQM/BoxFull_diffuse")
holoPos(6,holoEntity(6):toWorld(vec(7.7,0,11.9)))
holoAng(6,holoEntity(6):toWorld(ang(-40,0,0)))

#Handle
holoCreate(7)
holoModel(7,"pyramid")
holoScale(7,+vec(0.5,0.2,0.6))
holoColor(7,vec(0,255,255))
holoAng(7,owner():attachmentAng("anim_attachment_RH"))
holoPos(7,owner():attachmentPos("anim_attachment_RH"))
holoParentAttachment(7,owner(),"anim_attachment_RH")
holoMaterial(7,"phoenix_storms/black_chrome")
holoPos(7,holoEntity(7):toWorld(vec(0,0,4.8)))
holoAng(7,holoEntity(7):toWorld(ang(180,0,0)))

holoCreate(8)
holoModel(8,"hqcylinder2")
holoScale(8,+vec(0.2,0.2,1.2))
holoColor(8,vec(0,0,255))
holoAng(8,owner():attachmentAng("anim_attachment_RH"))
holoPos(8,owner():attachmentPos("anim_attachment_RH"))
holoParentAttachment(8,owner(),"anim_attachment_RH")
holoMaterial(8,"phoenix_storms/black_chrome")
holoPos(8,holoEntity(8):toWorld(vec(0,0,2)))
holoAng(8,holoEntity(8):toWorld(ang(0,0,0)))
}

if(owner():weapon():type()=="weapon_crowbar" & !Crowbar){ #owner():weapon():type()=="weapon_crowbar|
    Crowbar = 1
    owner():weapon():setMaterial("models/effects/vol_light001")
    holoAlpha(1,255)
    holoAlpha(2,255)
    holoAlpha(3,255)
    holoAlpha(4,255)
    holoAlpha(5,255)
    holoAlpha(6,255)
    holoAlpha(7,255)
    holoAlpha(8,255)
}

elseif(owner():weapon():type()!="weapon_crowbar" & Crowbar) {
    Crowbar = 0
    holoAlpha(1,0)
    holoAlpha(2,0)
    holoAlpha(3,0)
    holoAlpha(4,0)
    holoAlpha(5,0)
    holoAlpha(6,0)
    holoAlpha(7,0)
    holoAlpha(8,0)
}
