# Jedi Knight Cog Script # # Generic Lightning Trap Cog # # Generates Lightning From a ghost position # # [SXC] # # (C) 1997 LucasArts Entertainment Co. All Rights Reserved symbols message startup message pulse message exited thing ghost0 thing ghost1 thing ghost2 thing ghost3 thing ghost4 thing ghost5 thing ghost6 thing ghost7 thing ghost8 thing ghost9 thing ghost10 thing ghost11 thing ghost12 thing ghost13 thing ghost14 thing ghost15 thing ghost16 material animmat desc=animating_material int rvar=0 local int fireChannel0 local int fireChannel1 local int fireChannel2 local int fireChannel3 local int fireChannel4 local int fireChannel5 local int fireChannel6 local int fireChannel7 local int fireChannel8 local int fireChannel9 local int fireChannel10 local int fireChannel11 local int fireChannel12 local int fireChannel13 local int fireChannel14 local int fireChannel15 local int fireChannel16 local int flag=0 local int dummy local flex autoAimXFOV=60 local flex autoAimZFOV=60 local template lightning=+lightning local sound fireSound=THUNDER.wav local int i local int maxGhosts local end # Code Section code //------------------------------------------------------------------------------ ------------------- startup: for(i = 0; i < 16; i = i + 1){ if(i < 0) maxGhosts = i; } SetPulse(rand()*15+3); return; //------------------------------------------------------------------------------ ------------------- pulse: rvar = rand() * maxGhosts; rvar = rvar - (rvar % 1); if (rvar==16){ fireChannel16 = PlaySoundThing(fireSound, ghost16, 2.0, -1, 35, 0x00); dummy = CreateThing(lightning,ghost16); } if (rvar==15){ fireChannel15 = PlaySoundThing(fireSound, ghost15, 2.0, -1, 35, 0x00); dummy = CreateThing(lightning,ghost15); } if (rvar==14){ fireChannel14 = PlaySoundThing(fireSound, ghost14, 2.0, -1, 35, 0x00); dummy = CreateThing(lightning,ghost14); } if (rvar==13){ fireChannel13 = PlaySoundThing(fireSound, ghost13, 2.0, -1, 35, 0x00); dummy = CreateThing(lightning,ghost13); } if (rvar==12){ fireChannel12 = PlaySoundThing(fireSound, ghost12, 2.0, -1, 35, 0x00); dummy = CreateThing(lightning,ghost12); } if (rvar==11){ fireChannel11 = PlaySoundThing(fireSound, ghost11, 2.0, -1, 35, 0x00); dummy = CreateThing(lightning,ghost11); } if (rvar==10){ fireChannel10 = PlaySoundThing(fireSound, ghost10, 2.0, -1, 35, 0x00); dummy = CreateThing(lightning,ghost10); } if (rvar==9){ fireChannel9 = PlaySoundThing(fireSound, ghost9, 2.0, -1, 35, 0x00); dummy = CreateThing(lightning,ghost9); } if (rvar==8){ fireChannel8 = PlaySoundThing(fireSound, ghost8, 2.0, -1, 35, 0x00); dummy = CreateThing(lightning,ghost8); } if (rvar==7){ fireChannel7 = PlaySoundThing(fireSound, ghost7, 2.0, -1, 35, 0x00); dummy = CreateThing(lightning,ghost7); } if (rvar==6){ fireChannel6 = PlaySoundThing(fireSound, ghost6, 2.0, -1, 35, 0x00); dummy = CreateThing(lightning,ghost6); } if (rvar==5){ fireChannel5 = PlaySoundThing(fireSound, ghost5, 2.0, -1, 35, 0x00); dummy = CreateThing(lightning,ghost5); } if (rvar==4){ fireChannel4 = PlaySoundThing(fireSound, ghost4, 2.0, -1, 35, 0x00); dummy = CreateThing(lightning,ghost4); } if (rvar==3){ fireChannel3 = PlaySoundThing(fireSound, ghost3, 2.0, -1, 35, 0x00); dummy = CreateThing(lightning,ghost3); } if (rvar==2){ fireChannel2 = PlaySoundThing(fireSound, ghost2, 2.0, -1, 35, 0x00); dummy = CreateThing(lightning,ghost2); } if (rvar==1){ fireChannel1 = PlaySoundThing(fireSound, ghost1, 2.0, -1, 35, 0x00); dummy = CreateThing(lightning,ghost1); } if (rvar==0){ fireChannel0 = PlaySoundThing(fireSound, ghost0, 2.0, -1, 35, 0x00); dummy = CreateThing(lightning,ghost0); } materialanim(animmat, 48, 1); SetPulse(rand()*15+3); return; end