fricken_laser_beams.lslp 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. //
  2. // The line above should be left blank to avoid script errors in OpenSim.
  3. /*
  4. * fricken_laser_beams.lsl
  5. * Part of the Sloodle project (www.sloodle.org)
  6. *
  7. * Copyright (c) 2011-06 contributors (see below)
  8. * Released under the GNU GPL v3
  9. * -------------------------------------------
  10. *
  11. * This program is free software: you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License as published by
  13. * the Free Software Foundation, either version 3 of the License, or
  14. * (at your option) any later version.
  15. *
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU General Public License for more details.
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  23. *
  24. * All scripts must maintain this copyrite information, including the contributer information listed
  25. *
  26. * DESCRIPTION
  27. * Inspired by the Movie Austin Powers, It is Dr. Evil's wish to have laser beams attached to his attack sharks. Well Dr. Evil, you got your wish!
  28. *
  29. *
  30. * This script causes a shark to swim around
  31. *
  32. * Contributors:
  33. * Paul Preibisch
  34. */
  35. list particle_parameters=[]; // stores your custom particle effect, defined below.
  36. list target_parameters=[]; // remembers targets found using TARGET TEMPLATE scripts.
  37. integer SLOODLE_CHANNEL_ENEMY_ATTACK= -163928666;//Channel to communicate on when attack occurs by an enemy
  38. integer SLOODLE_CHANNEL_ENEMY_AIM = -163928665;//Channel to communicate on when enemy is aming at target, ie:delivering a laserbeam
  39. laser(key target){
  40. if (target==NULL_KEY){
  41. llParticleSystem([]);
  42. return;
  43. }
  44. particle_parameters = [ // start of particle settings
  45. // Texture Parameters:
  46. PSYS_SRC_TEXTURE, llGetInventoryName(INVENTORY_TEXTURE, 0),
  47. PSYS_PART_START_SCALE, <0.051, 1.0, FALSE>, PSYS_PART_END_SCALE, <0.05, 1.0, FALSE>,
  48. PSYS_PART_START_COLOR, <1.00,.25,.25>, PSYS_PART_END_COLOR, <.75,0.00,0.00>,
  49. PSYS_PART_START_ALPHA, (float) 1.0, PSYS_PART_END_ALPHA, (float) .5,
  50. // Production Parameters:
  51. PSYS_SRC_BURST_PART_COUNT, (integer) 5,
  52. PSYS_SRC_BURST_RATE, (float) 0.1,
  53. PSYS_PART_MAX_AGE, (float) 1.0,
  54. // PSYS_SRC_MAX_AGE, (float) 0.00,
  55. // Placement Parameters:
  56. PSYS_SRC_PATTERN, (integer) 4, // 1=DROP, 2=EXPLODE, 4=ANGLE, 8=CONE,
  57. // Placement Parameters (for any non-DROP pattern):
  58. PSYS_SRC_BURST_SPEED_MIN, (float) 0.00, PSYS_SRC_BURST_SPEED_MAX, (float) 5.0,
  59. // PSYS_SRC_BURST_RADIUS, (float) 00.00,
  60. // Placement Parameters (only for ANGLE & CONE patterns):
  61. PSYS_SRC_ANGLE_BEGIN, (float) 0.00 * PI, PSYS_SRC_ANGLE_END, (float) 0.00 * PI,
  62. // PSYS_SRC_OMEGA, <00.00, 00.00, 00.00>,
  63. // After-Effect & Influence Parameters:
  64. PSYS_SRC_ACCEL, < 00.00, 00.00, 00.0>,
  65. PSYS_SRC_TARGET_KEY, (key)target,
  66. PSYS_PART_FLAGS, (integer) ( 0 // Texture Options:
  67. | PSYS_PART_INTERP_COLOR_MASK
  68. | PSYS_PART_INTERP_SCALE_MASK
  69. | PSYS_PART_EMISSIVE_MASK
  70. | PSYS_PART_FOLLOW_VELOCITY_MASK
  71. // After-effect & Influence Options:
  72. // | PSYS_PART_WIND_MASK
  73. // | PSYS_PART_BOUNCE_MASK
  74. // | PSYS_PART_FOLLOW_SRC_MASK
  75. // | PSYS_PART_TARGET_POS_MASK
  76. | PSYS_PART_TARGET_LINEAR_MASK
  77. )
  78. //end of particle settings
  79. ];
  80. llParticleSystem(particle_parameters);
  81. }
  82. default {
  83. on_rez(integer start_param) {
  84. llResetScript();
  85. }
  86. state_entry() {
  87. laser(NULL_KEY);
  88. }
  89. link_message( integer sibling, integer num, string mesg, key target_key ) {
  90. if (num==SLOODLE_CHANNEL_ENEMY_AIM){
  91. llTriggerSound("SND_LASER", 1);
  92. laser(target_key);
  93. llSetTimerEvent(3);
  94. }
  95. }
  96. timer() {
  97. llSetTimerEvent(0);
  98. laser(NULL_KEY);
  99. }
  100. }
  101. // Please leave the following line intact to show where the script lives in Git:
  102. // SLOODLE LSL Script Git Location: mod/gaming-1.0/objects/shark/assets/fricken_laser_beams.lslp