@name Sassy V
@persist Quota S Near
@persist [V O U]:vector
@persist [A]:angle
@persist [Snd]:array
@persist [T E]:entity
@model models/hunter/blocks/cube075x075x025.mdl
if(first())
{
    entity():setAlpha(0)
    entity():propFreeze(0)
    
    runOnTick(1)
    runOnChat(1)
    
    holoCreate(1)
    holoModel(1,"models/sprops/misc/alphanum/alphanum_v.mdl")
    holoAng(1,entity():toWorld(ang(0,0,90)))
    holoScale(1,vec(3))
    holoMaterial(1,"models/shiny")
    holoParent(1,entity())
    
    I = 1
    Snd[I,string]="vo/spy_dominationdemoman07.wav"
    I++
    Snd[I,string]="vo/spy_dominationengineer04.wav"
    I++
    Snd[I,string]="vo/spy_dominationengineer05.wav"
    I++
    Snd[I,string]="vo/spy_dominationengineer06.wav"
    I++
    Snd[I,string]="vo/spy_dominationheavy01.wav"
    I++
    Snd[I,string]="vo/spy_dominationheavy02.wav"
    I++
    Snd[I,string]="vo/spy_dominationheavy06.wav"
    I++
    Snd[I,string]="vo/spy_dominationheavy07.wav"
    I++
    Snd[I,string]="vo/spy_dominationheavy08.wav"
    I++
    Snd[I,string]="vo/spy_dominationmedic02.wav"
    I++
    Snd[I,string]="vo/spy_dominationmedic04.wav"
    I++
    Snd[I,string]="vo/spy_dominationpyro02.wav"
    I++
    Snd[I,string]="vo/spy_dominationscout05.wav"
    I++
    Snd[I,string]="vo/spy_dominationscout06.wav"
    I++    
    Snd[I,string]="vo/spy_dominationsniper02.wav"
    I++    
    Snd[I,string]="vo/spy_dominationsniper04.wav"
    I++    
    Snd[I,string]="vo/spy_dominationsoldier01.wav"
    I++    
    Snd[I,string]="vo/spy_jaratehit03.wav"
    I++
    
    function say()
    {
        stoptimer("say")
        S++
        if(S==Quota)
        {
            soundPlay("say",4.9,"vo/spy_dominationscout01.wav")
            soundVolume("say",5)
            T = players()[randint(numPlayers()),entity]
            Quota = randint(3,12)
            S = 0
        }else
        {
            soundPlay("say",5.9,Snd[randint(Snd:count()),string])
            soundVolume("say",5)
            timer("say",random(6000,12500))
        }
    }
    
    E = entity()
    
    T = players()[randint(numPlayers()),entity]
    
    #[
    Copy and paste the below part and paste a sound path inside the quotes to play it.
    Snd[I,string]=""
    I++
    ]#
    
    function entity:turnTo(Tarang:angle){
        V = This:toLocal(rotationVector(quat(Tarang)/quat(This))+This:pos())
        This:applyTorque((50*V - 10*This:angVelVector())*This:inertia()/2)
    }
    function entity:goto(Vector:vector){
        This:applyForce(((Vector-This:pos())*25-entity():vel())*entity():mass())   
    }
}

if(chatClk(owner()))
{
    LS = owner():lastSaid():lower():explode(" ")
    if(LS[1,string]=="annoy")
    {
        TP = findPlayerByName(LS[2,string])
        if(TP:isValid())
        {
            hint("Found player. Name: "+TP:name()+"... Targeting...",5)
            T = TP
            soundPlay("say",4.9,"vo/spy_dominationscout01.wav")
            soundVolume("say",5)
            Quota = randint(3,12)
            S = 0
        }else
        {
            hint("Player not found",3)
        }
    }
}

Near = E:pos():distance(T:pos())<100
if(changed(Near)&&Near)
{
    if(S<1)
    {
        Quota = randint(3,12)
        say()
        timer("say",random(6000,12500))
    }
}

if(clk("say"))
{
    say()
}


U = vec(0,0,((T:pos():z()+40)-entity():pos():z())/7.5)
O = entity():up():normalized():setZ(0)*clamp((T:pos():distance(E:pos()))/20,0.5,70)*!Near
V = entity():pos()+U+O
entity():goto(V)

A = (T:pos()-E:pos()):normalized():toAngle():setPitch(0):setRoll(90)+ang(180,90,0)
E:turnTo(A)
