Advertisement
Dekita

pbeffz 1.1

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