// small rainbow flashing corona light LED Dot trap. player picks it up. when the player dies, a light drops below them. the next player that touches this light, // the light will attach itself to the new player. when that player dies, the LED Dot will respawn according to ledtraptype's value. // ledtraptype: 1 = respawn LED Dot on trap carrier's dead body (1st death in script) // ledtraptype: 2 = respawn LED Dot on illuminated trapped dead body (2nd death in script) main local.origin local.name local.ledtraptype: local.player = parm.other level.smoke_time = 9999 if(level.leddropped[local.name] != 1) { level.leddropped[local.name] = 0 local.trigger = spawn trigger_use targetname ("led_trigger1" + local.name) local.trigger.origin = local.origin + ( 0 0 12 ) local.trigger setsize ( -30 -30 -20 ) ( 30 30 50 ) local.trigger.scale = 0.3 } else if(level.leddropped[local.name] == 1) { local.trigger = spawn trigger_multiple targetname ("led_dropped_trigger1" + local.name) local.trigger.origin = local.origin + ( 0 0 12 ) local.trigger setsize ( -180 -180 -180 ) ( 180 180 180 ) local.trigger light (randomfloat 90 / 100 + 0.1) (randomfloat 90 / 100 + 0.1) (randomfloat 90 / 100 + 0.1) 250 local.trigger.scale = 0.01 } local.trigger model "static/corona_reg.tik" local.trigger.angles = ( 0 0 0 ) local.trigger show if(local.ledtraptype == 1) { level.traptype[local.name] = 1 } else if(local.ledtraptype == 2) { level.traptype[local.name] = 2 } else { thread error_ledtraptype } if(level.leddropped[local.name] != 1 && level.leddropped[local.name] != 2) { exec global/flickerrotate.scr ("led_trigger1" + local.name) ( 0.1 0.1 0.1 ) 85 90 90 90 } local.trigger thread do_random local.trigger.origin local.name end do_random local.triggerorigin local.name: if(level.leddropped[local.name] != 1) { $("led_trigger1" + local.name) waittill trigger $("led_trigger1" + local.name) nottriggerable local.player = parm.other if(local.player.inuse) { local.player iprint "Cannot use. You are holding something already." wait 1 $("led_trigger1" + local.name) triggerable end } else { $("led_trigger1" + local.name) message ("*** You are now carrying an LED Dot trap! ***") local.player.inuse = 1 local.player thread doit local.triggerorigin local.name } $("led_trigger1" + local.name) triggerable } else if(level.leddropped[local.name] == 1) { $("led_dropped_trigger1" + local.name) waittill trigger $("led_dropped_trigger1" + local.name) nottriggerable local.player = parm.other if(local.player.inuse) { local.player iprint "Cannot use. You are holding something already." wait 1 $("led_dropped_trigger1" + local.name) triggerable end } else { $("led_dropped_trigger1" + local.name) message ("*** You stepped on an LED Dot trap! ***") local.player.inuse = 1 local.player thread doit local.triggerorigin local.name } $("led_dropped_trigger1" + local.name) triggerable } end doit local.origin local.name: //huddraw_alpha 107 0 //huddraw_virtualsize 107 1 //huddraw_alpha 107 .8 //huddraw_font 107 "verdana-12" //huddraw_color 107 .5 .5 //huddraw_rect 107 -200 222 200 14 local.static = spawn script_model local.static model "static/corona_reg.tik" local.static.scale = 0.001 local.static.origin = self.origin local.static notsolid local.static glue self if(level.leddropped[local.name] != 1 && level.leddropped[local.name] != 2) // if == 0. { self iprint ("Picked up an LED marker. When you die, an LED Dot will drop.") self iprint ("If they get too close, they'll be marked with a big light!") local.static light (randomfloat 90 / 100 + 0.1) (randomfloat 90 / 100 + 0.1) (randomfloat 90 / 100 + 0.1) 15 $("led_trigger1" + local.name) nottriggerable waitframe $("led_trigger1" + local.name) remove local.random1 = randomint(2) if(local.random1 == 0) { self playsound ledpickup1 } if(local.random1 == 1) { self playsound ledpickup2 } //huddraw_string 107 "LED Dot Trap: Acquired" //wait 0.5 //huddraw_string 107 "LED Dot Trap: Carrying" } else if(level.leddropped[local.name] == 1) { self iprint ("*** Avoid enemy LED Dots on the ground! ***") self iprint ("Enemies can see you more easily with the bright light below you.") local.static light (randomfloat 90 / 100 + 0.1) (randomfloat 90 / 100 + 0.1) (randomfloat 90 / 100 + 0.1) 250 $("led_dropped_trigger1" + local.name) nottriggerable waitframe $("led_dropped_trigger1" + local.name) remove local.random2 = randomint(3) if(local.random2 == 0) { self playsound lituptrap1 } if(local.random2 == 1) { self playsound lituptrap2 } if(local.random2 == 2) { self playsound lituptrap3 } //huddraw_string 107 "LED Dot Trap: Trapped" //wait 0.5 //huddraw_string 107 "LED Dot Trap: Illuminated" } local.number = randomint 999999999 $("cig_" + local.number).angles = ( 0 180 20 ) local.static show local.result = self waitthread scan_player level.smoke_time local.name if(local.result != left) { self.inuse = 0 $("cig_" + local.number) remove local.static unglue local.static remove local.origin = local.origin + ( 0 0 -12 ) if(level.leddropped[local.name] == 1) { if(level.traptype[local.name] == 1) { self iprint ("The LED Dot trigger has reset and respawned on the trap carrier's dead body.") } else if(level.traptype[local.name] == 2) { self iprint ("The LED Dot trigger has reset and respawned on your dead body.") } level.leddropped[local.name] = 2 //not 0, only for != if-statement //huddraw_string 107 "LED Dot Trap: Resetting" if(level.ledtrap_spectator[local.name] != 1) { wait 0.5 } //huddraw_string 107 "" if(level.ledtrap_spectator[local.name] == 1) { level.ledtrap_spectator[local.name] = 0 goto main local.origin local.name level.traptype[local.name] } if(level.traptype[local.name] == 1) { goto main local.origin local.name 1 } else if(level.traptype[local.name] == 2) { goto main self.origin local.name 2 } } else if(level.leddropped[local.name] != 1) { self iprint ("You dropped the LED Dot trap on your dead body.") level.leddropped[local.name] = 1 //huddraw_string 107 "LED Dot Trap: Planted" if(level.ledtrap_spectator[local.name] != 1) { wait 0.5 } //huddraw_string 107 "" if(level.ledtrap_spectator[local.name] == 1) { level.ledtrap_spectator[local.name] = 0 goto main local.origin local.name level.traptype[local.name] } goto main self.origin local.name level.traptype[local.name] } } end scan_player local.time local.name: local.result = ok local.team = self.dmteam local.count = 0 while(1) { if(self == NULL) { local.result = left end local.result } else { if(self.dmteam != local.team || !isalive self || self.dmteam == spectator) { if(self.dmteam == spectator || isalive self) { level.ledtrap_spectator[local.name] = 1 } end local.result } else { local.count++ if((local.count / 10) >= local.time) { end local.result } } } wait 0.1 } end error_ledtraptype: local.player = parm.other local.player iprint "ERROR. You must specify the LED Dot's trap-type after its origin coords: 1 or 2" local.player iprint "Example: exec map_triggers/led_traps/led_trap_1.scr ( 0 0 0 ) 2" end