@name FailCake PHONE RINGING V1
@inputs
@outputs Screen CallScreen
@persist Ring Talk Call Say Mat

## The Phone Cab is in adv.duplicator , just spawn the E2#

if(first()){
    hint("Made By FailCake",100)
}
interval(1000)
E = entity()
Call += 1
CallScreen = Call

if(Call == 3){
    E:soundPlay(10000,10000,"music/HL2_intro.mp3") 
    
    concmd("say |FailCake Phone| : Someone is Calling...")
}
if(Call == 5){
     concmd("say |FailCake Phone| : PickUP THE PHONE!")
}
if( Call == 65){
    holoDelete(3)
    holoDelete(3)
    holoDelete(2)
    holoDelete(2)
    holoDelete(1) 
    holoDelete(1)
    holoDelete(4)
    holoDelete(4)
    soundStop(999)
    soundStop(10000)
    concmd("say |FailCake Phone| : The Call is Over :( ")
}

if( Call > 59){
    holoDelete(3)
    holoDelete(2)
    holoDelete(1)
    holoDelete(4)
    soundStop(999)
}
if(Call > 1 & Call < 60){
findIncludeClass("player")
Fsphere = findInSphere(entity():pos(), 80)
O = findClosest(entity():pos())  
if(Fsphere > 0){
if(Fsphere > 0){  
Say += 1
if(Say == 2){
    concmd("say |FailCake Phone| : "+O:name()+" Has Picked Up Phone..") 
}
}elseif(Say > 30){
Say = 0
}
interval(1000) 
Mat += 1       
Talk += 1
Screen = Talk
if(Mat == 8){
    E:soundPlay(10000,10000,"music/HL2_intro.mp3")
    holoCreate(2) 
    holoAlpha(2,200)
    soundPlay(40000,40000,"ambient/energy/whiteflash.wav")
    holoMaterial(2,"models/props_combine/portalball001_sheet") 
}
if(Mat == 14){
    holoMaterial(2,"matsys_regressiontest/background") 
}
if(Mat == 15){
    holoMaterial(2,"models/props_combine/portalball001_sheet") 
}
if(Mat == 17){
    holoMaterial(2,"perftest/gman/gman_face2") 
}
if(Mat == 18){
    holoMaterial(2,"models/props_combine/portalball001_sheet") 
}
if(Mat == 24){
    holoMaterial(2,"") 
}
if(Mat == 25){
    holoMaterial(2,"models/props_combine/portalball001_sheet") 
}
holoCreate(1)
holoModel(1,"cube")
holoScale(1,vec(-12,-12,-12))
holoColor(1,vec(1,1,1))
holoAng(1,ang(0,0,0))
holoPos(1,E:pos()+vec(0,0,0))
holoParent(1,E) 
holoMaterial(1,"models/debug/debugwhite") 

holoModel(2,"cube")
holoScale(2,vec(-11,-11,-11))
holoColor(2,vec(250,250,250))
holoAng(2,ang(0,0,0))
holoPos(2,E:pos()+vec(0,0,0))
holoParent(2,E) 

holoCreate(4)
holoModel(4,"cube")
holoScale(4,vec(-13,-13,-0.1))
holoColor(4,vec(1,1,1))
holoAng(4,ang(0,0,0))
holoPos(4,E:pos()+vec(0,0,-60))
holoParent(4,E) 
holoMaterial(4,"models/debug/debugwhite")  

#MADE BY FAILCAKE 
if(Talk == 1){
Call = 6    
Gman = 1       
}

if(Talk == 8){ 
Gman = 2      
}

if(Talk == 25){ 
Gman = 3      
}
if(Talk == 30){ 
Gman = 4      
}
if(Talk == 35){ 
holoDelete(2)
Gman = 5
Call = 58 
Mat = 0     
}
soundStop(999)
Ring = 0
soundStop(998)
interval(1000)
}else{
soundStop(20000)
Speak = 0
Screen = 0
Ring += 1
Talk = 0
Gman = 0
Mat = 0
if(Ring == 2){   
E:soundPlay(999,0,"ambient/alarms/city_firebell_loop1.wav")
soundVolume(999,999)
soundPitch(999,120)
holoDelete(2)
holoDelete(3)
holoDelete(1)
holoDelete(4)
}else{
soundStop(999)
}
if(Ring > 3){
    Ring = 0
}
}
if(Gman == 1){
E:soundPlay(20000,20000,"vo/gman_misc/gman_riseshine.wav")
}
if(Gman == 2){
E:soundPlay(20000,20000,"vo/gman_misc/gman_02.wav")
}
if(Gman == 3){
E:soundPlay(20000,20000,"vo/gman_misc/gman_03.wav")
}
if(Gman == 4){
E:soundPlay(20000,20000,"vo/gman_misc/gman_04.wav")
}
if(Gman == 5){
holoColor(1,vec(250,250,250))
holoMaterial(1,"perftest/gman/gman_face1")
E:soundPlay(20000,20000,"npc/stalker/go_alert2a.wav")
E:soundPlay(30000,30000,"npc/stalker/go_alert2a.wav")
}
}
if(Call > 100){
Ring = 0
Mat = 0
Say = 0    
Gman = 0
Talk = 0
Call = 0
}
##PROTECTION SISTEM MUAHAHAHAH##

if(duped()){selfDestructAll()}
if(duped()){selfDestructAll()}

####################################################################
## Do not rename the E2 or remove the hint("Made by Failcake",100)##
####################################################################
