Advertisement
Dekita

Capture PB Effz

Dec 24th, 2012
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.42 KB | None | 0 0
  1. =begin =========================================================================
  2. Dekita's v1.0
  3. ★ Pokéball Effécts™ ★
  4.  
  5. ================================================================================
  6. Script Information:
  7. ====================
  8. This script is an add-on for my pokemon capture script.
  9. This script gives you alot more variety and flexibility for your pokeballs,
  10. it also adds "after effects"
  11.  
  12. ================================================================================
  13. ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
  14. ================================================================================
  15. 1. You must give credit to "Dekita"
  16. 2. You are NOT allowed to repost this script.(or modified versions)
  17. 3. You are NOT allowed to convert this script.(into other game engines e.g RGSS2)
  18. 4. You are NOT allowed to use this script for Commercial games.
  19. 5. ENJOY!
  20.  
  21. "FINE PRINT"
  22. By using this script you hereby agree to the above terms and conditions,
  23. if any violation of the above terms occurs "legal action" may be taken.
  24. Not understanding the above terms and conditions does NOT mean that
  25. they do not apply to you.
  26. If you wish to discuss the terms and conditions in further detail you can
  27. contact me at http://dekitarpg.wordpress.com/ or DekitaRPG@gmail.com
  28.  
  29. ================================================================================
  30. History:
  31. =========
  32. D /M /Y
  33. 18/11/2o12 - started,
  34.  
  35. ================================================================================
  36. Credit and Thanks to :
  37. =======================
  38.  
  39. ================================================================================
  40. Known Bugs:
  41. ============
  42. N/A
  43.  
  44. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  45. If a new bug is found please contact me at
  46. http://dekitarpg.wordpress.com/
  47.  
  48. ================================================================================
  49. INSTRUCTIONS:
  50. ==============
  51. Place this script UNDER "▼ Materials" and ABOVE "▼ Main" in your script editor.
  52. Place this script below "Dekita Pokémon CORE"
  53.  
  54. =end #==========================================================================#
  55.  
  56.  
  57. # EXTRA POKEBALLS
  58. # Requires Pokemon Capture Script
  59.  
  60. # POKEBALL TYPES
  61.  
  62. # LevelBall
  63. # <levelball>
  64. # value * 1.0 if player pokemon is the same of lower lvl as the wild pokemon -----
  65. # value * 2.0 if player is higherlv but less than double the wild pokemons lvl -----
  66. # value * 4.0 if player pokemon is 4 times the lvl of wild pokemon but less than 8 times the lvl ----
  67. # value * 8.0 if player is 8 times the lvl or more ----
  68.  
  69. # LureBall
  70. # <lureball>
  71. # value *= 3.0 if pokemon was caught fishing
  72.  
  73. # LoveBall
  74. # <loveball>
  75. # value *= 8.0 if wild pokemon is same species as player pokemon but opposite
  76. # gender ----
  77.  
  78. # HeavyBall
  79. # <heavyball>
  80. # value = 0.0 if wild pokemon weight <= 451.1 lbs
  81. # value = ( value * 20 ) if wild pokemon weight > 451.1 && <= 677.3 lbs
  82. # value = ( value * 30 ) if wild pokemon weight > 667.3 && <= 903.0 lbs
  83. # value = ( value * 40 ) if wild pokemon weight > 903.0 lbs
  84.  
  85. # HeavyBall 2 # Designed By Dekita
  86. # <heavyball2>
  87. # value = 0.0 if wild pokemon weight > 903.0 lbs
  88. # value = ( value * 20 ) if wild pokemon weight > 667.3 && <= 903.0 lbs
  89. # value = ( value * 30 ) if wild pokemon weight > 451.1 && <= 677.3 lbs
  90. # value = ( value * 40 ) if wild pokemon weight <= 451.1 lbs
  91.  
  92. # FastBall
  93. # <fastball>
  94. # value * 4.0 if wild pokemon has base speed stat of 100 or more
  95.  
  96. # RepeatBall
  97. # <repeatball>
  98. # value * 3.0 if pokemon already captured
  99.  
  100. # Timer Ball
  101. # <timerball>
  102. # Calculated as (number of turns completed in battle + 10) / 100, maximum 4.0
  103.  
  104. # Nest Ball
  105. # <nestball>
  106. # Calculated as (40 - wild Pokemon's level) / 10, minimum 1
  107.  
  108. # Net Ball
  109. # <netball>
  110. # value * 3.0 if wild pokemon is water or bug type
  111.  
  112. # Dive Ball
  113. # <diveball>
  114. # value * 3.5 if pokemon is encountered during "fish/dive/surf"
  115.  
  116. # Quick Ball
  117. # <quickball>
  118. # value * 4.0 if used on the first turn of battle
  119.  
  120. # Dusk Ball
  121. # <duskball>
  122. # value * 3.5 if pokemon is encountered in a cave or at night
  123.  
  124.  
  125. # Retroball - Designed By Rief @ http://w11.zetaboards.com/RMParadise
  126. # <retroball>
  127. # For catching Pokemon from older generations, rates:
  128. # value *= 4.0 if First gen Pokemon
  129. # value *= 3.0 if Second gen Pokemon
  130. # value *= 2.0 if Third gen Pokemon
  131. # value *= 1.5 if Fourth gen Pokemon
  132. # value *= 0.5 if Fifth gen Pokemon
  133.  
  134. # Discovery Ball. Designed By Hyde @ http://w11.zetaboards.com/RMParadise
  135. # <discoveryball>
  136. # Does the same thing as the retro, but backwards.
  137. # 5th gen would be value *= 4.0
  138. # 1st gen would be value *= 0.5 .
  139.  
  140. # Legend Ball. Designed By Hyde @ http://w11.zetaboards.com/RMParadise
  141. # <legendaryball>
  142. # value *= 10.0 if legendary pokemon
  143.  
  144.  
  145.  
  146.  
  147. # STACKABLE EFFECTS
  148.  
  149. # <hp heal ball>
  150. # Heals HP
  151.  
  152. # <mp heal ball>
  153. # Heals MP
  154.  
  155. # <state heal ball>
  156. # Heals States
  157.  
  158. # <shiny ball>
  159. # Turns captures pokemon into a shiny (requires my shiny script )
  160.  
  161. # <boost iv ball>
  162. # Boosts iv value (requires my actor natures script)
  163.  
  164. # <max iv ball>
  165. # Max iv value (requires my actor natures script)
  166.  
  167.  
  168. #==============================================================================
  169. module DataManager
  170. #==============================================================================
  171.  
  172. class <<self; alias load_database_Poké_Capt_more_balls load_database; end
  173. def self.load_database
  174. load_database_Poké_Capt_more_balls
  175. load_notetags_Poké_Capt_more_balls
  176. end
  177.  
  178. def self.load_notetags_Poké_Capt_more_balls
  179. groups = [$data_items]
  180. for group in groups
  181. for obj in group
  182. next if obj.nil?
  183. obj.load_notetags_Poké_Capt_more_balls
  184. end
  185. end
  186. end
  187.  
  188. end # DataManager
  189.  
  190. #==============================================================================
  191. class Game_Party < Game_Unit
  192. #==============================================================================
  193.  
  194. alias pbeffzz get_pokeball_aftermod
  195. def get_pokeball_aftermod(actor_id)
  196. pbeffzz(actor_id)
  197. _GA = $game_actors[actor_id]
  198. _ITEM = $game_temp.pokeball_used
  199. return if _ITEM == ( [] || nil )
  200.  
  201. pokeball_housing_type(_GA, _ITEM)
  202.  
  203. pokeball_hp_heal(_GA) if _ITEM.pokeball_after_effects[0]
  204. pokeball_mp_heal(_GA) if _ITEM.pokeball_after_effects[1]
  205. pokeball_state_heal(_GA) if _ITEM.pokeball_after_effects[2]
  206. pokeball_shiny_mod(_GA) if _ITEM.pokeball_after_effects[3]
  207. pokeball_boost_iv(_GA) if _ITEM.pokeball_after_effects[4]
  208. pokeball_max_iv(_GA) if _ITEM.pokeball_after_effects[5]
  209.  
  210. $game_temp.pokeball_used = []
  211. end
  212.  
  213. def pokeball_housing_type(actor, item)
  214. actor.pokemons_pokeball = item
  215. end
  216.  
  217. def pokeball_hp_heal(actor)
  218. actor.hp = actor.mhp
  219. end
  220.  
  221. def pokeball_mp_heal(actor)
  222. actor.mp = actor.mmp
  223. end
  224.  
  225. def pokeball_state_heal(actor)
  226. actor.clear_states
  227. end
  228.  
  229. def pokeball_shiny_mod(actor)
  230. actor.setup_shiny
  231. end
  232.  
  233. def pokeball_boost_iv(actor)
  234. 8.times {|i|
  235. actor.init_ivs[i] += 5
  236. actor.init_ivs[i] = 31 if actor.init_ivs[i] >= 31
  237. }
  238. end
  239.  
  240. def pokeball_max_iv(actor)
  241. 8.times { |i| actor.init_ivs[i] = 31 }
  242. end
  243.  
  244.  
  245. end
  246.  
  247. #==============================================================================
  248. class RPG::UsableItem < RPG::BaseItem
  249. #==============================================================================
  250.  
  251. #attr_accessor :capture_item
  252. #attr_accessor :pokeball_capt_rate
  253.  
  254. attr_accessor :pokeball_after_effects
  255.  
  256. def load_notetags_Poké_Capt_more_balls
  257.  
  258.  
  259. @pokeball_after_effects = []
  260. @pokeball_after_effects[0] = false # heal hp
  261. @pokeball_after_effects[1] = false # heal mp
  262. @pokeball_after_effects[2] = false # heal states
  263. @pokeball_after_effects[3] = false # turn into shiny
  264. @pokeball_after_effects[4] = false # boosts iv value
  265. @pokeball_after_effects[5] = false # max iv value
  266.  
  267.  
  268. self.note.split(/[\r\n]+/).each { |line|
  269. case line
  270. when /<levelball>/i
  271. @pokeball_effect = [true, 0]
  272. when /<lureball>/i
  273. @pokeball_effect = [true, 1]
  274. when /<loveball>/i
  275. @pokeball_effect = [true, 2]
  276. when /<heavyball>/i
  277. @pokeball_effect = [true, 3]
  278. when /<fastball>/i
  279. @pokeball_effect = [true, 4]
  280. when /<repeatball>/i
  281. @pokeball_effect = [true, 5]
  282. when /<timerball>/i
  283. @pokeball_effect = [true, 6]
  284. @capture_item = true
  285. when /<nestball>/i
  286. @pokeball_effect = [true, 7]
  287. @capture_item = true
  288. when /<netball>/i
  289. @pokeball_effect = [true, 8]
  290. when /<diveball>/i
  291. @pokeball_effect = [true, 9]
  292. when /<quickball>/i
  293. @pokeball_effect = [true, 10]
  294. when /<duskball>/i
  295. @pokeball_effect = [true, 11]
  296. when /<retroball>/i
  297. @pokeball_effect = [true, 12]
  298. when /<discoveryball>/i
  299. @pokeball_effect = [true, 13]
  300. when /<legendaryball>/i
  301. @pokeball_effect = [true, 14]
  302. when /<heavyball2>/i
  303. @pokeball_effect = [true, 15]
  304.  
  305.  
  306.  
  307. # pokeball after effects
  308. when /<hp heal ball>/i
  309. @pokeball_after_effects[0] = true
  310. when /<mp heal ball>/i
  311. @pokeball_after_effects[1] = true
  312. when /<state heal ball>/i
  313. @pokeball_after_effects[2] = true
  314. when /<shiny ball>/i
  315. @pokeball_after_effects[3] = true
  316. when /<boost iv ball>/i
  317. @pokeball_after_effects[4] = true
  318. when /<max iv ball>/i
  319. @pokeball_after_effects[5] = true
  320.  
  321. end
  322. } # self.note.split
  323. #---
  324. end
  325.  
  326.  
  327. end # RPG::Enemy
  328.  
  329.  
  330. #==============================================================================
  331. class Scene_Battle < Scene_Base
  332. #==============================================================================
  333.  
  334. # Overwrite Method
  335. def get_pokeball_capture_rate(target, item)
  336. value = item.pokeball_capt_rate
  337. if item.pokeball_effect[0]
  338. case item.pokeball_effect[1]
  339. when 0 # level ball
  340. value = level_ball__values(value, target, item)
  341. when 1 # lure ball
  342. value = lure_ball__values(value, target, item)
  343. when 2 # love ball
  344. value = love_ball__values(value, target, item)
  345. when 3 # heavyball
  346. value = heavy_ball__values(value, target, item)
  347. when 4 # fast ball
  348. value = fast_ball__values(value, target, item)
  349. when 5 # repeat ball
  350. value = repeat_ball__values(value, target, item)
  351. when 6 # timer ball
  352. value = timer_ball__values(value, target, item)
  353. when 7 # nest ball
  354. value = nest_ball__values(value, target, item)
  355. when 8 # net ball
  356. value = net_ball__values(value, target, item)
  357. when 9 # dive ball
  358. value = dive_ball__values(value, target, item)
  359. when 10 # quick ball
  360. value = quick_ball__values(value, target, item)
  361. when 11 # dusk ball
  362. value = dusk_ball__values(value, target, item)
  363.  
  364. when 12 # retro ball
  365. value = retro_ball__values(value, target, item)
  366. when 13 # discovery ball
  367. value = discovery_ball__values(value, target, item)
  368. when 14 # legendary ball
  369. value = legendary_ball__values(value, target, item)
  370. when 15 # heavyball 2
  371. value = heavy_ball_2_values(value, target, item)
  372.  
  373. end
  374. end
  375. p "value= #{value}"
  376. return value
  377. end
  378.  
  379. def level_ball__values(value, target, item)
  380. battler_lvl = $game_party.battle_members[0].level
  381. value *= 1.0 if battler_lvl <= target.level
  382. value *= 2.0 if battler_lvl >= target.level && (battler_lvl/2) <= target.level
  383. value *= 4.0 if (battler_lvl/4) >= target.level && (battler_lvl/8) <= target.level
  384. value *= 8.0 if (battler_lvl/8) >= target.level
  385. return value
  386. end
  387.  
  388. def lure_ball__values(value, target, item)
  389. value *= 3.0 if $game_party.fishing
  390. return value
  391. end
  392.  
  393. def love_ball__values(value, target, item)
  394. battler_gender = $game_party.battle_members[0].gender
  395. battler_species = $game_party.battle_members[0].species
  396. value *= 8.0 if !(battler_gender == target.gender) && battler_species == target.species
  397. return value
  398. end
  399.  
  400. def heavy_ball__values(value, target, item)
  401. value -= value if target.weight <= 451.1
  402. value *= 20.0 if target.weight > 451.1 && target.weight <= 677.3
  403. value *= 30.0 if target.weight > 677.3 && target.weight <= 903.0
  404. value *= 40.0 if target.weight > 903.0
  405. return value
  406. end
  407.  
  408. def fast_ball__values(value, target, item)
  409. value *= 4 if $data_enemies[target.enemy_id].params[6] >= 100
  410. return value
  411. end
  412.  
  413. def repeat_ball__values(value, target, item)
  414. value *= 3.0 if pokemon_already_captured?(target.pokemon_id)
  415. return value
  416. end
  417.  
  418. def timer_ball__values(value, target, item)
  419. tc = @battle_turn_count
  420. value = ((tc * 10).to_f / 100).to_f
  421. value = 4.0 if value > 4.0
  422. return value
  423. end
  424.  
  425. def nest_ball__values(value, target, item)
  426. value = (40 - target.level / 10).to_f
  427. value = 1.0 if value < 1.0
  428. return value
  429. end
  430.  
  431. def net_ball__values(value, target, item)
  432. value *= 3.0 if do_types_checker(target)
  433. return value
  434. end
  435.  
  436. def do_types_checker(target)
  437. return true if target.type[0] == "water"
  438. return true if target.type[0] == "bug"
  439. return true if target.type[1] == "water"
  440. return true if target.type[1] == "bug"
  441. return false
  442. end
  443.  
  444. def dive_ball__values(value, target, item)
  445. fish = $game_party.fishing
  446. dive = $game_party.diving
  447. surf = $game_party.surfing
  448. value *= 3.5 if (fish || dive || surf)
  449. return value
  450. end
  451.  
  452. def quick_ball__values(value, target, item)
  453. value *= 4.0 if @battle_turn_count == 0
  454. return value
  455. end
  456.  
  457. def dusk_ball__values(value, target, item)
  458. cave = $game_party.in_cave
  459. night = $game_system.night_time
  460. value *= 3.5 if (cave || night)
  461. return value
  462. end
  463.  
  464. def retro_ball__values(value, target, item)
  465. p "Retro ball activated"
  466. case target.generation_id.to_i
  467. when 1
  468. return value *= 4.0
  469. when 2
  470. return value *= 3.0
  471. when 3
  472. return value *= 2.0
  473. when 4
  474. return value *= 1.5
  475. when 5
  476. return value *= 0.5
  477. else
  478. return value = 0.0
  479. end
  480. end
  481.  
  482. def discovery_ball__values(value, target, item)
  483. p "Disco ball activated"
  484. case target.generation_id.to_i
  485. when 1
  486. return value *= 0.5
  487. when 2
  488. return value *= 1.5
  489. when 3
  490. return value *= 2.0
  491. when 4
  492. return value *= 3.0
  493. when 5
  494. return value *= 4.0
  495. else
  496. return value = 0.0
  497. end
  498. end
  499.  
  500. def legendary_ball__values(value, target, item)
  501. p "Legend ball activated"
  502. return value *= 10.0 if target.legendary
  503. return value
  504. end
  505.  
  506. def heavy_ball_2_values(value, target, item)
  507. value -= value if target.weight > 903.0
  508. value *= 20.0 if target.weight > 677.3 && target.weight <= 903.0
  509. value *= 30.0 if target.weight > 451.1 && target.weight <= 677.3
  510. value *= 40.0 if target.weight <= 451.1
  511. return value
  512. end
  513.  
  514. end
  515.  
  516. #===============================================================================#
  517. # - SCRIPT END - #
  518. #===============================================================================#
  519. # http://dekitarpg.wordpress.com/ #
  520. #===============================================================================#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement