daily pastebin goal
56%
SHARE
TWEET

W/A - Randomaizer

KinghtTeam Feb 11th, 2018 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #Weapon/Armor Randomization v1.7
  2. #----------#
  3. #Features: Allow the stats of an item to be randomized, yay! Also can tack
  4. #           on random prefixes and suffixes. Oooh, fancy.
  5. #
  6. #Usage:    Basic Usage:
  7. #
  8. #           Note tags for weapons and armors:
  9. #
  10. #            <HP amount>  <HP% amount>  <ATK amount>  <ATK% amount>
  11. #            <MP amount>  <MP% amount>  <DEF amount>  <DEF% amount>
  12. #          <MAT amount>  <MAT% amount>  <MDF amount>  <MDF% amount>
  13. #          <AGI amount>  <AGI% amount>  <LUK amount>  <LUK% amount>
  14. #          <PRICE amount> <PRICE% amount>
  15. #
  16. #           Where amount is the amount to be randomly added on, with % being
  17. #             a percentage instead of specific.
  18. #           Examples: <HP 500>  or  <HP% 10>
  19. #
  20. #           Script calls:
  21. #            add_armor(base_id, amount)
  22. #            add_weapon(base_id, amount)
  23. #          
  24. #           These script calls create a new version of the item of the base_id
  25. #            number, with randomized stats as set in their note.
  26. #
  27. #          Advanced Usage:
  28. #          
  29. #           Note tags for weapons and armors:
  30. #
  31. #            <SUFFIX# rarity>    <PREFIX# rarity>
  32. #
  33. #           Where # is the id number of the affix and rarity is the chance of it
  34. #            occuring with 100 always occuring and 1 almost never occuring.
  35. #            Multiple affix notes can be added and the first one that passes it's
  36. #            rarity chance will be added.
  37. #           Examples: <PREFIX1 50>  or  <SUFFIX2 90>
  38. #
  39. #          The Complicated Part: (Affixes)
  40. #           See that AFFIXES hash down there? That's where you set these up.
  41. #           Basic setup is:
  42. #             ID => { :symbol => data, },
  43. #           You can have as many different symbols in there as you want, each
  44. #            seperated by a comma, and don't forget the comma between each AFFIX
  45. #            id.
  46. #
  47. #           Usable Symbols:
  48. #          :name = "name"               :color = Color.new(r,g,b)
  49. #          :rarity = value              #Arbitrary value
  50. #          :animation = id      
  51. #          :icon = id
  52. #          :desc = "description"
  53. #           #Pdesc and Sdesc are added on to the current item description
  54. #          :pdesc = "prefix description"
  55. #          :sdesc = "suffix description"
  56. #
  57. #   :hp,   :mp,   :atk,   :def,   :mat,   :mdf,   :agi,   :luk    (random bonus)
  58. #   :Shp,  :Smp,  :Satk,  :Sdef,  :Smat,  :Smdf,  :Sagi,  :Sluk   (static bonus)
  59. #   :hpP,  :mpP,  :atkP,  :defP,  :matP,  :mdfP,  :agiP,  :lukP   (random % bonus)
  60. #   :ShpP, :SmpP, :SatkP, :SdefP, :SmatP, :SmdfP, :SagiP, :SlukP  (static % bonus)
  61. #
  62. #   :price, :Sprice, :priceP, :SpriceP
  63. #
  64. #       each of these goes :symbol = value
  65. #
  66. #          The fun part, :features
  67. #           You can have as many features as you want, set up in an array:
  68. #           :features = [[code, id, value],[code, id, value]] etc...
  69. #          But what are the codes, ids, and values?? Don't worry, I found out:
  70. #
  71. #           Element Rate   = 11, element_id, float value
  72. #           Debuff Rate    = 12, param_id, float value
  73. #           State Rate     = 13, state_id, float value
  74. #           State Resist   = 14, state_id, 0
  75. #
  76. #           Parameter      = 21, param_id, float value
  77. #           Ex-Parameter   = 22, exparam_id, float value
  78. #           Sp-Parameter   = 23, spparam_id, float value
  79. #
  80. #           Atk Element    = 31, element_id, 0
  81. #           Atk State      = 32, state_id, float value
  82. #           Atk Speed      = 33, 0, value
  83. #           Atk Times+     = 34, 0, value
  84. #
  85. #           Add Skill Type = 41, skill_type, 0
  86. #          Seal Skill Type = 42, skill_type, 0
  87. #           Add Skill      = 43, skill_id, 0
  88. #           Seal Skill     = 44, skill_id, 0
  89. #
  90. #           Equip Weapon   = 51, weapon_skill, 0
  91. #           Equip Armor    = 52, armor_skill, 0
  92. #           Fix Equip      = 53, item_type, 0
  93. #           Seal Equip     = 54, item_type, 0
  94. #           Slot Type      = 55, 1, 0
  95. #
  96. #           Action Times+  = 61, 0, value
  97. #           Special Flag   = 62, flag_id, 0
  98. #          Collapse Effect = 62, flag_id, 0
  99. #           Party Ability  = 63, flag_id, 0
  100. #
  101. #     float value = percentage value where 1 = 100%, 0.75 = 75%, and 1.25 = 125%
  102. #     param_id, 0=hp, 1=mp, 2=atk, 3=def, 4=mat, 5=mdf, 6=agi, 7=luk
  103. #
  104. #     Examples: [21, 2, 1.5] which would increase atk to 150%
  105. #               [62, 0, 0]   which makes the item give the auto-battle flag
  106. #               [32, 1, 0.5] which gives a 50% of applying death state
  107. #
  108. #----------#
  109. #-- Script by: Vlue of Daimonious Tails
  110. #
  111. #- Questions or comments can be:
  112. #    given by email: sumptuaryspade@live.ca
  113. #    provided on facebook: http://www.facebook.com/DaimoniousTailsGames
  114. #   All my other scripts and projects can be found here: http://daimonioustails.weebly.com/
  115. #
  116. #--- Free to use in any project, commercial or non-commercial, with credit given
  117. # - - Though a donation's always a nice way to say thank you~ (I also accept actual thank you's)
  118.  
  119. $imported = {} if $imported.nil?
  120. $imported[:Vlue_WARandom] = true
  121.  
  122. #If true, then weapons and armors dropped by enemies will be randomized
  123. RANDOM_ENEMY_DROPS = true
  124. #Pool Rarity (Instead of a first come first serve, each affix is given a chance)
  125. POOL_RARITY = false
  126. #If true, weapons and armors bought from shops will be randomized
  127. WA_SHOP_RANDOM = true
  128. #When shop items are specifically set to this price, they are randomized
  129. SHOP_SPECIFIC_RANDOM = 998
  130. #True if you are using Sleek Item Popup, and want those to popup!
  131. USE_ITEM_POPUP = false
  132. #Stack random weapons and armor, when false all equips are unique
  133. STACK_SAME_EQUIP = true
  134.  
  135. AFFIXES = {
  136.             #COLORS
  137.   1 => {:color => Color.new(50,255,0),
  138.         :ShpP => 10, :SmpP => 10, :SatkP => 10, :SdefP => 10,
  139.         :SmatP => 10, :SmdfP => 10, :SagiP => 10, :SlukP => 10}, #UNCOMMON
  140.   2 => {:color => Color.new(50,100,235),
  141.         :ShpP => 20, :SmpP => 20, :SatkP => 20, :SdefP => 20,
  142.         :SmatP => 20, :SmdfP => 20, :SagiP => 20, :SlukP => 20}, #RARE
  143.   3 => {:color => Color.new(255,25,255),
  144.         :ShpP => 35, :SmpP => 35, :SatkP => 35, :SdefP => 35,
  145.         :SmatP => 35, :SmdfP => 35, :SagiP => 35, :SlukP => 35}, #EPIC
  146.   4 => {:name => "Legendary ", :color => Color.new(255,175,75),
  147.         :ShpP => 50, :SmpP => 50, :SatkP => 50, :SdefP => 50,
  148.         :SmatP => 50, :SmdfP => 50, :SagiP => 50, :SlukP => 50}, #LEGENDARY
  149.        
  150.   #-----------------------------------------------------------------------------
  151.   # Weapon Prefixes:
  152.   #-----------------------------------------------------------------------------
  153.     # Elemental:
  154.   5 => {:name => "Burning ", :color => Color.new(255,100,100), :rarity => 1,
  155.         :atkP => 5, :matP => 5, :features => [[31,3,0]]},
  156.   6 => {:name => "Freezing ", :color => Color.new(100,180,255), :rarity => 1,
  157.         :atkP => 5, :matP => 5, :features => [[31,4,0]]},
  158.   7 => {:name => "Shocking ", :color => Color.new(255,180,50), :rarity => 1,
  159.         :atkP => 5, :matP => 5, :features => [[31,5,0]]},
  160.   8 => {:name => "Flooding ", :color => Color.new(80,80,220), :rarity => 1,
  161.         :atkP => 5, :matP => 5, :features => [[31,6,0]]},
  162.   9 => {:name => "Trembling ", :color => Color.new(150,100,10), :rarity => 1,
  163.         :atkP => 5, :matP => 5, :features => [[31,7,0]]},
  164.  10 => {:name => "Blowing ", :color => Color.new(100,255,100), :rarity => 1,
  165.         :atkP => 5, :matP => 5, :features => [[31,8,0]]},
  166.  11 => {:name => "Holy ", :color => Color.new(255,255,100), :rarity => 1,
  167.         :atkP => 8, :matP => 6, :features => [[31,9,0]]},
  168.  12 => {:name => "Evil ", :color => Color.new(150,80,220), :rarity => 1,
  169.         :atkP => 6, :matP => 8, :features => [[31,10,0]]},
  170.        
  171.     # Various:
  172.  13 => {:name => "Sharp ", :color => Color.new(150,80,220), :rarity => 1,
  173.         :atkP => 10, :matP => 10, :features => [[22,2,0.05]]},
  174.  14 => {:name => "Berserker's ", :color => Color.new(150,80,220), :rarity => 1,
  175.         :atkP => 10, :matP => 10, :features => [[23,5,0.05]]},
  176.  15 => {:name => "Accurate ", :color => Color.new(150,80,220), :rarity => 1,
  177.         :atkP => 10, :matP => 10, :features => [[22,0,0.1]]},
  178.  16 => {:name => "Training ", :color => Color.new(150,80,220), :rarity => 1,
  179.         :atkP => -10, :matP => -10, :features => [[23,9,1.25]]},
  180.  17 => {:name => "Vengeful ", :color => Color.new(150,80,220), :rarity => 1,
  181.         :atkP => 10, :matP => 10, :features => [[22,6,0.1]]},
  182.  18 => {:name => "Magician's ", :color => Color.new(150,80,220), :rarity => 1,
  183.         :defP => 10, :mdfP => 10, :features => [[23,4,0.5]]},
  184.        
  185.   #-----------------------------------------------------------------------------
  186.   # Weapon Suffixes:
  187.   #-----------------------------------------------------------------------------
  188.     #States:
  189.  19 => {:name => " of Death", :color => Color.new(150,80,220), :rarity => 2,
  190.         :lukP => 2, :features => [[32,1,0.1]]},
  191.  20 => {:name => " of Poison", :color => Color.new(150,80,220), :rarity => 2,
  192.         :lukP => 2, :features => [[32,2,0.1]]},
  193.  21 => {:name => " of Blindness", :color => Color.new(150,80,220), :rarity => 2,
  194.         :lukP => 2, :features => [[32,3,0.1]]},
  195.  22 => {:name => " of Silence", :color => Color.new(150,80,220), :rarity => 2,
  196.         :lukP => 2, :features => [[32,4,0.1]]},
  197.  23 => {:name => " of Confusion", :color => Color.new(150,80,220), :rarity => 2,
  198.         :lukP => 2, :features => [[32,5,0.1]]},
  199.  24 => {:name => " of Sleep", :color => Color.new(150,80,220), :rarity => 2,
  200.         :lukP => 2, :features => [[32,6,0.1]]},
  201.  25 => {:name => " of Paralysis", :color => Color.new(150,80,220), :rarity => 2,
  202.         :lukP => 2, :features => [[32,7,0.1]]},
  203.  26 => {:name => " of Stun", :color => Color.new(150,80,220), :rarity => 2,
  204.         :lukP => 2, :features => [[32,8,0.1]]},
  205.        
  206.     # Various:
  207.  27 => {:name => " of Fortune", :color => Color.new(150,80,220), :rarity => 1,
  208.         :atkP => 10, :matP => 10, :features => [[64,4,0]]},
  209.  28 => {:name => " of Treasures", :color => Color.new(150,80,220), :rarity => 1,
  210.         :atkP => 10, :matP => 10, :features => [[64,5,0]]},
  211.  29 => {:name => " of Awareness", :color => Color.new(150,80,220), :rarity => 1,
  212.         :atkP => 10, :matP => 10, :features => [[64,2,0]]},
  213.  30 => {:name => " of Actions", :color => Color.new(150,80,220), :rarity => 1,
  214.         :atkP => 10, :matP => 10, :features => [[61,0,0.25]]},
  215.  31 => {:name => " of Speed", :color => Color.new(150,80,220), :rarity => 1,
  216.         :atkP => 10, :matP => 10, :features => [[33,0,15]]},
  217.  32 => {:name => " of Continuum", :color => Color.new(150,80,220), :rarity => 1,
  218.         :atkP => -5, :matP => -5, :features => [[34,0,2]]},  
  219.        
  220.   #-----------------------------------------------------------------------------
  221.   # Armor Prefixes:
  222.   #-----------------------------------------------------------------------------
  223.     # Elemental:
  224.  33 => {:name => "Fireproof ", :color => Color.new(255,100,100), :rarity => 1,
  225.         :defP => 5, :mdfP => 5, :features => [[11,3,-0.5],[11,4,0.3]]},
  226.  34 => {:name => "Iceproof ", :color => Color.new(100,180,255), :rarity => 1,
  227.         :defP => 5, :mdfP => 5, :features => [[11,4,-0.5],[11,3,0.3]]},
  228.  35 => {:name => "Thunderproof ", :color => Color.new(255,180,50), :rarity => 1,
  229.         :defP => 5, :mdfP => 5, :features => [[11,5,-0.5],[11,6,0.3]]},
  230.  36 => {:name => "Waterproof ", :color => Color.new(80,80,220), :rarity => 1,
  231.         :defP => 5, :mdfP => 5, :features => [[11,6,-0.5],[11,5,0.3]]},
  232.  37 => {:name => "Earthproof ", :color => Color.new(150,100,10), :rarity => 1,
  233.         :defP => 5, :mdfP => 5, :features => [[11,7,-0.5],[11,8,0.3]]},
  234.  38 => {:name => "Windproof ", :color => Color.new(100,255,100), :rarity => 1,
  235.         :defP => 5, :mdfP => 5, :features => [[11,8,-0.5],[11,7,0.3]]},
  236.  39 => {:name => "Sacred ", :color => Color.new(255,255,100), :rarity => 1,
  237.         :defP => 8, :mdfP => 6, :features => [[11,9,-0.5],[11,10,0.3]]},
  238.  40 => {:name => "Cursed ", :color => Color.new(150,80,220), :rarity => 1,
  239.         :defP => 6, :mdfP => 8, :features => [[11,10,-0.5],[11,9,0.3]]},
  240.        
  241.     # Various:
  242.  41 => {:name => "Solid ", :color => Color.new(150,80,220), :rarity => 1,
  243.         :defP => 15, :mdfP => 15, :features => [[22,3,0.1]]},
  244.  42 => {:name => "Evasive ", :color => Color.new(150,80,220), :rarity => 1,
  245.         :defP => 6, :mdfP => 8, :features => [[22,1,0.1]]},
  246.  43 => {:name => "Guarding ", :color => Color.new(150,80,220), :rarity => 1,
  247.         :defP => 6, :mdfP => 8, :features => [[23,1,1.2]]},
  248.  44 => {:name => "Herbalist's ", :color => Color.new(150,80,220), :rarity => 1,
  249.         :defP => 6, :mdfP => 8, :features => [[23,2,1.2],[23,3,1.2]]},
  250.  45 => {:name => "Warding ", :color => Color.new(150,80,220), :rarity => 1,
  251.         :defP => 6, :mdfP => 8, :features => [[64,1,0]]},
  252.  46 => {:name => "Training ", :color => Color.new(150,80,220), :rarity => 1,
  253.         :defP => -5, :mdfP => -5, :features => [[23,9,1.25]]},
  254.        
  255.   #-----------------------------------------------------------------------------
  256.   # Armor Suffixes:
  257.   #-----------------------------------------------------------------------------
  258.     # States:
  259.  47 => {:name => " of Anti-Death", :color => Color.new(150,80,220), :rarity => 2,
  260.         :lukP => 2, :features => [[14,1,0]]},
  261.  48 => {:name => " of Anti-Poison", :color => Color.new(150,80,220), :rarity => 2,
  262.         :lukP => 2, :features => [[14,2,0]]},
  263.  49 => {:name => " of Anti-Blindness", :color => Color.new(150,80,220), :rarity => 2,
  264.         :lukP => 2, :features => [[14,3,0]]},
  265.  50 => {:name => " of Anti-Silence", :color => Color.new(150,80,220), :rarity => 2,
  266.         :lukP => 2, :features => [[14,4,0]]},
  267.  51 => {:name => " of Anti-Confusion", :color => Color.new(150,80,220), :rarity => 2,
  268.         :lukP => 2, :features => [[14,5,0]]},
  269.  52 => {:name => " of Anti-Sleep", :color => Color.new(150,80,220), :rarity => 2,
  270.         :lukP => 2, :features => [[14,6,0]]},
  271.  53 => {:name => " of Anti-Paralysis", :color => Color.new(150,80,220), :rarity => 2,
  272.         :lukP => 2, :features => [[14,7,0]]},
  273.  54 => {:name => " of Anti-Stun", :color => Color.new(150,80,220), :rarity => 2,
  274.         :lukP => 2, :features => [[14,8,0]]},
  275.  
  276.     # Various:
  277.  55 => {:name => " of HP Regen", :color => Color.new(240,80,100), :rarity => 2,
  278.         :defP => 5, :mdfP => 5, :features => [[22,7,0.02]]},
  279.  56 => {:name => " of MP Regen", :color => Color.new(100,80,240), :rarity => 2,
  280.         :defP => 5, :mdfP => 5, :features => [[22,8,0.02]]},
  281.  57 => {:name => " of TP Regen", :color => Color.new(250,250,20), :rarity => 2,
  282.         :defP => 5, :mdfP => 5, :features => [[22,9,0.02]]},
  283.  58 => {:name => " of Reflection", :color => Color.new(250,250,20), :rarity => 2,
  284.         :defP => 5, :mdfP => 5, :features => [[22,5,0.1]]},
  285.  59 => {:name => " of Resistance", :color => Color.new(250,250,20), :rarity => 2,
  286.         :defP => 5, :mdfP => 5, :features => [[23,6,0.75],[23,7,0.75]]},
  287.  60 => {:name => " of Smoke", :color => Color.new(250,250,20), :rarity => 2,
  288.         :defP => 5, :mdfP => 5, :features => [[22,3,0.1],[22,4,0.1],[23,0,0.8]]},
  289.        
  290.   #-----------------------------------------------------------------------------
  291.   # Weapon + Armor Prefixes:
  292.   #-----------------------------------------------------------------------------
  293.     # Params:
  294.  61 => {:name => "Giant's ", :color => Color.new(255,80,80), :rarity => 1,
  295.         :hpP => 10},
  296.  62 => {:name => "Lord's ", :color => Color.new(80,80,230), :rarity => 1,
  297.         :mpP => 10},
  298.  63 => {:name => "Fighter's ", :color => Color.new(255,150,150), :rarity => 1,
  299.         :atkP => 10},
  300.  64 => {:name => "Soldier's ", :color => Color.new(150,100,10), :rarity => 1,
  301.         :defP => 10},
  302.  65 => {:name => "Sorcerer's ", :color => Color.new(150,100,220), :rarity => 1,
  303.         :matP => 10},
  304.  66 => {:name => "Priest's ", :color => Color.new(100,160,255), :rarity => 1,
  305.         :mdfP => 10},
  306.  67 => {:name => "Thief's ", :color => Color.new(50,255,100), :rarity => 1,
  307.         :agiP => 10},
  308.  68 => {:name => "Traveler's ", :color => Color.new(255,255,10), :rarity => 1,
  309.         :lukP => 10},
  310.        
  311.  69 => {:name => "Titan's ", :color => Color.new(255,80,80), :rarity => 1,
  312.         :hpP => 25},
  313.  70 => {:name => "Emperor's ", :color => Color.new(80,80,230), :rarity => 1,
  314.         :mpP => 25},
  315.  71 => {:name => "Warrior's ", :color => Color.new(255,150,150), :rarity => 1,
  316.         :atkP => 25},
  317.  72 => {:name => "Paladin's ", :color => Color.new(150,100,10), :rarity => 1,
  318.         :defP => 25},
  319.  73 => {:name => "Wizard's ", :color => Color.new(150,100,220), :rarity => 1,
  320.         :matP => 25},
  321.  74 => {:name => "Conjurer's ", :color => Color.new(100,160,255), :rarity => 1,
  322.         :mdfP => 25},
  323.  75 => {:name => "Rogue's ", :color => Color.new(50,255,100), :rarity => 1,
  324.         :agiP => 25},
  325.  76 => {:name => "Adventurer's ", :color => Color.new(255,255,10), :rarity => 1,
  326.         :lukP => 25},
  327.        
  328.  77 => {:name => "Gladiator's ", :color => Color.new(255,255,10), :rarity => 1,
  329.         :atkP => 20, :defP => 20},
  330.  78 => {:name => "Witch's ", :color => Color.new(255,255,10), :rarity => 1,
  331.         :matP => 20, :mdfP => 20},
  332.  79 => {:name => "Hunter's ", :color => Color.new(255,255,10), :rarity => 1,
  333.         :agiP => 20, :lukP => 20},
  334.  
  335.  80 => {:name => "King's ", :color => Color.new(255,255,100), :rarity => 1,
  336.         :hpP => 10, :mpP => 10, :atkP => 10, :defP => 10,
  337.         :matP => 10, :mdfP => 10, :agiP => 10, :lukP => 10},
  338.  81 => {:name => "God's ", :color => Color.new(255,255,100), :rarity => 1,
  339.         :hpP => 25, :mpP => 25, :atkP => 25, :defP => 25,
  340.         :matP => 25, :mdfP => 25, :agiP => 25, :lukP => 25},
  341.        
  342.  82 => {:name => "Broken ", :color => Color.new(255,255,100), :rarity => 1,
  343.         :hpP => -20, :mpP => -20, :atkP => -20, :defP => -20,
  344.         :matP => -20, :mdfP => -20, :agiP => -20, :lukP => -20},
  345.  83 => {:name => "Rusty ", :color => Color.new(255,255,100), :rarity => 1,
  346.         :hpP => -10, :mpP => -10, :atkP => -10, :defP => -10,
  347.         :matP => -10, :mdfP => -10, :agiP => -10, :lukP => -10},
  348.        
  349.   #-----------------------------------------------------------------------------
  350.   # Weapon + Armor Suffixes:
  351.   #-----------------------------------------------------------------------------
  352.     # Skill Type Unlock:
  353.  84 => {:name => " of Fire", :color => Color.new(255,100,100), :rarity => 1,
  354.         :features => [[41,3,0]]},
  355.  85 => {:name => " of Ice", :color => Color.new(100,180,255), :rarity => 1,
  356.         :features => [[41,4,0]]},
  357.  86 => {:name => " of Thunder", :color => Color.new(255,180,50), :rarity => 1,
  358.         :features => [[41,5,0]]},
  359.  87 => {:name => " of Water", :color => Color.new(80,80,220), :rarity => 1,
  360.         :features => [[41,6,0]]},
  361.  88 => {:name => " of Earth", :color => Color.new(150,100,10), :rarity => 1,
  362.         :features => [[41,7,0]]},
  363.  89 => {:name => " of Wind", :color => Color.new(100,255,100), :rarity => 1,
  364.         :features => [[41,8,0]]},
  365.  90 => {:name => " of Light", :color => Color.new(255,255,100), :rarity => 1,
  366.         :features => [[41,9,0]]},
  367.  91 => {:name => " of Darkness", :color => Color.new(150,80,220), :rarity => 1,
  368.         :features => [[41,10,0]]},
  369.        
  370.     # Various:
  371.  92 => {:name => " of Rage", :color => Color.new(150,80,220), :rarity => 1,
  372.         :atkP => 20, :lukP => 10, :defP => -10,
  373.         :features => [[22,0,-0.1],[22,7,-0.01],[22,2,0.25],[23,0,1.5],[23,5,2.0]]},
  374.  93 => {:name => " of Eternity", :color => Color.new(150,80,220), :rarity => 1,
  375.         :hpP => -15, :mpP => -15,
  376.         :features => [[23,7,0.01],[23,8,0.01],[23,9,0.01],[23,5,0.0]]},
  377.  94 => {:name => " of the End", :color => Color.new(150,80,220), :rarity => 1,
  378.         :Satk => 9999, :Sdef => 9999, :Smat => 9999,
  379.         :Smdf => 9999, :Sagi => 9999, :Sluk => 9999,
  380.         :features => [[22,7,-0.95],[22,0,10.0],[23,2,0.1],[23,3,0.1]]},
  381.  95 => {:name => " of Protectors", :color => Color.new(150,80,220), :rarity => 1,
  382.         :features => [[62,1,0],[62,2,0]]},
  383.  96 => {:name => " of Technique", :color => Color.new(150,80,220), :rarity => 1,
  384.         :features => [[62,3,0]]},
  385.  97 => {:name => " of Hunters", :color => Color.new(150,80,220), :rarity => 1,
  386.         :features => [[64,2,0],[64,3,0]]},
  387.  
  388.   #-----------------------------------------------------------------------------
  389.   # Item Prefixes:
  390.   #-----------------------------------------------------------------------------
  391.     # HP Potions:
  392.  98 => {:name => "Effective HP ", :color => Color.new(255,255,100), :rarity => 1,
  393.         :effects => [[11,0,0.05,0]]},
  394.  99 => {:name => "Upgraded HP ", :color => Color.new(255,255,100), :rarity => 1,
  395.         :effects => [[11,0,0.1,0]]},
  396. 100 => {:name => "Enhanced HP ", :color => Color.new(255,255,100), :rarity => 1,
  397.         :effects => [[11,0,0.15,0]]},
  398. 101 => {:name => "Unique HP ", :color => Color.new(255,255,100), :rarity => 1,
  399.         :effects => [[11,0,0.25,0]]},
  400. 102 => {:name => "Legendary HP ", :color => Color.new(255,255,100), :rarity => 1,
  401.         :effects => [[11,0,0.50,0]]},
  402.    
  403.     # MP Potions:
  404. 103 => {:name => "Effective MP ", :color => Color.new(255,255,100), :rarity => 1,
  405.         :effects => [[12,0,0.05,0]]},
  406. 104 => {:name => "Upgraded MP ", :color => Color.new(255,255,100), :rarity => 1,
  407.         :effects => [[12,0,0.1,0]]},
  408. 105 => {:name => "Enhanced MP ", :color => Color.new(255,255,100), :rarity => 1,
  409.         :effects => [[12,0,0.15,0]]},
  410. 106 => {:name => "Unique MP ", :color => Color.new(255,255,100), :rarity => 1,
  411.         :effects => [[12,0,0.25,0]]},
  412. 107 => {:name => "Legendary MP ", :color => Color.new(255,255,100), :rarity => 1,
  413.         :effects => [[12,0,0.50,0]]},
  414.        
  415.     # TP Potions:
  416. 108 => {:name => "Effective TP ", :color => Color.new(255,255,100), :rarity => 1,
  417.         :effects => [[13,0,0.05,0]]},
  418. 109 => {:name => "Upgraded TP ", :color => Color.new(255,255,100), :rarity => 1,
  419.         :effects => [[13,0,0.1,0]]},
  420. 110 => {:name => "Enhanced TP ", :color => Color.new(255,255,100), :rarity => 1,
  421.         :effects => [[13,0,0.15,0]]},
  422. 111 => {:name => "Unique TP ", :color => Color.new(255,255,100), :rarity => 1,
  423.         :effects => [[13,0,0.25,0]]},
  424. 112 => {:name => "Legendary TP ", :color => Color.new(255,255,100), :rarity => 1,
  425.         :effects => [[13,0,0.50,0]]},
  426.  
  427.     # Various Effects:
  428. 113 => {:name => "Unknown ", :color => Color.new(255,255,100), :rarity => 1,
  429.         :effects => [[44,1,0,0]]}, # Common Event 1!
  430.        
  431.   #-----------------------------------------------------------------------------
  432.   # Item Suffixes:
  433.   #-----------------------------------------------------------------------------
  434.     # Growth Effects:
  435. 114 => {:name => " of Life", :color => Color.new(255,255,100), :rarity => 1,
  436.         :effects => [[42,0,3,0]]},
  437. 115 => {:name => " of Mana", :color => Color.new(255,255,100), :rarity => 1,
  438.         :effects => [[42,1,3,0]]},
  439. 116 => {:name => " of Strength", :color => Color.new(255,255,100), :rarity => 1,
  440.         :effects => [[42,2,3,0]]},
  441. 117 => {:name => " of Defense", :color => Color.new(255,255,100), :rarity => 1,
  442.         :effects => [[42,3,3,0]]},
  443. 118 => {:name => " of Magic", :color => Color.new(255,255,100), :rarity => 1,
  444.         :effects => [[42,4,3,0]]},
  445. 119 => {:name => " of Essence", :color => Color.new(255,255,100), :rarity => 1,
  446.         :effects => [[42,5,3,0]]},
  447. 120 => {:name => " of Agility", :color => Color.new(255,255,100), :rarity => 1,
  448.         :effects => [[42,6,3,0]]},
  449. 121 => {:name => " of Luck", :color => Color.new(255,255,100), :rarity => 1,
  450.         :effects => [[42,7,3,0]]},
  451. 122 => {:name => " of Growth", :color => Color.new(255,255,100), :rarity => 1,
  452.         :effects => [[42,0,5,0],[42,1,5,0],[42,2,5,0],[42,3,5,0],
  453.                      [42,4,5,0],[42,5,5,0],[42,6,5,0],[42,7,5,0]]},
  454.  
  455.     # State Cure:
  456. 123 => {:name => " of Resurrection", :color => Color.new(150,80,220), :rarity => 2,
  457.         :effects => [[22,1,1.0,0]]},
  458. 124 => {:name => " of Antidote", :color => Color.new(150,80,220), :rarity => 2,
  459.         :effects => [[22,2,1.0,0]]},
  460. 125 => {:name => " of Vision", :color => Color.new(150,80,220), :rarity => 2,
  461.         :effects => [[22,3,1.0,0]]},
  462. 126 => {:name => " of Voice", :color => Color.new(150,80,220), :rarity => 2,
  463.         :effects => [[22,4,1.0,0]]},
  464. 127 => {:name => " of Order", :color => Color.new(150,80,220), :rarity => 2,
  465.         :effects => [[22,5,1.0,0]]},
  466. 128 => {:name => " of Awakening", :color => Color.new(150,80,220), :rarity => 2,
  467.         :effects => [[22,6,1.0,0]]},
  468. 129 => {:name => " of Neuron", :color => Color.new(150,80,220), :rarity => 2,
  469.         :effects => [[22,7,1.0,0]]},
  470. 130 => {:name => " of Sense", :color => Color.new(150,80,220), :rarity => 2,
  471.         :effects => [[22,8,1.0,0]]},
  472.        
  473. 131 => {:name => " of Miracles", :color => Color.new(150,80,220), :rarity => 2,
  474.         :effects => [[22,1,1.0,0],[22,2,1.0,0],[22,3,1.0,0],[22,4,1.0,0],
  475.                      [22,5,1.0,0],[22,6,1.0,0],[22,7,1.0,0],[22,8,1.0,0]]},
  476.  
  477.     # Buff Effects:
  478. 132 => {:name => " of Health", :color => Color.new(150,80,220), :rarity => 2,
  479.         :effects => [[31,0,5,0]]},
  480. 133 => {:name => " of Mana", :color => Color.new(150,80,220), :rarity => 2,
  481.         :effects => [[31,1,5,0]]},
  482. 134 => {:name => " of Strength", :color => Color.new(150,80,220), :rarity => 2,
  483.         :effects => [[31,2,5,0]]},
  484. 135 => {:name => " of Defense", :color => Color.new(150,80,220), :rarity => 2,
  485.         :effects => [[31,3,5,0]]},
  486. 136 => {:name => " of Sorcery", :color => Color.new(150,80,220), :rarity => 2,
  487.         :effects => [[31,4,5,0]]},
  488. 137 => {:name => " of Essence", :color => Color.new(150,80,220), :rarity => 2,
  489.         :effects => [[31,5,5,0]]},
  490. 138 => {:name => " of Agility", :color => Color.new(150,80,220), :rarity => 2,
  491.         :effects => [[31,6,5,0]]},
  492. 139 => {:name => " of Luck", :color => Color.new(150,80,220), :rarity => 2,
  493.         :effects => [[31,7,5,0]]},
  494.        
  495. 140 => {:name => " of Bravery", :color => Color.new(150,80,220), :rarity => 2,
  496.         :effects => [[31,0,10,0],[31,1,10,0],[31,2,10,0],[31,3,10,0],
  497.                      [31,4,10,0],[31,5,10,0],[31,6,10,0],[31,7,10,0]]},
  498.  
  499.     # Skill Learning:
  500. 141 => {:name => " of Fire Element", :color => Color.new(150,80,220), :rarity => 2,
  501.         :effects => [[43,51,0,0],[43,53,0,0]]}, # Fire
  502. 142 => {:name => " of Ice Element", :color => Color.new(150,80,220), :rarity => 2,
  503.         :effects => [[43,55,0,0],[43,57,0,0]]}, # Ice
  504. 143 => {:name => " of Thunder Element", :color => Color.new(150,80,220), :rarity => 2,
  505.         :effects => [[43,59,0,0],[43,61,0,0]]}, # Thunder
  506. 144 => {:name => " of Water Element", :color => Color.new(150,80,220), :rarity => 2,
  507.         :effects => [[43,63,0,0],[43,64,0,0]]}, # Water
  508. 145 => {:name => " of Earth Element", :color => Color.new(150,80,220), :rarity => 2,
  509.         :effects => [[43,65,0,0],[43,66,0,0]]}, # Earth
  510. 146 => {:name => " of Wind Element", :color => Color.new(150,80,220), :rarity => 2,
  511.         :effects => [[43,67,0,0],[43,68,0,0]]}, # Wind
  512. 147 => {:name => " of Light Element", :color => Color.new(150,80,220), :rarity => 2,
  513.         :effects => [[43,69,0,0],[43,70,0,0]]}, # Holy
  514. 148 => {:name => " of Dark Element", :color => Color.new(150,80,220), :rarity => 2,
  515.         :effects => [[43,71,0,0],[43,72,0,0]]}, # Darkness
  516.      
  517.   #-----------------------------------------------------------------------------
  518.   # Weapon Prefixes - Convert Damage Effects:
  519.   #-----------------------------------------------------------------------------
  520.  
  521. 149 => {:name => "Vampire's ", :color => Color.new(255,255,100), :rarity => 1,
  522.         :atkP => 5, :convert_damage => [[:hp_physical,0.05]]},
  523. 150 => {:name => "Leech's ", :color => Color.new(255,255,100), :rarity => 1,
  524.         :matP => 5, :convert_damage => [[:mp_magical,0.05]]},
  525.  
  526. 151 => {:name => "Eternal ", :color => Color.new(255,255,100), :rarity => 1,
  527.         :atkP => 10, :matP => 10,
  528.         :convert_damage => [[:hp_magical,0.05],[:mp_physical,0.05]]},
  529.        
  530.   #-----------------------------------------------------------------------------        
  531.   # Armor Suffixes - Anti-Convert Damage Effects:
  532.   #-----------------------------------------------------------------------------
  533.  
  534. 152 => {:name => " of Physics", :color => Color.new(255,255,100), :rarity => 1,
  535.         :defP => 5, :anticonvert => [:hp_physical,:mp_physical]},
  536. 153 => {:name => " of Magics", :color => Color.new(255,255,100), :rarity => 1,
  537.         :mdfP => 5, :anticonvert => [:hp_magical,:mp_magical]},
  538.        
  539. 154 => {:name => " of the Cross", :color => Color.new(255,255,100), :rarity => 1,
  540.         :defP => 10, :mdf => 10, :anticonvert => [:hp_physical,:mp_magical]},
  541.        
  542.   #-----------------------------------------------------------------------------        
  543.   # Clear Affixes:
  544.   #-----------------------------------------------------------------------------
  545.  
  546. 155 => {}, # For Prefix.
  547. 156 => {}, # For Suffix.
  548.  
  549.   }
  550.  
  551. class Game_Interpreter
  552.   def add_weapon(id, am)
  553.     item = $game_party.add_weapon(id,am)
  554.     popup(1,item.id,am) if USE_ITEM_POPUP
  555.     item
  556.   end
  557.   def add_armor(id, am)
  558.     item = $game_party.add_armor(id, am)
  559.     popup(2,item.id,am) if USE_ITEM_POPUP
  560.     item
  561.   end
  562.   def add_item(id, am)
  563.     item = $game_party.add_item(id, am)
  564.     popup(0,item.id,am) if USE_ITEM_POPUP
  565.     item
  566.   end
  567.   def edit_affixes(item, subnote = nil)
  568.     $game_party.edit_affixes(item, subnote)
  569.   end
  570. end
  571.  
  572. class Game_Party
  573.   alias rig_initialize initialize
  574.   def initialize
  575.     rig_initialize
  576.     @saved_weapons = $data_weapons
  577.     @saved_armors = $data_armors
  578.   end
  579.   attr_accessor :saved_weapons
  580.   attr_accessor :saved_armors
  581.   def add_weapon(id, amount, false_add = false)
  582.     item = Marshal.load(Marshal.dump($data_weapons[id]))
  583.     edit_item(item)
  584.     edit_affixes(item)
  585.     if STACK_SAME_EQUIP
  586.       $data_weapons.each do |base_item|
  587.         next if base_item.nil?
  588.         if ( item.params == base_item.params &&
  589.             item.price == base_item.price &&
  590.             item.name == base_item.name &&
  591.             item.color == base_item.color)
  592.           $game_party.gain_item(base_item, amount) unless false_add
  593.           return base_item
  594.         end
  595.       end
  596.     end
  597.     item.note = $data_weapons[item.id].note
  598.     item.set_original(item.id)
  599.     item.id = $data_weapons.size
  600.     $data_weapons.push(item)
  601.     $game_party.gain_item(item, amount) unless false_add
  602.     return item
  603.   end
  604.   def add_armor(id, amount, false_add = false)
  605.     item = Marshal.load(Marshal.dump($data_armors[id]))
  606.     edit_item(item)
  607.     edit_affixes(item)
  608.     if STACK_SAME_EQUIP
  609.       $data_armors.each do |base_item|
  610.         next if base_item.nil?
  611.         if ( item.params == base_item.params &&
  612.             item.price == base_item.price &&
  613.             item.name == base_item.name &&
  614.             item.color == base_item.color)
  615.           $game_party.gain_item(base_item, amount) unless false_add
  616.           return base_item
  617.         end
  618.       end
  619.     end
  620.     item.note = $data_armors[item.id].note
  621.     item.set_original(item.id)
  622.     item.id = $data_armors.size
  623.     $data_armors.push(item)
  624.     $game_party.gain_item(item, amount) unless false_add
  625.     return item
  626.   end
  627.   def add_item(id, amount, false_add = false)
  628.     item = Marshal.load(Marshal.dump($data_items[id]))
  629.     edit_item(item)
  630.     edit_affixes(item)
  631.     $data_items.each do |base_item|
  632.       next if base_item.nil?
  633.       if (item.price == base_item.price &&
  634.           item.name == base_item.name )
  635.         $game_party.gain_item(base_item, amount) unless false_add
  636.         return base_item
  637.       end
  638.     end
  639.     item.note = $data_items[item.id].note
  640.     item.set_original(item.id)
  641.     item.id = $data_items.size
  642.     $data_items.push(item)
  643.     $game_party.gain_item(item, amount) unless false_add
  644.     return item
  645.   end
  646.   def edit_affixes(item, subnote = nil)
  647.     note = item.note.clone
  648.     note = subnote.clone if subnote
  649.     affix_pool = []
  650.     while note.include?("<SUF")
  651.       id = note =~ /<SUFFIX(\d+) (\d+)>/
  652.       if !POOL_RARITY
  653.         if !AFFIXES[$~[1].to_i].nil?
  654.           break if add_affix(item, $~[1].to_i, false) if rand(100) < $2.to_i
  655.           note[id] = "N"
  656.         else
  657.           msgbox("Affix #" + $1 + " doesn't exist. \nItem creation failed.")
  658.           return
  659.         end
  660.       else
  661.         if !AFFIXES[$~[1].to_i].nil?
  662.           $2.to_i.times do
  663.             affix_pool.push($1)
  664.           end
  665.           note[id] = "N"
  666.         else
  667.           msgbox("Affix #" + $1 + " doesn't exist. \nItem creation failed.")
  668.           return
  669.         end
  670.       end
  671.     end
  672.     if !affix_pool.empty?
  673.       add_affix(item, affix_pool[rand(affix_pool.size)], false) if POOL_RARITY
  674.     end
  675.     affix_pool = []
  676.     while note.include?("<PRE")
  677.       id = note =~ /<PREFIX(\d+) (\d+)>/
  678.       if !POOL_RARITY
  679.         if !AFFIXES[$~[1].to_i].nil?
  680.           break if add_affix(item, $~[1].to_i, true) if rand(100) < $2.to_i
  681.           note[id] = "N"
  682.         else
  683.           msgbox("Affix #" + $1 + " doesn't exist. \nItem creation failed.")
  684.           return
  685.         end
  686.       else
  687.         if !AFFIXES[$~[1].to_i].nil?
  688.           $2.to_i.times do
  689.             affix_pool.push($1)
  690.           end
  691.           note[id] = "N"
  692.         else
  693.           msgbox("Affix #" + $1 + " doesn't exist. \nItem creation failed.")
  694.           return
  695.         end
  696.       end
  697.     end
  698.     if !affix_pool.empty?
  699.       add_affix(item, affix_pool[rand(affix_pool.size)], true) if POOL_RARITY
  700.     end
  701.   end
  702.   def add_affix(item, id, prefix)
  703.     affix = AFFIXES[id.to_i]
  704.     if prefix && !affix[:name].nil?
  705.       item.name = affix[:name] + item.name
  706.     elsif !affix[:name].nil?
  707.       item.name = item.name + affix[:name]  
  708.     end
  709.     if !affix[:rarity].nil?
  710.       if item.rarity.nil? || item.rarity < affix[:rarity]
  711.         item.set_color(affix[:color]) if !affix[:color].nil?
  712.         item.rarity = affix[:rarity]
  713.       end
  714.     else
  715.       item.set_color(affix[:color]) if !affix[:color].nil?
  716.     end
  717.    
  718.     if !affix[:desc].nil?
  719.       item.description = affix[:desc]
  720.     end
  721.     if !affix[:pdesc].nil?
  722.       item.description = affix[:pdesc] + item.description
  723.     end
  724.     if !affix[:sdesc].nil?
  725.       item.description = item.description + affix[:sdesc]
  726.     end
  727.    
  728.    
  729.     if !item.is_a?(RPG::Armor) && !affix[:animation].nil?
  730.       item.animation_id = affix[:animation]
  731.     end
  732.    
  733.     item.icon_index = affix[:icon] if !affix[:icon].nil?
  734.    
  735.     if !item.is_a?(RPG::Item)
  736.       item.params[0] += rand(affix[:hp]) if !affix[:hp].nil?
  737.       item.params[1] += rand(affix[:mp]) if !affix[:mp].nil?
  738.       item.params[2] += rand(affix[:atk]) if !affix[:atk].nil?
  739.       item.params[3] += rand(affix[:def]) if !affix[:def].nil?
  740.       item.params[4] += rand(affix[:mat]) if !affix[:mat].nil?
  741.       item.params[5] += rand(affix[:mdf]) if !affix[:mdf].nil?
  742.       item.params[6] += rand(affix[:agi]) if !affix[:agi].nil?
  743.       item.params[7] += rand(affix[:luk]) if !affix[:luk].nil?
  744.     end
  745.     item.price += rand(affix[:price]) if !affix[:price].nil?
  746.    
  747.     if !item.is_a?(RPG::Item)
  748.       item.params[0] += affix[:Shp] if !affix[:Shp].nil?
  749.       item.params[1] += affix[:Smp] if !affix[:Smp].nil?
  750.       item.params[2] += affix[:Satk] if !affix[:Satk].nil?
  751.       item.params[3] += affix[:Sdef] if !affix[:Sdef].nil?
  752.       item.params[4] += affix[:Smat] if !affix[:Smat].nil?
  753.       item.params[5] += affix[:Smdf] if !affix[:Smdf].nil?
  754.       item.params[6] += affix[:Sagi] if !affix[:Sagi].nil?
  755.       item.params[7] += affix[:Sluk] if !affix[:Sluk].nil?
  756.     end
  757.     item.price += affix[:Sprice] if !affix[:Sprice].nil?
  758.    
  759.     if !item.is_a?(RPG::Item)
  760.       item.params[0] += item.params[0] * (rand(affix[:hpP])) / 100 if !affix[:hpP].nil?
  761.       item.params[1] += item.params[1] * (rand(affix[:mpP])) / 100 if !affix[:mpP].nil?
  762.       item.params[2] += item.params[2] * (rand(affix[:atkP])) / 100 if !affix[:atkP].nil?
  763.       item.params[3] += item.params[3] * (rand(affix[:defP])) / 100 if !affix[:defP].nil?
  764.       item.params[4] += item.params[4] * (rand(affix[:matP])) / 100 if !affix[:matP].nil?
  765.       item.params[5] += item.params[5] * (rand(affix[:mdfP])) / 100 if !affix[:mdfP].nil?
  766.       item.params[6] += item.params[6] * (rand(affix[:agiP])) / 100 if !affix[:agiP].nil?
  767.       item.params[7] += item.params[7] * (rand(affix[:lukP])) / 100 if !affix[:lukP].nil?
  768.     end
  769.     item.price += item.price * (rand(affix[:priceP])) / 100 if !affix[:priceP].nil?
  770.    
  771.     if !item.is_a?(RPG::Item)
  772.       item.params[0] += item.params[0] * affix[:ShpP] / 100 if !affix[:ShpP].nil?
  773.       item.params[1] += item.params[1] * affix[:SmpP] / 100 if !affix[:SmpP].nil?
  774.       item.params[2] += item.params[2] * affix[:SatkP] / 100 if !affix[:SatkP].nil?
  775.       item.params[3] += item.params[3] * affix[:SdefP] / 100 if !affix[:SdefP].nil?
  776.       item.params[4] += item.params[4] * affix[:SmatP] / 100 if !affix[:SmatP].nil?
  777.       item.params[5] += item.params[5] * affix[:SmdfP] / 100 if !affix[:SmdfP].nil?
  778.       item.params[6] += item.params[6] * affix[:SagiP] / 100 if !affix[:SagiP].nil?
  779.       item.params[7] += item.params[7] * affix[:SlukP] / 100 if !affix[:SlukP].nil?
  780.     end
  781.     item.price += item.price * affix[:SpriceP] / 100 if !affix[:SpriceP].nil?
  782.    
  783.     if !affix[:features].nil? && !item.is_a?(RPG::Item)
  784.       for feature in affix[:features]
  785.         new_feature = RPG::BaseItem::Feature.new(feature[0], feature[1], feature[2])
  786.         item.features.push(new_feature)
  787.       end
  788.     end
  789.    
  790.     return true
  791.   end
  792.   def edit_item(item)
  793.     if !item.is_a?(RPG::Item)
  794.       item.note =~ /<HP (\d+)>/
  795.       item.params[0] += rand($~[1].to_i) if $~
  796.       item.note =~ /<MP (\d+)>/
  797.       item.params[1] += rand($~[1].to_i) if $~
  798.       item.note =~ /<ATK (\d+)>/
  799.       item.params[2] += rand($~[1].to_i) if $~
  800.       item.note =~ /<DEF (\d+)>/
  801.       item.params[3] += rand($~[1].to_i) if $~
  802.       item.note =~ /<MAT (\d+)>/
  803.       item.params[4] += rand($~[1].to_i) if $~
  804.       item.note =~ /<MDF (\d+)>/
  805.       item.params[5] += rand($~[1].to_i) if $~
  806.       item.note =~ /<AGI (\d+)>/
  807.       item.params[6] += rand($~[1].to_i) if $~
  808.       item.note =~ /<LUK (\d+)>/
  809.       item.params[7] += rand($~[1].to_i) if $~
  810.       item.note =~ /<PRICE (\d+)>/
  811.     end
  812.     item.price += rand($~[1].to_i) if $~
  813.    
  814.     if !item.is_a?(RPG::Item)
  815.       item.note =~ /<HP% (\d+)>/
  816.       item.params[0] += item.params[2] * (rand($~[1].to_i)) / 100 if $~
  817.       item.note =~ /<MP% (\d+)>/
  818.       item.params[1] += item.params[2] * (rand($~[1].to_i)) / 100 if $~
  819.       item.note =~ /<ATK% (\d+)>/
  820.       item.params[2] += item.params[2] * (rand($~[1].to_i)) / 100 if $~
  821.       item.note =~ /<DEF% (\d+)>/
  822.       item.params[3] += item.params[2] * (rand($~[1].to_i)) / 100 if $~
  823.       item.note =~ /<MAT% (\d+)>/
  824.       item.params[4] += item.params[2] * (rand($~[1].to_i)) / 100 if $~
  825.       item.note =~ /<MDF% (\d+)>/
  826.       item.params[5] += item.params[2] * (rand($~[1].to_i)) / 100 if $~
  827.       item.note =~ /<AGI% (\d+)>/
  828.       item.params[6] += item.params[2] * (rand($~[1].to_i)) / 100 if $~
  829.       item.note =~ /<LUK% (\d+)>/
  830.       item.params[7] += item.params[2] * (rand($~[1].to_i)) / 100 if $~
  831.       item.note =~ /<PRICE% (\d+)>/
  832.     end
  833.     item.price += item.price * (rand($~[1].to_i)) / 100 if $~
  834.   end
  835. end
  836.  
  837. module BattleManager
  838.   def self.gain_drop_items
  839.     $game_troop.make_drop_items.each do |item|
  840.       if RANDOM_ENEMY_DROPS
  841.         if item.is_a?(RPG::Weapon)
  842.           item = $game_party.add_weapon(item.id, 1)
  843.         elsif item.is_a?(RPG::Armor)
  844.           item = $game_party.add_armor(item.id, 1)
  845.         else
  846.           $game_party.gain_item(item, 1)
  847.         end
  848.       else
  849.         $game_party.gain_item(item, 1)
  850.       end
  851.       $game_message.add(sprintf(Vocab::ObtainItem, item.name))
  852.     end
  853.     wait_for_message
  854.   end
  855. end
  856.  
  857. class Scene_Load
  858.   alias rig_on_load_success on_load_success
  859.   def on_load_success
  860.     rig_on_load_success
  861.     $data_weapons = $game_party.saved_weapons
  862.     $data_armors = $game_party.saved_armors
  863.   end
  864. end
  865.  
  866. class Window_Base
  867.   def draw_item_name(item, x, y, enabled = true, width = 172)
  868.     return unless item
  869.     draw_icon(item.icon_index, x, y, enabled)
  870.     change_color(item.color, enabled)
  871.     draw_text(x + 24, y, width, line_height, item.name)
  872.     change_color(normal_color)
  873.   end
  874. end
  875.  
  876. class RPG::BaseItem
  877.   attr_accessor  :rarity
  878.   def color
  879.     return Color.new(255,255,255) unless @color
  880.     @color
  881.   end
  882.   def set_color(color)
  883.     @color = color
  884.   end
  885.   def original_id
  886.     @original_id ? @original_id : @id
  887.   end
  888.   def set_original(new_id)
  889.     @original_id = new_id
  890.   end
  891. end
  892.  
  893. class Scene_Shop
  894.   alias wa_do_buy do_buy
  895.   alias wa_prepare prepare
  896.   def prepare(*args)
  897.     wa_prepare(*args)
  898.     iter = -1
  899.     @goods.each do |array|
  900.       iter += 1
  901.       next unless array[2] == 1 && array[3] == SHOP_SPECIFIC_RANDOM
  902.       item = $game_party.add_item(array[1],1,true) if array[0] == 0
  903.       item = $game_party.add_weapon(array[1],1,true) if array[0] == 1
  904.       item = $game_party.add_armor(array[1],1,true) if array[0] == 2
  905.       @goods[iter] = [array[0],item.id,0,0]
  906.     end
  907.   end
  908.   def do_buy(number)
  909.     if WA_SHOP_RANDOM
  910.       number.times do |i|
  911.         $game_party.lose_gold(buying_price)
  912.         $game_party.add_weapon(@item.id, 1) if @item.is_a?(RPG::Weapon)
  913.         $game_party.add_armor(@item.id, 1) if @item.is_a?(RPG::Armor)
  914.         $game_party.gain_item(@item, 1) if @item.is_a?(RPG::Item)
  915.       end
  916.     else
  917.       wa_do_buy(number)
  918.     end
  919.   end
  920. end
RAW Paste Data
Top