Advertisement
Guest User

Untitled

a guest
May 29th, 2016
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.95 KB | None | 0 0
  1. //mods/enchanteditems/scripts.js
  2.  
  3. 'use strict';
  4.  
  5. exports.BattleScripts = {
  6. init: function() {
  7. var abilityToItem = {
  8. aerilate: 'airballoon',
  9. adaptability: 'apicotberry',
  10. anticipation: 'blackbelt',
  11. arenatrap: 'buggem',
  12. aromaveil: 'blackglasses',
  13. aurabreak: 'blacksludge',
  14. baddreams: 'brightpowder',
  15. battlearmor: 'cellbattery',
  16. bigpecks: 'charcoal',
  17. blaze: 'chartiberry',
  18. bulletproof: 'chestoberry',
  19. cheekpouch: 'chilanberry',
  20. chlorophyll: 'chopleberry',
  21. clearbody: 'cobaberry',
  22. cloudnine: 'colburberry',
  23. colorchange: 'custapberry',
  24. competitive: 'damprock',
  25. compoundeyes: 'dragonfang',
  26. contrary: 'darkgem',
  27. cursedbody: 'ejectbutton',
  28. cutecharm: 'expertbelt',
  29. damp: 'flameorb',
  30. darkaura: 'focusband',
  31. defeatist: 'fullincense',
  32. defiant: 'ganlonberry',
  33. deltastream: 'grepaberry',
  34. desolateland: 'gripclaw',
  35. download: 'habanberry',
  36. drizzle: 'hardstone',
  37. drought: 'heatrock',
  38. dryskin: 'iapapaberry',
  39. earlybird: 'icyrock',
  40. effectspore: 'kasibberry',
  41. fairyaura: 'kebiaberry',
  42. filter: 'keeberry',
  43. flamebody: 'kelpsyberry',
  44. flareboost: 'kingsrock',
  45. flashfire: 'laggingtail',
  46. flowergift: 'lansatberry',
  47. flowerveil: 'laxincense',
  48. forecast: 'leppaberry',
  49. forewarn: 'liechiberry',
  50. friendguard: 'luminousmoss',
  51. frisk: 'magnet',
  52. furcoat: 'dragongem',
  53. galewings: 'marangaberry',
  54. gluttony: 'metalcoat',
  55. gooey: 'metronome',
  56. grasspelt: 'micleberry',
  57. guts: 'miracleseed',
  58. harvest: 'muscleband',
  59. healer: 'mysticwater',
  60. heatproof: 'nevermeltice',
  61. heavymetal: 'occaberry',
  62. honeygather: 'oddincense',
  63. hugepower: 'electricgem',
  64. hustle: 'passhoberry',
  65. hydration: 'payapaberry',
  66. hypercutter: 'petayaberry',
  67. icebody: 'poisonbarb',
  68. illuminate: 'quickclaw',
  69. illusion: 'razorclaw',
  70. immunity: 'razorfang',
  71. imposter: 'fairygem',
  72. infiltrator: 'rindoberry',
  73. innerfocus: 'rockincense',
  74. insomnia: 'roseincense',
  75. intimidate: 'redcard',
  76. ironbarbs: 'roseliberry',
  77. ironfist: 'safetygoggles',
  78. justified: 'salacberry',
  79. keeneye: 'scopelens',
  80. klutz: 'seaincense',
  81. leafguard: 'sharpbeak',
  82. levitate: 'shedshell',
  83. lightmetal: 'shellbell',
  84. lightningrod: 'shucaberry',
  85. limber: 'silkscarf',
  86. liquidooze: 'silverpowder',
  87. magicbounce: 'smoothrock',
  88. magicguard: 'snowball',
  89. magician: 'softsand',
  90. magmaarmor: 'spelltag',
  91. magnetpull: 'starfberry',
  92. marvelscale: 'stickybarb',
  93. megalauncher: 'tangaberry',
  94. minus: 'twistedspoon',
  95. moldbreaker: 'wacanberry',
  96. moody: 'waveincense',
  97. motordrive: 'weaknesspolicy',
  98. moxie: 'whiteherb',
  99. multiscale: 'widelens',
  100. multitype: 'wiseglasses',
  101. mummy: 'yacheberry',
  102. naturalcure: 'zoomlens',
  103. noguard: 'adamantorb',
  104. normalize: 'burndrive',
  105. oblivious: 'chilldrive',
  106. overcoat: 'deepseascale',
  107. overgrow: 'deepseatooth',
  108. owntempo: 'dousedrive',
  109. parentalbond: 'firegem',
  110. pickpocket: 'lightball',
  111. pickup: 'luckypunch',
  112. pixilate: 'griseousorb',
  113. plus: 'lustrousorb',
  114. poisonheal: 'metalpowder',
  115. poisonpoint: 'quickpowder',
  116. poisontouch: 'shockdrive',
  117. prankster: 'souldew',
  118. pressure: 'stick',
  119. primordialsea: 'thickclub',
  120. protean: 'aguavberry',
  121. purepower: 'icegem',
  122. quickfeet: 'aspearberry',
  123. raindish: 'bindingband',
  124. rattled: 'cheriberry',
  125. reckless: 'destinyknot',
  126. refrigerate: 'enigmaberry',
  127. regenerator: 'figyberry',
  128. rivalry: 'floatstone',
  129. rockhead: 'ironball',
  130. roughskin: 'jabocaberry',
  131. runaway: 'machobrace',
  132. sandforce: 'magoberry',
  133. sandrush: 'oranberry',
  134. sandstream: 'pechaberry',
  135. sandveil: 'persimberry',
  136. sapsipper: 'rawstberry',
  137. scrappy: 'ringtarget',
  138. serenegrace: 'rowapberry',
  139. shadowtag: 'poisongem',
  140. shedskin: 'wikiberry',
  141. sheerforce: 'armorfossil',
  142. shellarmor: 'belueberry',
  143. shielddust: 'blukberry',
  144. simple: 'psychicgem',
  145. skilllink: 'cherishball',
  146. slowstart: 'clawfossil',
  147. sniper: 'cornnberry',
  148. snowcloak: 'coverfossil',
  149. snowwarning: 'diveball',
  150. solarpower: 'domefossil',
  151. solidrock: 'dreamball',
  152. soundproof: 'durinberry',
  153. speedboost: 'duskball',
  154. stall: 'electirizer',
  155. stancechange: 'energypowder',
  156. static: 'fastball',
  157. steadfast: 'friendball',
  158. stench: 'greatball',
  159. stickyhold: 'healball',
  160. stormdrain: 'heavyball',
  161. strongjaw: 'helixfossil',
  162. sturdy: 'hondewberry',
  163. suctioncups: 'levelball',
  164. superluck: 'loveball',
  165. swarm: 'lureball',
  166. sweetveil: 'luxuryball',
  167. swiftswim: 'magostberry',
  168. symbiosis: 'masterball',
  169. synchronize: 'moonball',
  170. tangledfeet: 'nanabberry',
  171. technician: 'nestball',
  172. telepathy: 'netball',
  173. teravolt: 'nomelberry',
  174. thickfat: 'oldamber',
  175. tintedlens: 'pamtreberry',
  176. torrent: 'parkball',
  177. toughclaws: 'pinapberry',
  178. toxicboost: 'plumefossil',
  179. trace: 'pokeball',
  180. truant: 'pomegberry',
  181. turboblaze: 'premierball',
  182. unaware: 'qualotberry',
  183. unburden: 'quickball',
  184. unnerve: 'rabutaberry',
  185. victorystar: 'rarebone',
  186. vitalspirit: 'razzberry',
  187. voltabsorb: 'repeatball',
  188. waterabsorb: 'rootfossil',
  189. waterveil: 'safariball',
  190. weakarmor: 'skullfossil',
  191. whitesmoke: 'spelonberry',
  192. wonderguard: 'steelgem',
  193. wonderskin: 'sportball',
  194. zenmode: 'tamatoberry',
  195. }
  196. var largeArray = Object.getOwnPropertyNames(abilityToItem);
  197. for (var z = 0; z < largeArray.length; z++) {
  198. var currAbility = largeArray[z];
  199. var currItem = abilityToItem[currAbility];
  200. var itemArray = Object.getOwnPropertyNames(this.getItem(currItem));
  201. for (var i = 0; i < itemArray.length; i++) {
  202. var current = itemArray[i];
  203. var keepThese = ["id", "name", "spritenum", "num", "gen", "desc", "exists"];
  204. if (keepThese.indexOf(current) < 0) {
  205. if (typeof this.getItem(currItem)[current] === "function") {
  206. this.modData('Items', currItem)[current] = function(){return};
  207. //otherwise stuff breaks
  208. } else if (current === "isBerry" || current === "isUnreleased" || current === "isGem") {
  209. this.modData('Items', currItem)[current] = false;
  210. //just a precaution
  211. } else if (current === "onNegateImmunity") {
  212. this.modData('Items', currItem)[current] = true;
  213. //for Ring Target
  214. } else {
  215. this.modData('Items', currItem)[current] = '';
  216. }
  217. }
  218. }
  219. console.log(currItem + " " + currAbility);
  220. this.modData('Items', currItem).enchanted = currAbility;
  221. var abilityArray = Object.getOwnPropertyNames(this.getAbility(currAbility));
  222. for (var j = 0; j < abilityArray.length; j++) {
  223. var current = abilityArray[j];
  224. var dontKeepThese = ["desc", "shortDesc", "id", "name", "num"];
  225. if (dontKeepThese.indexOf(current) < 0) {
  226. this.modData('Items', currItem)[current] = this.getAbility(currAbility)[current];
  227. }
  228. }
  229. this.modData('Items', currItem).onTakeItem = function (pokemon) { return false };
  230. }
  231. },
  232. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement