u_commands.txt 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. function initPlotFlags() {
  2. list = list.new();
  3. list.add(list, initPlotFlag(calcLeftShift(30), "SUB_PLOT_FLAG"));
  4. list.add(list, initPlotFlag(calcLeftShift(29), "FREE_FLAG"));
  5. list.add(list, initPlotFlag(calcLeftShift(28), "CITY_FLAG"));
  6. list.add(list, initPlotFlag(calcLeftShift(27), "EXPLOSION_FLAG"));
  7. list.add(list, initPlotFlag(calcLeftShift(5), "ENTITY_INTERACT_FLAG"));
  8. list.add(list, initPlotFlag(calcLeftShift(4), "BLOCK_INTERACT_FLAG"));
  9. list.add(list, initPlotFlag(calcLeftShift(3), "HIT_AMBIENT_FLAG"));
  10. list.add(list, initPlotFlag(calcLeftShift(2), "BUCKET_FLAG"));
  11. list.add(list, initPlotFlag(calcLeftShift(1), "BREAK_FLAG"));
  12. list.add(list, initPlotFlag(calcLeftShift(0), "PLACE_FLAG"));
  13. setScriptVar("all_plot_flags", list);
  14. }
  15. function initPlotFlag(f, f_name) {
  16. a = array.new(2);
  17. a[0] = f;
  18. a[1] = f_name;
  19. return a;
  20. }
  21. function getAllPlotFlags() {
  22. return getScriptVar("all_plot_flags");
  23. }
  24. function getFlagLists(plot) {
  25. flags = plot.getFlags(plot);
  26. all_flags = getAllPlotFlags();
  27. flags_true = list.new();
  28. flags_false = list.new();
  29. iter = iterator(all_flags);
  30. while(hasNext(iter)) {
  31. a = next(iter);
  32. f = a[0];
  33. if(flags >= f) {
  34. list.add(flags_true, a);
  35. flags -= f;
  36. } else {
  37. list.add(flags_false, a);
  38. }
  39. }
  40. a = array.new(2);
  41. a[0] = flags_true;
  42. a[1] = flags_false;
  43. return a;
  44. }
  45. function getItemFlags() {
  46. list = list.new();
  47. list.add(list, "HIDE_ATTRIBUTES");
  48. list.add(list, "HIDE_UNBREAKABLE");
  49. list.add(list, "HIDE_DESTROYS");
  50. list.add(list, "HIDE_PLACED_ON");
  51. list.add(list, "HIDE_POTION_EFFECTS");
  52. list.add(list, "HIDE_DYE");
  53. list.add(list, "HIDE_ENCHANTS");
  54. return list;
  55. }
  56. function getRickRollSounds() {
  57. RickRollSounds = list.new();
  58. list.add(RickRollSounds, math.pow(2, -6 / 12));//6
  59. list.add(RickRollSounds, math.pow(2, -4 / 12));//8
  60. list.add(RickRollSounds, math.pow(2, -1 / 12));//11
  61. list.add(RickRollSounds, math.pow(2, -4 / 12));//8
  62. list.add(RickRollSounds, math.pow(2, 3 / 12));//15
  63. list.add(RickRollSounds, math.pow(2, 3 / 12));//15
  64. list.add(RickRollSounds, math.pow(2, 1 / 12));//13
  65. list.add(RickRollSounds, math.pow(2, -6 / 12));//6
  66. list.add(RickRollSounds, math.pow(2, -4 / 12));//8
  67. list.add(RickRollSounds, math.pow(2, -1 / 12));//11
  68. list.add(RickRollSounds, math.pow(2, -4 / 12));//8
  69. list.add(RickRollSounds, math.pow(2, 1 / 12));//13
  70. list.add(RickRollSounds, math.pow(2, 1 / 12));//13
  71. list.add(RickRollSounds, math.pow(2, -1 / 12));//11
  72. list.add(RickRollSounds, math.pow(2, -2 / 12));//10
  73. list.add(RickRollSounds, math.pow(2, -4 / 12));//8
  74. list.add(RickRollSounds, math.pow(2, -6 / 12));//6
  75. list.add(RickRollSounds, math.pow(2, -4 / 12));//8
  76. list.add(RickRollSounds, math.pow(2, -1 / 12));//11
  77. list.add(RickRollSounds, math.pow(2, -4 / 12));//8
  78. list.add(RickRollSounds, math.pow(2, -1 / 12));//11
  79. list.add(RickRollSounds, math.pow(2, 1 / 12));//13
  80. list.add(RickRollSounds, math.pow(2, -2 / 12));//10
  81. list.add(RickRollSounds, math.pow(2, -4 / 12));//8
  82. list.add(RickRollSounds, math.pow(2, -6 / 12));//6
  83. list.add(RickRollSounds, math.pow(2, -6 / 12));//6
  84. list.add(RickRollSounds, math.pow(2, -6 / 12));//6
  85. list.add(RickRollSounds, math.pow(2, 1 / 12));//13
  86. list.add(RickRollSounds, math.pow(2, -1 / 12));//11
  87. //6,8,11,8,15,15,13,6,8,11,8,13,13,11,10,8,6,8,11,8,11,13,10,8,6,6,6,13,11
  88. return RickRollSounds;
  89. }
  90. function getRickRollSoundDists() {
  91. RickRollSoundDists = list.new();
  92. list.add(RickRollSoundDists, 2);//1
  93. list.add(RickRollSoundDists, 2);//1
  94. list.add(RickRollSoundDists, 2);//1
  95. list.add(RickRollSoundDists, 2);//1
  96. list.add(RickRollSoundDists, 6);//3
  97. list.add(RickRollSoundDists, 6);//3
  98. list.add(RickRollSoundDists, 12);//6
  99. list.add(RickRollSoundDists, 2);//1
  100. list.add(RickRollSoundDists, 2);//1
  101. list.add(RickRollSoundDists, 2);//1
  102. list.add(RickRollSoundDists, 2);//1
  103. list.add(RickRollSoundDists, 6);//3
  104. list.add(RickRollSoundDists, 6);//3
  105. list.add(RickRollSoundDists, 6);//3
  106. list.add(RickRollSoundDists, 2);//1
  107. list.add(RickRollSoundDists, 6);//3
  108. list.add(RickRollSoundDists, 2);//1
  109. list.add(RickRollSoundDists, 2);//1
  110. list.add(RickRollSoundDists, 2);//1
  111. list.add(RickRollSoundDists, 2);//1
  112. list.add(RickRollSoundDists, 8);//4
  113. list.add(RickRollSoundDists, 4);//2
  114. list.add(RickRollSoundDists, 6);//3
  115. list.add(RickRollSoundDists, 2);//1
  116. list.add(RickRollSoundDists, 4);//2
  117. list.add(RickRollSoundDists, 4);//2
  118. list.add(RickRollSoundDists, 6);//3
  119. list.add(RickRollSoundDists, 8);//4
  120. list.add(RickRollSoundDists, 2);//1
  121. //2,2,2,2,2,6,6,12,2,2,2,2,6,6,6,2,6,2,2,2,2,8,4,6,2,4,4,6,8
  122. return RickRollSoundDists;
  123. }
  124. function getBobbyCarSounds() {
  125. bobbyCarSounds = list.new();
  126. list.add(bobbyCarSounds, math.pow(2, 4 / 12));
  127. list.add(bobbyCarSounds, math.pow(2, 2 / 12));
  128. list.add(bobbyCarSounds, math.pow(2, 1 / 12));
  129. list.add(bobbyCarSounds, math.pow(2, 4 / 12));
  130. list.add(bobbyCarSounds, math.pow(2, -3 / 12));
  131. list.add(bobbyCarSounds, math.pow(2, 1 / 12));
  132. list.add(bobbyCarSounds, math.pow(2, -1 / 12));
  133. list.add(bobbyCarSounds, math.pow(2, 2 / 12));
  134. list.add(bobbyCarSounds, math.pow(2, -4 / 12));
  135. list.add(bobbyCarSounds, math.pow(2, -1 / 12));
  136. list.add(bobbyCarSounds, math.pow(2, -3 / 12));
  137. list.add(bobbyCarSounds, math.pow(2, -1 / 12));
  138. list.add(bobbyCarSounds, math.pow(2, 1 / 12));
  139. return bobbyCarSounds;
  140. }
  141. function getBobbyCarSoundDists() {
  142. bobbyCarSoundDists = list.new();
  143. list.add(bobbyCarSoundDists, 8);
  144. list.add(bobbyCarSoundDists, 8);
  145. list.add(bobbyCarSoundDists, 4);
  146. list.add(bobbyCarSoundDists, 6);
  147. list.add(bobbyCarSoundDists, 6);
  148. list.add(bobbyCarSoundDists, 6);
  149. list.add(bobbyCarSoundDists, 6);
  150. list.add(bobbyCarSoundDists, 6);
  151. list.add(bobbyCarSoundDists, 6);
  152. list.add(bobbyCarSoundDists, 6);
  153. list.add(bobbyCarSoundDists, 4);
  154. list.add(bobbyCarSoundDists, 6);
  155. list.add(bobbyCarSoundDists, 6);
  156. return bobbyCarSoundDists;
  157. }
  158. function getPotionTypes() {
  159. list = list.new();
  160. list.add(list, "ABSORPTION");
  161. list.add(list, "BAD_OMEN");
  162. list.add(list, "BLINDNESS");
  163. list.add(list, "CONDUIT_POWER");
  164. list.add(list, "CONFUSION");
  165. list.add(list, "DAMAGE_RESISTANCE");
  166. list.add(list, "DOLPHINS_GRACE");
  167. list.add(list, "FAST_DIGGING");
  168. list.add(list, "FIRE_RESISTANCE");
  169. list.add(list, "GLOWING");
  170. list.add(list, "HARM");
  171. list.add(list, "HEAL");
  172. list.add(list, "HEALTH_BOOST");
  173. list.add(list, "HERO_OF_THE_VILLAGE");
  174. list.add(list, "HUNGER");
  175. list.add(list, "INCREASE_DAMAGE");
  176. list.add(list, "INVISIBILITY");
  177. list.add(list, "JUMP");
  178. list.add(list, "LEVITATION");
  179. list.add(list, "LUCK");
  180. list.add(list, "NIGHT_VISION");
  181. list.add(list, "POISON");
  182. list.add(list, "REGENERATION");
  183. list.add(list, "SATURATION");
  184. list.add(list, "SLOW");
  185. list.add(list, "SLOW_DIGGING");
  186. list.add(list, "SLOW_FALLING");
  187. list.add(list, "SPEED");
  188. list.add(list, "UNLUCK");
  189. list.add(list, "WATER_BREATHING");
  190. list.add(list, "WEAKNESS");
  191. list.add(list, "WITHER");
  192. return list;
  193. }