设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 2345|回复: 10
打印 上一主题 下一主题

[已经解决] 有關被動技能&裝備套裝效果問題

[复制链接]

Lv2.观梦者

梦石
0
星屑
348
在线时间
294 小时
注册时间
2013-6-1
帖子
121
跳转到指定楼层
1
发表于 2014-10-5 07:27:09 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
本帖最后由 e900003 于 2014-10-5 08:00 编辑

首先"被動技能"腳本
RUBY 代码复制
  1. #====================================================================
  2.     # 腳本名稱:被動技能
  3.     # 使用方法:在數據庫-技能-備註裡面打上所需效果即可(可多行)
  4.     # PS.只對主角有效,因為敵人沒有學會技能的系統
  5.     #====================================================================
  6.     # 被動技能能力表:
  7.     # <atk = i>            代表atk增加i
  8.     # <def = i>            代表def增加i
  9.     # <mat = i>            代表mat增加i
  10.     # <mdf = i>            代表mdf增加i
  11.     # <agi = i>            代表agi增加i
  12.     # <luk = i>            代表luk增加i
  13.     # <mhp = i>            代表mhp增加i
  14.     # <mmp = i>            代表mmp增加i
  15.     #
  16.     # <ratk = i>           代表atk增加i%(如果学会多个这样的技能,最终增加的是(i1+i2+...+ix)%)
  17.     # <rdef = i>           代表def增加i%(如果学会多个这样的技能,最终增加的是(i1+i2+...+ix)%)
  18.     # <rmat = i>           代表mat增加i%(如果学会多个这样的技能,最终增加的是(i1+i2+...+ix)%)
  19.     # <rmdf = i>           代表mdf增加i%(如果学会多个这样的技能,最终增加的是(i1+i2+...+ix)%)
  20.     # <ragi = i>           代表agi增加i%(如果学会多个这样的技能,最终增加的是(i1+i2+...+ix)%)
  21.     # <rluk = i>           代表luk增加i%(如果学会多个这样的技能,最终增加的是(i1+i2+...+ix)%)
  22.     # <rmhp = i>           代表mhp增加i%(如果学会多个这样的技能,最终增加的是(i1+i2+...+ix)%)
  23.     # <rmmp = i>           代表mmp增加i%(如果学会多个这样的技能,最终增加的是(i1+i2+...+ix)%)
  24.     #
  25.     # <hit = i>             代表命中率增加i%
  26.     # <eva = i>             代表回避率增加i%
  27.     # <cri = i>             代表必杀率增加i%
  28.     # <cev = i>             代表必杀回避率增加i%
  29.     # <mev = i>             代表魔法回避率增加i%
  30.     # <mrf = i>             代表魔法反射率增加i%
  31.     # <cnt = i>             代表反击率增加i%
  32.     # <hrg = i>             代表HP再生率增加i%
  33.     # <mrg = i>             代表MP再生率增加i%
  34.     # <trg = i>             代表TP再生率增加i%
  35.     #====================================================================
  36.     class Game_Actor < Game_Battler
  37.       #--------------------------------------------------------------------------
  38.       # ● 获取技能数组的被动属性(加法)
  39.       #--------------------------------------------------------------------------
  40.       def get_skills_paramad(param_id)
  41.         ren = 0
  42.         case param_id
  43.         when 0          #HP
  44.           skills.each {|skill| ren += (skill.note =~ /<mhp = (\d+?)>/i ? $1.to_i : 0) }
  45.         when 1          #MP
  46.           skills.each {|skill| ren += (skill.note =~ /<mmp = (\d+?)>/i ? $1.to_i : 0) }
  47.         when 2          #atk
  48.           skills.each {|skill| ren += (skill.note =~ /<atk = (\d+?)>/i ? $1.to_i : 0) }
  49.         when 3          #def
  50.           skills.each {|skill| ren += (skill.note =~ /<def = (\d+?)>/i ? $1.to_i : 0) }
  51.         when 4          #mat
  52.           skills.each {|skill| ren += (skill.note =~ /<mat = (\d+?)>/i ? $1.to_i : 0) }
  53.         when 5          #mdf
  54.           skills.each {|skill| ren += (skill.note =~ /<mdf = (\d+?)>/i ? $1.to_i : 0) }
  55.         when 6          #agi
  56.           skills.each {|skill| ren += (skill.note =~ /<agi = (\d+?)>/i ? $1.to_i : 0) }
  57.         when 7          #luk
  58.           skills.each {|skill| ren += (skill.note =~ /<luk = (\d+?)>/i ? $1.to_i : 0) }
  59.         else
  60.         end
  61.         return ren
  62.       end
  63.  
  64.       #--------------------------------------------------------------------------
  65.       # ● 获取技能数组的被动属性(乘法)
  66.       #--------------------------------------------------------------------------
  67.       def get_skills_parammu(param_id)
  68.         ren = 0
  69.         case param_id
  70.         when 0          #HP
  71.           skills.each {|skill| ren += (skill.note =~ /<rmhp = (\d+?)>/i ? $1.to_i : 0) }
  72.         when 1          #MP
  73.           skills.each {|skill| ren += (skill.note =~ /<rmmp = (\d+?)>/i ? $1.to_i : 0) }
  74.         when 2          #atk
  75.           skills.each {|skill| ren += (skill.note =~ /<ratk = (\d+?)>/i ? $1.to_i : 0) }
  76.         when 3          #def
  77.           skills.each {|skill| ren += (skill.note =~ /<rdef = (\d+?)>/i ? $1.to_i : 0) }
  78.         when 4          #mat
  79.           skills.each {|skill| ren += (skill.note =~ /<rmat = (\d+?)>/i ? $1.to_i : 0) }
  80.         when 5          #mdf
  81.           skills.each {|skill| ren += (skill.note =~ /<rmdf = (\d+?)>/i ? $1.to_i : 0) }
  82.         when 6          #agi
  83.           skills.each {|skill| ren += (skill.note =~ /<ragi = (\d+?)>/i ? $1.to_i : 0) }
  84.         when 7          #luk
  85.           skills.each {|skill| ren += (skill.note =~ /<rluk = (\d+?)>/i ? $1.to_i : 0) }
  86.         else
  87.         end
  88.         return ren * 0.01
  89.       end
  90.  
  91.       #--------------------------------------------------------------------------
  92.       # ● 获取技能数组的被动特殊属性(加法)
  93.       #--------------------------------------------------------------------------
  94.       def get_skills_xparamad(xparam_id)
  95.         ren = 0
  96.         case xparam_id
  97.         when 0          #命中率hit
  98.           skills.each {|skill| ren += (skill.note =~ /<hit = (\d+?)>/i ? $1.to_i : 0) }
  99.         when 1          #闪避率eva
  100.           skills.each {|skill| ren += (skill.note =~ /<eva = (\d+?)>/i ? $1.to_i : 0) }
  101.         when 2          #必杀率cri
  102.           skills.each {|skill| ren += (skill.note =~ /<cri = (\d+?)>/i ? $1.to_i : 0) }
  103.         when 3          #必杀回避率cev
  104.           skills.each {|skill| ren += (skill.note =~ /<cev = (\d+?)>/i ? $1.to_i : 0) }
  105.         when 4          #魔法回避率mev
  106.           skills.each {|skill| ren += (skill.note =~ /<mev = (\d+?)>/i ? $1.to_i : 0) }
  107.         when 5          #魔法反射率mrf
  108.           skills.each {|skill| ren += (skill.note =~ /<mrf = (\d+?)>/i ? $1.to_i : 0) }
  109.         when 6          #反击率cnt
  110.           skills.each {|skill| ren += (skill.note =~ /<cnt = (\d+?)>/i ? $1.to_i : 0) }
  111.         when 7          #HP再生率hrg
  112.           skills.each {|skill| ren += (skill.note =~ /<hrg = (\d+?)>/i ? $1.to_i : 0) }
  113.         when 8          #MP再生率mrg
  114.           skills.each {|skill| ren += (skill.note =~ /<mrg = (\d+?)>/i ? $1.to_i : 0) }
  115.         when 9          #TP再生率trg
  116.           skills.each {|skill| ren += (skill.note =~ /<trg = (\d+?)>/i ? $1.to_i : 0) }
  117.         else
  118.         end
  119.         return ren * 0.01
  120.       end
  121.  
  122.  
  123.       #--------------------------------------------------------------------------
  124.       # ● 获取普通能力的基础值
  125.       #--------------------------------------------------------------------------
  126.       alias tan_game_actor_param_base param_base
  127.       def param_base(param_id)
  128.         tan_game_actor_param_base(param_id) + get_skills_paramad(param_id)
  129.       end
  130.  
  131.  
  132.       #--------------------------------------------------------------------------
  133.       # ● 获取普通能力
  134.       #--------------------------------------------------------------------------
  135.       alias tan_game_actor_param param
  136.       def param(param_id)
  137.         value = param_base(param_id) + param_plus(param_id)
  138.         value *= (param_rate(param_id) + get_skills_parammu(param_id)) * param_buff_rate(param_id)
  139.         [[value, param_max(param_id)].min, param_min(param_id)].max.to_i
  140.       end
  141.  
  142.  
  143.       #--------------------------------------------------------------------------
  144.       # ● 获取添加能力
  145.       #--------------------------------------------------------------------------
  146.       alias tan_game_actor_xparam xparam
  147.       def xparam(xparam_id)
  148.         tan_game_actor_xparam(xparam_id) + get_skills_xparamad(xparam_id)
  149.       end
  150.     end


再來"裝備套裝效果"腳本
RUBY 代码复制
  1. #============================================================================
  2. # Equipment Sets v2.1e
  3. # By Emerald
  4. #----------------------------------------------------------------------------
  5. # You're free to use the script for any game, as long as you give credits
  6. #----------------------------------------------------------------------------
  7. # Version History
  8. # 1.0 -> Script fully ready for public use. Addes sets, unlimited set items,
  9. #        set bonuses for the 8 basic stats, set bonuses requirement (how many
  10. #        items of the set is the actor wearing?)
  11. # 1.1 -> a. changed the set bonuses work. Instead of [parameter, bonus] you now
  12. #        use [sort, parameter, bonus]. Also added sorts 0 and 2. Check SPECIAL
  13. #        VALUES for their corresponding parameters.
  14. #        b. Added sort 1: Standard Parameters (Percentage). The corresponding
  15. #        parameters are the same as for sort 0. See SPECIAL VALUES for extra
  16. #        notes.
  17. # 1.2 -> Added Sort 3: Special Parameters. The values for the parameters can be
  18. #        found in SPECIAL VALUES, just as usual. Addes Sort 4: Skills!! These
  19. #        use a different syntax than the other bonuses, so be sure to check
  20. #        SPECIAL VALUES if you are unfamiliar with them.
  21. # 1.3 -> a. rewritten most of the code to remove so major bugs. Also cleaned
  22. #        code (about 140 lines less this time, WITH 4 added Sorts). Added
  23. #        Module Emerald (EME). Sets and Set_Bonuses move to Module EME. Added
  24. #        MAX_ELEMENTS to Module EME. Added Sort 5 (Elemental Efficiency), Sort
  25. #        6 (Debuff Rate), Sort 7 (State Rate), Sort 8 (State Resist) and Sort 9
  26. #        (Attack Elements). See SPECIAL VALUES for instructions.
  27. #        WARNING these are still in Beta Stage, so report all bugs found.  
  28. #        b. removed many, MANY major bugs! Removed a bug where unequipping
  29. #        resulted in an undefined array, removed some typos, fixed the bonuses
  30. #        for almost EVERY Sort, removed some more typos, shortened code a little
  31. #        bit, removed some more minor bugs regarding change_equip.
  32. # 1.4 -> More bug fixes. Also added Sort 10 (Attack States), Sort 11 (Equipment
  33. #        Types) and Sort 12 (Attack Specials). Refer to SPECIAL VALUES for
  34. #        all needed information.
  35. # 1.5 -> Bug fix to discard_equip(...). Added the foruth value of Sort 11
  36. #        (Dual Wielding), added Sort 13, Sort 14, Sort 15, Sort 16 and Sort 17
  37. #        which are Additional Skill Types, Sealed Skill Types, Sealed Skills,
  38. #        Fixed Equip Types and Sealed Equip Types respectively. As usual, go to
  39. #        SPECIAL VALUES for the needed instructions.
  40. # 1.6 -> Added a compatibility patch for Fomar's Dual Wield -> Free Hands script.
  41. # 1.7 -> Added Sorts 18 (special flags), 19 (party abilities) and 20 (other
  42. #        traits). See SPECIAL VALUES for the instructions.
  43. # 1.8a-> Added sounds to be played when a certain amount of set pieces has been
  44. #        equipped. Also removed a bug regarding skipping amounts of pieces.
  45. # 1.8b-> Small bugfix regarding set sounds.
  46. # 1.8c-> Small bugfix regarding attack states.
  47. #
  48. # 2.0 -> MAJOR REWRITE. Aliased a few more methods than before, to further
  49. #        increases compatability. Added a method which initializes sets which
  50. #        are worn by actors at the start of the game. Halved the code used to
  51. #        determine if items belong to sets. Scraped a few uneccessairy methods.
  52. #        Practically removed 2/3 of my version of release_unequipable_equips,
  53. #        and made the EES + Fomar123's Dual Wield -> Free Hands script patch
  54. #        1 line instead of 10. Almost entirely changed the way Set Skills and
  55. #        Set Equipment Options work. Also fixed a few bugs in the progress
  56. #        (for example additions of variable 2 which I accidentally left in the
  57. #        script.)
  58. # 2.1a-> Start of the debugging patch. Added a function to remove bonuses when
  59. #        unequipping stuff, like usual. Forgot to re-add in 2.0 >.<
  60. # 2.1b-> Fixed a small typo.
  61. # 2.1c-> Fixed initalizition of set equips.
  62. # 2.1d-> Fixed a bug regarding bonuses not being applied upon optimizing equips
  63. #        and a bug regarding the removing of bonuses when unequipping stuff.
  64. # 2.1e-> Removed something which I should have added (regarding the BaseItem
  65. #        class) in release_unequippable_items. This also fixed the compatibility
  66. #        issues with Tsukihime's Effect Manager.
  67. #----------------------------------------------------------------------------
  68. # Started with a Iron Sword? Pretty good. Found a Gold Sword? Awesome! Found
  69. # the complete Bronze Set? Bad stuff...
  70. # Unless, they give you bonuses! In other words, this script allows you to create
  71. # bonuses for wearing multiple items of a set... Just wanted to make it sound
  72. # more fun...
  73. #
  74. # Instructions:
  75. #
  76. # Just as always, put this script between  Materials and  Main. Put this script
  77. # below any script which rewrites change_equip and above any script which aliases
  78. # 'param' in Game_Actor (usually in Game_BattlerBase, but it only matters if it
  79. # is rewritten/aliased in Game_Actor).
  80. #
  81. # Set MAX_ELEMENTS below module EME and above Sets to the maximum number of
  82. # elements in the database. Else, the script won't recognize any above the value.
  83. #
  84. #
  85. # SETS
  86. #
  87. # To create sets (sorry, no names yet) go to Sets in the configuration part.
  88. # Add the set id, followed by an array containing arrays. The latter arrays
  89. # must be at least two elements long, one for the type of equipment, one for the
  90. # id.
  91. # Examples:
  92. #
  93. # 1 => [[0, 1], [1, 2]], <- The []'s define an array. The arrays like the [0,1]
  94. # and [1, 2] should be at least two elements long (each element is separated by
  95. # a comma.
  96. #
  97. # 2 => [[0, 5], [0, 6], [1, 5], [1,7]], <- If the array is not the last in the
  98. # list, add a comma or you'll get an error. This goes for every array.
  99. #
  100. # set id => [[equipment type, equipment id], [equipment type, equipment id]]
  101. #
  102. # NOTE:
  103. # The set id MUST be 0 or higher. The variable in which the sets are stored (which
  104. # is called a hash) usually begins with 1 =>, so that's why that's also in the
  105. # standard config.
  106. # The Equipment Types are 0 (weapons) and 1 (armors.)
  107. # DO NOT COPY the ID of items in the database. If you put all the useless 0's
  108. # in front of the real ID, you'll get an error/the script won't work.
  109. # Furthermore, you can have an infinite amount of equipment belonging (is that a
  110. # word?) to a set, so don't worry about compatibility issues with Extra Equipment
  111. # Slots scripts. Unless they rewrite change_equip, than there's a slight chance
  112. # on problems. This can be fixed, however, by putting this script below any
  113. # script which rewrites change_equip.
  114. # Also, you can have multiple weapons in array and the same equipment in different
  115. # sets.
  116. #
  117. #
  118. # SET BONUSES
  119. #
  120. # For set bonuses, go to Set_Bonuses. Use the follwing syntax to add bonuses:
  121. #
  122. # set id => {
  123. #    amount of pieces required => [[sort, parameter, bonus]]
  124. #           },
  125. #
  126. # Specifications:
  127. # set id = the same set id as in Sets.
  128. #
  129. # amount of pieces required = the amount of pieces the player must be wearing in
  130. # order to receive the bonuses. If you want to skip one, just skip it. Like:
  131. # 1 => blablabla
  132. # 3 => blablabla
  133. #
  134. # sort = type of bonus. For all sorts, see SPECIAL VALUES.
  135. #
  136. # parameter = the parameter which receives the bonus. For all parameters, see
  137. # SPECIAL VALUES.
  138. #
  139. # bonus = the bonus to be added to parameter. Note that this is a direct bonus,
  140. # not a percentage. If the vale is negative, the bonus will become negative. If
  141. # the value is 0, there will be no bonus to that stat.
  142. #
  143. #
  144. # SPECIAL VALUES
  145. # Sets
  146. # ----
  147. # Equipment types: 0 and 1. 0 is the Weapons tab in the database, 1 is the
  148. # Armors tab in the database.
  149. #
  150. # Set_Bonuses
  151. # ---
  152. # Sorts:
  153. # 0  - Standard Parameter
  154. # 1  - Standard Parameter (Percentage)
  155. # 2  - Extra Parameter
  156. # 3  - Special Paramater
  157. # 4  - Skills (WARNING, DIFFERENT SYNTAX!! See Skills on how to use them)
  158. # 5  - Elemental Efficiency
  159. # 6  - Debuff Rate
  160. # 7  - State Rate
  161. # 8  - State Resistance (WARNING, VALUE HAS A DIFFERENT FUNCTION!!)
  162. # 9  - Attack Elements (WARNING, VALUE HAS A DIFFERENT FUNCTION!!)
  163. # 10 - Attack States
  164. # 11 - Equipment Types (WARNING, DIFFERENT SYNTAX!! See Equipment Types on how
  165. #                       to use them)
  166. # 12 - Attack Specials
  167. # 13 - Additional Skill Types (WARNING, VALUE HAS A DIFFERENT FUNCTION!!)
  168. # 14 - Sealed Skill Types (WARNING, VALUE HAS A DIFFERENT FUNCTION!!)
  169. # 15 - Sealed Skills (WARNING, VALUE HAS A DIFFERENT FUNCTION!!)
  170. # 16 - Fixed Equip Types (WARNING, VALUE HAS A DIFFERENT FUNCTION!!)
  171. # 17 - Sealed Equip Types (WARNING, VALUE HAS A DIFFERENT FUNCTION!!)
  172. # 18 - Special Flags (WARNING, VALUE HAS A DIFFERENT FUNCTION!!)
  173. # 19 - Party Abilities (WARNING, VALUE HAS A DIFFERENT FUNCTION!!)
  174. # 20 - Other Traits
  175. #
  176. # Standard Parameters: (Sort 0)
  177. # 0 - MaxHp
  178. # 1 - MaxMp
  179. # 2 - Attack
  180. # 3 - Defense
  181. # 4 - Magic Attack (Spirit)
  182. # 5 - Magic Defence (Resistance)
  183. # 6 - Agility
  184. # 7 - Luck
  185. #
  186. # Standard Parameters (Percentage): (Sort 1)
  187. # 0 - MaxHp
  188. # 1 - MaxMp
  189. # 2 - Attack
  190. # 3 - Defense
  191. # 4 - Magic Attack (Spirit)
  192. # 5 - Magic Defence (Resistance)
  193. # 6 - Agility
  194. # 7 - Luck
  195. # Note that stats are calculated this way:
  196. # Basic + Equipment Bonuses + Set Bonuses (normal) + Set Bonuses (percentages,
  197. # equal to bonus% (in [1, parameter, bonus]) * basic + equipment bonuses)
  198. #
  199. # Extra Parameters: (Sort 2)
  200. # 0 - Hit Rate
  201. # 1 - Evasion
  202. # 2 - Critical Rate
  203. # 3 - Critical Evasion
  204. # 4 - Magical Evasion
  205. # 5 - Magical Reflection
  206. # 6 - Counter Rate
  207. # 7 - HP Regen
  208. # 8 - MP Regen
  209. # 9 - TP Regen
  210. #
  211. # Special Parameters: (Sort 3)
  212. # 0 - Target Rate/ Accuracy Rate(in Eng Translation Patch)/ Aggro Rate
  213. # 1 - Guard Effect Rate
  214. # 2 - Recovery Effect Rate
  215. # 3 - Pharmacology/ Knowledge in Medicine(in Eng Translation Patch)
  216. # 4 - MP Cost Rate
  217. # 5 - TP Charge Rate
  218. # 6 - Physical Damage Rate
  219. # 7 - Magical Damage Rate
  220. # 8 - Floor Damage Rate
  221. # 9 - Experience Rate
  222. #
  223. # Skills: (Sort 4)
  224. # These skills don't have parameter values. Instead, the last two elements in
  225. # their array have a different effect than usual:
  226. # [sort (4), -----, skill_id]
  227. # Sort = still the same and of course 4
  228. # ----- = before this was Active, but that is no longer required. In order to
  229. # by-pass the need to change this to skill_id (for people who had this script
  230. # before v2.0), this variable has become unused instead of deleted all-together.
  231. # You can put anything you want here, it doesn't even have to be an integer.
  232. # Skill_Id = the id of the skill which the actor learns.
  233. #
  234. # Elemental Efficiency: (Sort 5)
  235. # Values are the same as Element IDs in the database. (SO NO 0!!)
  236. # If the bonus is negative, the actor becomes more resistant to the element.
  237. # If the bonus is positive, the actor becomes weaker to the element.
  238. #
  239. # Debuff Rate: (Sort 6)
  240. # 0 - MaxHp
  241. # 1 - MaxMp
  242. # 2 - Attack
  243. # 3 - Defense
  244. # 4 - Magic Attack (Spirit)
  245. # 5 - Magic Defence (Resistance)
  246. # 6 - Agility
  247. # 7 - Luck
  248. # If the bonus is negative, the actor becomes more resistant to debuffs regarding
  249. # the set parameter.
  250. # If the bonus is positive, the actor becomes weaker to debuffs regarding the set
  251. # parameter.
  252. #
  253. # State Rate: (Sort 7)
  254. # Values are the same as the State IDs in the database (SO NO 0!!)
  255. # If the bonus is negative, the actor becomes more resistant to the state.
  256. # If the bonus is positive, the actor becomes weaker to the state.
  257. #
  258. # State Resist: (Sort 8)
  259. # Values are the same as the State IDs in the database (SO NO 0!!)
  260. # If the bonus is positive, the actor becomes fully resistant to the set state.
  261. # However, if the bonus is negative, the actor LOSES full resistance to the set
  262. # state!
  263. #
  264. # Attack Elements: (Sort 9)
  265. # Values are the same as the Element IDs in the database (SO NO 0!!)
  266. # If the bonus is positive, the element is added to the attack elements.
  267. # However, if the bonus is negative, the element is REMOVED from the attack
  268. # elements!
  269. #
  270. # Attack States: (Sort 10)
  271. # Values are the same as the State IDs in the database (SO NO 0!!)
  272. # Bonus is the chance of the state to occur.
  273. #
  274. # Equipment Types: (Sort 11)
  275. # 0 as parameter means that the bonus type is a Weapon Type.
  276. # 1 as parameter means that the bonus type is a Weapon Type, but instead it will
  277. # be REMOVED from the list of weapon types.
  278. # 2 as parameter means that the bonus type is an Armor Type.
  279. # 3 as parameter means that the bonus type is an Armor Type, but instead it will
  280. # be REMOVED from the list of armor types.
  281. # 4 as parameter allows Dual Wielding.
  282. # Bonus is the same as the ID of the Equipment Types in the database.
  283. # Note that removed types override added types. So you can first remove an
  284. # equip type and afterwards add it, but you can first add it and then remove it.
  285. #
  286. # Attack Specials: (Sort 12)
  287. # 0 - Attack Speed
  288. # 1 - Additional Attacks
  289. # Both in percentages. So for additional attacks, not 1 but 100.
  290. #
  291. # Additional Skill Types: (Sort 13)
  292. # Values are the same as the Skill Types IDs in the database (SO NO 0!!)
  293. # If the bonus is positive, the skill types is added.
  294. # However, if the bonus is negative, the skill type is REMOVED!
  295. #
  296. # Sealed Skill Types: (Sort 14)
  297. # Exact the same as above, only if the bonus is positive the type gets sealed,
  298. # if the bonus is negative the type gets removed from the sealed types.
  299. #
  300. # Sealed Skills: (Sort 15)
  301. # Again, exact the same as above. Only this time, replace the skill type id by
  302. # the skill id.
  303. #
  304. # Fixed Equip Types: (Sort 16)
  305. # Exact the same as Sealed Skill Types, only the equip types get fixed. Of course,
  306. # replace skill type id by equip type id.
  307. #
  308. # Sealed Equip Types: (Sort 17)
  309. # And yet again, exact the same only the equip types get sealed. Of course,
  310. # replace skill type id by equip type id.
  311. #
  312. # Special Flags: (Sort 18)
  313. # 0 - Auto Combat
  314. # 1 - Guard
  315. # 2 - Substitute/Cover
  316. # 3 - Same TP in next battle
  317. # For bonus, put a positive number (or 0) for added trait, and negative number
  318. # for removed trait.
  319. #
  320. # Party Abilities: (Sort 19)
  321. # 0 - Encounter cut down by half
  322. # 1 - No encounters
  323. # 2 - No suprise attacks
  324. # 3 - Preemptive strike rate up
  325. # 4 - Double currency from battles
  326. # 5 - Double items from battles
  327. # For bonus, put a positive number (or 0) for added trait, and negative number
  328. # for removed trait.
  329. #
  330. # Others Traits: (Sort 20)
  331. # 0 - Max TP up by bonus
  332. # 1 - Atk Skill becomes bonus (skill ID) / So, if you have [20, 1, 10] the actor's
  333. # attack skill becomes 10.
  334. # 2 - Guard Skill becomes bonus (skill ID) / So, if you have [20, 2, 10] the
  335. # actor's guard skill becomes 10,
  336. #----------------------------------------------------------------------------
  337. # Credits to:
  338. # Lettuce, if it wasn't for his RMVX Item Sets script, I would not have learned
  339. # how Arrays and Hashes work.
  340. # Many members at [url]www.rpgmakervxace.net[/url] for pointing out various bugs and whatnot.
  341. # You for reading through the wall of text ^^ (at least... I hope you did that..)
  342. #----------------------------------------------------------------------------
  343. # If you have any issues with this script, contact me at
  344. # [url]http://www.rpgmakervxace.net/index.php?/topic/1092-ees-emeralds-equipment-sets/[/url]
  345. #============================================================================
  346. #
  347. # CONFIGURATION
  348. #
  349. #============================================================================
  350.  
  351. module EME
  352.  
  353.   MAX_ELEMENTS = 10
  354.  
  355. #----------------------------------------------------------------------------
  356. # Sets syntax
  357. #----------------------------------------------------------------------------
  358. # Sets = {
  359. #          set_id => [[equipment_type, equipment_id]]
  360. #        }
  361. #
  362. # set_id must be bigger than 0
  363. # equipment_type can be either 0 (weapon) or 1 (armor)
  364. # Add a comma after a ']' if it's not the last element in the array/hash.
  365. #
  366. # Don't forget to add a ungettable item at the end! Else, the last item will
  367. # count for two!
  368. #----------------------------------------------------------------------------
  369.  
  370. Sets = {
  371.          1 => [[0, 1], [1, 1]],
  372.          2 => [[1, 2], [0, 2]]
  373.        }
  374.  
  375. #----------------------------------------------------------------------------
  376. # Sets syntax
  377. #----------------------------------------------------------------------------
  378. # Set_Bonuses = {
  379. #       set id => {
  380. #         amount of pieces required => [[sort, parameter, bonus]], [sort, random parameter, 0]]
  381. #                 }
  382. #                }
  383. #
  384. # set_id must correspond to set_id of Sets
  385. # amount of pieces required indicates how many pieces of the set the actor must
  386. # be wearing before receiving the bonus. If you want to skip one, make the only
  387. # element in it's array [0, 0, 0].
  388. # sort indicates which kind of parameters the bonuses change. See SPECIAL VALUES
  389. # for all sorts.
  390. # parameter can be a value depending on sort. See SPECIAL VALUES in the
  391. # instructions for their corresponding stats.
  392. # Bonus is a direct value added to 'parameter'. If 0, no bonus is added. If
  393. # negative, bonus becomes negative.
  394. # Random paramter is just a random parameter to prevent the last bonus from
  395. # being doubled. Always make the bonus of this element 0.
  396. #
  397. # Add a comma after a ']' or '}' if it's not the last element in the array/hash.
  398. #
  399. # Don't forget to add a bonus of [0, 0, 0] at the end! Or else, the last bonus
  400. # will be doubled!
  401. #----------------------------------------------------------------------------
  402. Set_Bonuses =
  403. {
  404.   1 => {
  405.     1 => [[0, 0, 500]],
  406.     2 => [[0, 0, 500]]
  407.        },
  408.  
  409.   2 => {
  410.     1 => [[0, 1, 500]],
  411.     2 => [[0, 1, 500]]
  412.        }
  413. }
  414.  
  415. #-----------------------------------------------------------------------------
  416. # Sets syntax
  417. #-----------------------------------------------------------------------------
  418. # Set_Sounds = {
  419. #   set_id => {
  420. #     amount_of_pieces_required => [file_name, volume, pitch]
  421. #   }
  422. # }
  423. #
  424. # Resembles the other two parts so I think not much of an explanation is needed.
  425. # When the required amount of pieces has been equipped, the sound sound will be
  426. # played. Doesn't apply for unequipping. Again, watch the comma's!!
  427. #----------------------------------------------------------------------------
  428. Set_Sounds =
  429. {
  430.   1 => {
  431.     1 => ["Flash1", 100, 100], # <- comma here since it isn't the last one!
  432.     2 => ["Flash1", 100, 100]  # <- no comma here since it IS the last one!
  433.        }
  434. }
  435.  
  436. end
  437.  
  438. # Only edit things past here if you know what you're doing
  439.  
  440. $imported = {} if $imported.nil?
  441. $imported["Emerald's Equipment Sets"] = true
  442.  
  443. #============================================================================
  444. #
  445. # Game_Actor
  446. # Handles everything for this script.
  447. #============================================================================
  448. class Game_Actor < Game_Battler
  449.  
  450.   attr_reader :active_sets
  451.   attr_reader :item_sets
  452.  
  453.   alias eme_ees_setup setup
  454.   def setup(actor_id)
  455.     @non_set_skills = []
  456.     @skill_from_sets = false
  457.     reset_bonuses
  458.     @active_sets = []
  459.     @item_sets = [0] * (EME::Sets.size + 1)
  460.     eme_ees_setup(actor_id)
  461.   end
  462.  
  463.   alias eme_init_equips init_equips
  464.   def init_equips(equips)
  465.     eme_init_equips(equips)
  466.     equips.each_with_index{|item_id, i|
  467.       etype_id = index_to_etype_id(i)
  468.       slot_id = empty_slot(etype_id)
  469.       for set_id in 1..EME::Sets.size
  470.         for ees_set_equip in EME::Sets[set_id]
  471.           if item_id != nil and slot_id != nil and ees_is_the_set_item?(etype_id == 0 ? $data_weapons[item_id] : $data_armors[item_id], ees_set_equip)
  472.             @item_sets[set_id] += 1
  473.             @active_sets.push(set_id) unless @active_sets.include?(set_id)
  474.           end
  475.         end
  476.       end
  477.     }
  478.     refresh
  479.   end
  480.  
  481.   def ees_is_the_set_item?(item, ees_set_equip)
  482.     return (((ees_set_equip[0] == 0 and item.is_a?(RPG::Weapon)) or (ees_set_equip[0] == 1 and item.is_a?(RPG::Armor))) and ees_set_equip[1] == item.id)
  483.   end
  484.  
  485.   alias eme_ees_learn_skill learn_skill
  486.   def learn_skill(skill_id)
  487.     eme_ees_learn_skill(skill_id)
  488.     @non_set_skills.push(skill_id) unless @skill_from_sets
  489.     @skill_from_sets = false
  490.   end
  491.  
  492.   alias eme_ebs_change_equip change_equip
  493.   def change_equip(slot_id, item)
  494.       for set_id in 1..EME::Sets.size
  495.         for ees_set_equip in EME::Sets[set_id]
  496.           if slot_id != nil and @equips[slot_id] != nil and @equips[slot_id].object != nil
  497.             if ees_is_the_set_item?(@equips[slot_id].object, ees_set_equip)
  498.               @item_sets[set_id] -= 1
  499.               @active_sets.delete(set_id) if @item_sets[set_id] == 0
  500.             end
  501.           end
  502.           if item != nil and ees_is_the_set_item?(item, ees_set_equip)
  503.             @item_sets[set_id] += 1
  504.             @active_sets.push(set_id) unless @active_sets.include?(set_id)
  505.             if EME::Set_Sounds.has_key?(set_id) and EME::Set_Sounds[set_id].has_key?(set_amount_wearing(set_id))
  506.               sound = EME::Set_Sounds[set_id][set_amount_wearing(set_id)]
  507.               Audio.se_play("Audio/SE/" + sound[0], sound[1], sound[2])
  508.             end
  509.           end
  510.         end
  511.       end
  512.     set_check
  513.     eme_ebs_change_equip(slot_id, item)
  514.   end
  515.  
  516.   def unlearn_set_skills(set_id)
  517.     EME::Set_Bonuses[set_id].each_value{|bonus_array|
  518.       bonus_array.each{|bonus|
  519.         if bonus[0] == 4
  520.           forget_skill(bonus[2]) unless @non_set_skills.include?(bonus[2])
  521.           @ees_skills.delete(bonus[2])
  522.         end
  523.       }
  524.     }
  525.   end
  526.  
  527.   def item_set_reset_all
  528.     @active_sets.each{|set_id| item_set_reset(set_id)}
  529.   end
  530.  
  531.   def item_set_reset(set_id)
  532.     return unless set_id > 0 and @item_sets[set_id] > 0
  533.     unlearn_set_skills(set_id)
  534.   end
  535.  
  536.   def release_unequippable_items(item_gain = true)
  537.     @equips.each_with_index do |item, i|
  538.       if !equippable?(item.object) || item.object.etype_id != equip_slots[i]
  539.         trade_item_with_party(nil, item.object) if item_gain
  540.         item.object = nil
  541.       end
  542.     end
  543.   end
  544.  
  545.   def release_unequippable_items(item_gain = true)
  546.     loop do
  547.       change_equips = 0
  548.       @equips.each_with_index do |item, i|
  549.         if !equippable?(item.object) or item.object.etype_id != equip_slots[i]
  550.           next if (RPG::Weapon.method_defined?(:two_handed?) and dual_wield? and (equip_slots[i] == 1 and item.object.etype_id == 0))
  551.           trade_item_with_party(nil, item.object) if item_gain
  552.           change_equips += 1 unless item.object.nil?
  553.           unless item.object.nil?
  554.           for set_id in 1..EME::Sets.size
  555.             for ees_set_equip in EME::Sets[set_id]
  556.               if ees_is_the_set_item?(item.object, ees_set_equip)
  557.                 @item_sets[set_id] -= 1
  558.                 @active_sets.delete(set_id) if @item_sets[set_id] == 0
  559.               end
  560.             end
  561.           end
  562.           end
  563.           item.object = nil
  564.         end
  565.       end
  566.       set_check
  567.       break if change_equips == 0
  568.     end
  569.   end
  570.  
  571.   alias eme_ebs_discard_equip discard_equip
  572.   def discard_equip(item)
  573.     slot_id = equips.index(item)
  574.     if slot_id != nil
  575.       for set_id in 1..EME::Sets.size
  576.         for ees_set_equip in EME::Sets[set_id]
  577.           if ees_is_the_set_item?(item, ees_set_equip)
  578.             @item_sets[set_id] -= 1
  579.             @active_sets.delete(set_id) if @item_sets[set_id] == 0
  580.           end
  581.         end
  582.       end
  583.     end
  584.     eme_ebs_discard_equip(item)
  585.     refresh
  586.   end
  587.  
  588.   def set_amount_wearing(set_id)
  589.     return @item_sets[set_id]
  590.   end
  591.  
  592.   def set_check
  593.     item_set_reset_all
  594.     reset_bonuses
  595.     @active_sets.each{|set| change_bonuses(set) unless set == nil}
  596.   end
  597.  
  598.   def change_bonuses(set_id)
  599.     return if set_id == 0 or set_amount_wearing(set_id) == 0
  600.     EME::Set_Bonuses[set_id].each_key{|key|
  601.       if set_amount_wearing(set_id) >= key
  602.         for g in 0...EME::Set_Bonuses[set_id][key].size
  603.           sort = EME::Set_Bonuses[set_id][key][g][0]
  604.           stat = EME::Set_Bonuses[set_id][key][g][1]
  605.           stat_bonus = EME::Set_Bonuses[set_id][key][g][2]
  606.           case EME::Set_Bonuses[set_id][key][g][0]
  607.           when 0
  608.             sets_param_change(stat, stat_bonus)
  609.           when 1
  610.             sets_per_param_change(stat, stat_bonus)
  611.           when 2
  612.             sets_xparam_change(stat, stat_bonus)
  613.           when 3
  614.             sets_sparam_change(stat, stat_bonus)
  615.           when 4
  616.             next if skill_learn?(stat_bonus)
  617.             @skill_from_sets = true
  618.             learn_skill(stat_bonus)
  619.             @ees_skills.push(stat_bonus)
  620.           when 5
  621.             stat -= 1
  622.             sets_element_rate_change(stat, stat_bonus)
  623.           when 6
  624.             stat -= 1
  625.             sets_debuff_rate_change(stat, stat_bonus)
  626.           when 7
  627.             stat -= 1
  628.             sets_state_rate_change(stat, stat_bonus)
  629.           when 8
  630.             sets_state_resist_change(stat, stat_bonus)
  631.           when 9
  632.             sets_atk_elements_change(stat, stat_bonus)
  633.           when 10
  634.             sets_atk_states_change(stat) if stat_bonus > 0
  635.             sets_atk_states_rate_change(stat, stat_bonus)
  636.           when 11
  637.             if stat < 2
  638.               change_sets_additional_wtypes(stat_bonus, (stat == 0 ? true : false))
  639.             elsif stat < 4
  640.               change_sets_additional_atypes(stat_bonus, (stat == 2))
  641.             elsif stat == 4
  642.               @eme_ebs_two_swords_style = true
  643.             end
  644.           when 12
  645.             sets_atk_specials_change(stat, stat_bonus)
  646.           when 13
  647.             add_sets_skill_types(stat, stat_bonus)
  648.           when 14
  649.             add_sets_sealed_skill_types(stat, stat_bonus)
  650.           when 15
  651.             add_sets_sealed_skills(stat, stat_bonus)
  652.           when 16
  653.             add_sets_fixed_equip_types(stat, stat_bonus)
  654.           when 17
  655.             add_sets_sealed_equip_types(stat, stat_bonus)
  656.           when 18
  657.             stat_bonus < 0 ? change_special_flags(stat, true) : change_special_flags(stat)
  658.           when 19
  659.             stat_bonus < 0 ? change_party_abilities(stat, true) : change_party_abilities(stat)
  660.           when 20
  661.             case stat
  662.             when 0
  663.               set_bonus_max_tp(stat_bonus)
  664.             when 1
  665.               set_atk_skill(stat_bonus)
  666.             when 2
  667.               set_grd_skill(stat_bonus)
  668.             end
  669.           end
  670.         end
  671.       end
  672.     }
  673.   end
  674.  
  675. #-------------------------------------------#
  676. # LABEL FOR AUTHOR                          #
  677. # Don't mind this ;)                        #
  678. #-------------------------------------------#
  679.  
  680.   def reset_bonuses
  681.     @sets_param_plus = [0] * 8
  682.     @sets_per_param_plus = [0] * 8
  683.     @sets_xparam_plus = [0] * 10
  684.     @sets_sparam_plus = [0] * 10
  685.     @sets_element_rate = [0] * (EME::MAX_ELEMENTS)
  686.     @sets_debuff_rate = [0] * 8
  687.     @sets_state_rate = [0] * ($data_states.size + 1)
  688.     @sets_state_resist = []
  689.     @sets_state_resist_remove = []
  690.     @sets_atk_elements = []
  691.     @sets_atk_elements_remove = []
  692.     @sets_atk_states = []
  693.     @sets_atk_states_rate = [0] * $data_states.size
  694.     @sets_atk_speed_plus = 0
  695.     @sets_atk_times_plus = 0
  696.     @sets_skill_types = []
  697.     @sets_skill_types_remove = []
  698.     @sets_sealed_skill_types = []
  699.     @sets_sealed_skill_types_remove = []
  700.     @sets_sealed_skills = []
  701.     @sets_sealed_skills_remove = []
  702.     @sets_fixed_equip_types = []
  703.     @sets_fixed_equip_types_remove = []
  704.     @sets_sealed_equip_types = []
  705.     @sets_sealed_equip_types_remove = []
  706.  
  707.     @ees_added_special_flags = []
  708.     @ees_removed_special_flags = []
  709.     @ees_added_party_abilities = []
  710.     @ees_removed_party_abilities = []
  711.     @ees_bonus_max_tp = 0
  712.     @new_atk_skill = nil
  713.     @new_grd_skill = nil
  714.  
  715.     @ees_skills = []
  716.     @sets_wtypes = []
  717.     @sets_atypes = []
  718.     @sets_removed_wtypes = []
  719.     @sets_removed_atypes = []
  720.     @eme_ebs_two_swords_style = false
  721.   end
  722.  
  723.   def sets_param_plus(param_id)
  724.     @sets_param_plus[param_id]
  725.   end
  726.  
  727.   def sets_param_change(param_id, value)
  728.     @sets_param_plus[param_id] += value
  729.   end
  730.  
  731.   def sets_per_param_plus(param_id)
  732.     value = param_base(param_id) + param_plus(param_id)
  733.     value *= @sets_per_param_plus[param_id] / 100
  734.     return value
  735.   end
  736.  
  737.   def sets_per_param_change(param_id, value)
  738.     @sets_per_param_plus[param_id] += value
  739.   end
  740.  
  741.   def sets_xparam_plus(param_id)
  742.     @sets_xparam_plus[param_id]
  743.   end
  744.  
  745.   def sets_xparam_change(param_id, value)
  746.     @sets_xparam_plus[param_id] += value
  747.   end
  748.  
  749.   def sets_sparam_plus(param_id)
  750.     @sets_sparam_plus[param_id]
  751.   end
  752.  
  753.   def sets_sparam_change(param_id, value)
  754.     @sets_sparam_plus[param_id] += value
  755.   end
  756.  
  757.   def sets_element_rate(element_id)
  758.     @sets_element_rate[element_id]
  759.   end
  760.  
  761.   def sets_element_rate_change(element_id, value)
  762.     @sets_element_rate[element_id] += value
  763.   end
  764.  
  765.   def sets_debuff_rate(param_id)
  766.     @sets_debuff_rate[param_id]
  767.   end
  768.  
  769.   def sets_debuff_rate_change(param_id, value)
  770.     @sets_debuff_rate[param_id] += value
  771.   end
  772.  
  773.   def sets_state_rate(state_id)
  774.     @sets_state_rate[state_id]
  775.   end
  776.  
  777.   def sets_state_rate_change(state_id, value)
  778.     @sets_state_rate[state_id] += value
  779.   end
  780.  
  781.   def sets_state_resist(state_id)
  782.     @sets_state_resist[state_id]
  783.   end
  784.  
  785.   def sets_state_resist_remove(state_id)
  786.     @sets_state_resist_remove[state_id]
  787.   end
  788.  
  789.   def sets_state_resist_change(state_id, value)
  790.     value >= 0 ? (@sets_state_resist.push(state_id) unless @sets_state_resist.include?(state_id)) : (@sets_state_resist_remove.delete(state_id) unless @sets_state_resist_remove.include?(state_id))
  791.   end
  792.  
  793.   def sets_atk_elements(element_id)
  794.     @sets_atk_elements[element_id]
  795.   end
  796.  
  797.   def sets_atk_elements_remove(element_id)
  798.     @sets_atk_elements_remove[element_id]
  799.   end
  800.  
  801.   def sets_atk_elements_change(element_id, value)
  802.     value >= 0 ? (@sets_atk_elements.push(element_id) unless @sets_atk_elements.include?(element_id)) : (@sets_attack_elements_remove.delete(element_id) unless @sets_atk_elements_remove.include?(element_id))
  803.   end
  804.  
  805.   def sets_atk_states(state_id)
  806.     @sets_atk_states[state_id]
  807.   end
  808.  
  809.   def sets_atk_states_change(state_id)
  810.     @sets_atk_states.push(state_id) unless @sets_atk_states.include?(state_id)
  811.   end
  812.  
  813.   def sets_atk_states_rate(state_id)
  814.     @sets_atk_states_rate[state_id]
  815.   end
  816.  
  817.   def sets_atk_states_rate_change(state_id, value)
  818.     @sets_atk_states_rate[state_id] += value
  819.   end
  820.  
  821.   def sets_atk_speed_plus
  822.     @sets_atk_speed_plus
  823.   end
  824.  
  825.   def sets_atk_times_plus
  826.     @sets_atk_times_plus
  827.   end
  828.  
  829.   def sets_atk_specials_change(parameter, value)
  830.     parameter == 0 ? @sets_atk_speed_plus += value : @sets_atk_times_plus += value
  831.   end
  832.  
  833.   def sets_skill_types(skill_type_id)
  834.     @sets_skill_types[skill_type_id]
  835.   end
  836.  
  837.   def sets_skill_types_remove(skill_type_id)
  838.     @sets_skill_types_remove[skill_type_id]
  839.   end
  840.  
  841.   def add_sets_skill_types(skill_type_id, value)
  842.     value >= 0 ? (@sets_skill_types.push(skill_type_id) unless @sets_skill_types.include?(skill_type_id)) : (@sets_skill_types_remove.delete(skill_type_id) unless @sets_skill_types_remove.include?(skill_type_id))
  843.   end
  844.  
  845.   def sets_sealed_skill_types(skill_type_id)
  846.     @sets_sealed_skill_types[skill_type_id]
  847.   end
  848.  
  849.   def sets_sealed_skill_types_remove(skill_type_id)
  850.     @sets_sealed_skill_types_remove[skill_type_id]
  851.   end
  852.  
  853.   def add_sealed_skill_types(skill_type_id, value)
  854.     value >= 0 ? (@sets_sealed_skill_types.push(skill_type_id) unless @sets_sealed_skill_types.include?(skill_type_id)) : (@sets_sealed_skill_types_remove.delete(skill_type_id) unless @sets_sealed_skill_types_remove.include?(skill_type_id))
  855.   end
  856.  
  857.   def sets_sealed_skills(skill_id)
  858.     @sets_sealed_skills[skill_id]
  859.   end
  860.  
  861.   def sets_sealed_skills_remove(skill_id)
  862.     @sets_sealed_skills_remove[skill_id]
  863.   end
  864.  
  865.   def add_sets_sealed_skills(skill_id, value)
  866.     value > 0 ? (@sets_sealed_skills.push(skill_id) unless @sets_sealed_skills.include?(skill_id)) : (@sets_attack_elements_remove.delete(skill_id) unless @sets_sealed_skills_remove.include?(skill_id))
  867.   end
  868.  
  869.   def sets_additional_wtypes
  870.     @sets_wtypes
  871.   end
  872.  
  873.   def sets_additional_atypes
  874.     @sets_atypes
  875.   end
  876.  
  877.   def sets_removed_wtypes
  878.     @sets_removed_wtypes
  879.   end
  880.  
  881.   def sets_removed_atypes
  882.     @sets_removed_atypes
  883.   end
  884.  
  885.   def change_sets_additional_wtypes(wtype_id, positive_change = true)
  886.     positive_change ? @sets_wtypes.push(wtype_id) : @sets_removed_wtypes.push(wtype_id)
  887.   end
  888.  
  889.   def change_sets_additional_atypes(atype_id, positive_change = true)
  890.     positive_change ? @sets_atypes.push(atype_id) : @sets_removed_atypes.push(atype_id)
  891.   end
  892.  
  893.   def sets_fixed_equip_types(equip_type_id)
  894.     @sets_fixed_equip_types[equip_type_id]
  895.   end
  896.  
  897.   def sets_fixed_equip_types_remove(equip_type_id)
  898.     @sets_fixed_equip_types_remove[equip_type_id]
  899.   end
  900.  
  901.   def add_fixed_equip_types(equip_type_id, value)
  902.     value >= 0 ? @sets_fixed_equip_types.push(equip_type_id) : @sets_fixed_equip_types_remove.delete(sequip_type_id)
  903.   end
  904.  
  905.   def sets_sealed_equip_types(equip_type_id)
  906.     @sets_sealed_equip_types[equip_type_id]
  907.   end
  908.  
  909.   def sets_sealed_equip_types_remove(equip_type_id)
  910.     @sets_sealed_equip_types_remove[equip_type_id]
  911.   end
  912.  
  913.   def add_sealed_equip_types(equip_type_id, value)
  914.     value > 0 ? (@sets_sealed_equip_types.push(equip_type_id) unless @sets_sealed_equip_types.include?(equip_type_id)) : (@sets_sealed_equip_types_remove.delete(equip_type_id) unless @sets_sealed_equip_types_remove.include?(equip_type_id))
  915.   end
  916.  
  917.   def change_special_flags(flag_id, negative = false)
  918.     !negative ? @ees_added_special_flags.push(flag_id) : @ees_removed_special_flags.push(flag_id)
  919.   end
  920.  
  921.   def change_party_abilities(ability_id, negative = false)
  922.     !negative ? @ees_added_party_abilities.push(ability_id) : @ees_removed_party_abilities.push(ability_id)
  923.   end
  924.  
  925.   def set_bonus_max_tp(value)
  926.     @ees_bonus_max_tp += value
  927.   end
  928.  
  929.   def set_atk_skill(skill_id)
  930.     @new_atk_skill = skill_id
  931.   end
  932.  
  933.   def set_grd_skill(skill_id)
  934.     @new_grd_skill = skill_id
  935.   end
  936.  
  937. #-------------------------------------------#
  938. # 'NOTHER LABEL FOR AUTHOR                  #
  939. # Don't mind this ;)                        #
  940. #-------------------------------------------#
  941.  
  942.   def param(param_id)
  943.     value = param_base(param_id) + param_plus(param_id) + sets_param_plus(param_id) #+ [sets_per_param_plus(param_id), 0].max
  944.     value *= param_rate(param_id) * param_buff_rate(param_id)
  945.     [[value, param_max(param_id)].min, param_min(param_id)].max.to_i
  946.   end
  947.  
  948.   alias eme_ebs_xparam xparam
  949.   def xparam(xparam_id)
  950.     value = eme_ebs_xparam(xparam_id) + sets_xparam_plus(xparam_id) / 100
  951.     return value
  952.   end
  953.  
  954.   alias eme_ebs_sparam sparam
  955.   def sparam(sparam_id)
  956.     value = eme_ebs_sparam(sparam_id) + sets_sparam_plus(sparam_id) / 100
  957.     return value
  958.   end
  959.  
  960.   alias eme_ebs_element_rate element_rate
  961.   def element_rate(element_id)
  962.     value = eme_ebs_element_rate(element_id) + sets_element_rate(element_id) / 100
  963.     return value
  964.   end
  965.  
  966.   alias eme_ebs_debuff_rate debuff_rate
  967.   def debuff_rate(param_id)
  968.     value = eme_ebs_debuff_rate(param_id) + sets_debuff_rate(param_id) / 100
  969.     return value
  970.   end
  971.  
  972.   alias eme_ebs_state_rate state_rate
  973.   def state_rate(state_id)
  974.     value = eme_ebs_state_rate(state_id) + sets_state_rate(state_id) / 100
  975.     return value
  976.   end
  977.  
  978.   alias eme_ebs_state_resist_set state_resist_set
  979.   def state_resist_set
  980.     value = eme_ebs_state_resist_set
  981.     @sets_state_resist.each{|state| value.push(state) unless value.include?(element)}
  982.     @sets_state_resist_remove.each{|state| value.delete(state)}
  983.     return value
  984.   end
  985.  
  986.   alias eme_ebs_atk_elements atk_elements
  987.   def atk_elements
  988.     value = eme_ebs_atk_elements
  989.     @sets_atk_elements.each{|element| value.push(element) unless value.include?(element)}
  990.     @sets_atk_elements_remove.each{|element| value.delete(element)}
  991.     return value
  992.   end
  993.  
  994.   alias eme_ebs_atk_states atk_states
  995.   def atk_states
  996.     value = eme_ebs_atk_states
  997.     @sets_atk_states.each{|state| value.push(@sets_atk_states[i]) }
  998.     return value
  999.   end
  1000.  
  1001.   alias eme_ebs_atk_states_rate atk_states_rate
  1002.   def atk_states_rate(state_id)
  1003.     value = eme_ebs_atk_states_rate(state_id) + sets_atk_states_rate(state_id) / 100
  1004.     return value
  1005.   end
  1006.  
  1007.   alias eme_ebs_atk_speed atk_speed
  1008.   def atk_speed
  1009.     value = eme_ebs_atk_speed + sets_atk_speed_plus / 100
  1010.     return value
  1011.   end
  1012.  
  1013.   alias eme_ebs_atk_times atk_times_add
  1014.   def atk_times_add
  1015.     value = [eme_ebs_atk_times + sets_atk_times_plus / 100, 0].max
  1016.     return value
  1017.   end
  1018.  
  1019.   alias eme_ebs_dual_wield? dual_wield?
  1020.   def dual_wield?
  1021.     return true if @eme_ebs_two_swords_style
  1022.     eme_ebs_dual_wield?
  1023.   end
  1024.  
  1025.   alias eme_ebs_added_skill_types added_skill_types
  1026.   def added_skill_types
  1027.     value = eme_ebs_added_skill_types
  1028.     @sets_skill_types.each{|sk_type| value.push(sk_type)}
  1029.     @sets_skill_types_remove.each{|sk_type| value.delete(sk_type)}
  1030.     return value
  1031.   end
  1032.  
  1033.   def skill_type_sealed?(stype_id)
  1034.     value = features_set(FEATURE_STYPE_SEAL)
  1035.     @sets_sealed_skill_types.each{|sk_type| value.push(sk_type)}
  1036.     @sets_sealed_skill_types_remove.each{|sk_type| value.delete(sk_type)}
  1037.     return true if value.include?(stype_id)
  1038.   end
  1039.  
  1040.   def skill_sealed?(skill_id)
  1041.     value = features_set(FEATURE_SKILL_SEAL)
  1042.     @sets_sealed_skills.each{|skill| value.push(skill)}
  1043.     @sets_sealed_skills_remove.each{|skill| value.delete(skill)}
  1044.     return true if value.include?(skill_id)
  1045.   end
  1046.  
  1047.   def equip_wtype_ok?(wtype_id)
  1048.     value = features_set(FEATURE_EQUIP_WTYPE)
  1049.     @sets_wtypes.each{|w_type| value.push(w_type)}
  1050.     @sets_removed_wtypes.each{|w_type| value.delete(w_type)}
  1051.     return true if value.include?(wtype_id)
  1052.   end
  1053.  
  1054.   def equip_atype_ok?(atype_id)
  1055.     value = features_set(FEATURE_EQUIP_ATYPE)
  1056.     @sets_atypes.each{|a_type| value.push(a_type)}
  1057.     @sets_removed_atypes.each{|a_type| value.delete(a_type)}
  1058.     return true if value.include?(atype_id)
  1059.   end
  1060.  
  1061.   def equip_type_fixed?(etype_id)
  1062.     value = features_set(FEATURE_EQUIP_FIX)
  1063.     @sets_fixed_equip_types.each{|e_type| value.push(e_type)}
  1064.     @sets_fixed_equip_types_remove.each{|e_type| value.delete(e_type)}
  1065.     return true if value.include?(etype_id)
  1066.   end
  1067.  
  1068.   def equip_type_sealed?(etype_id)
  1069.     value = features_set(FEATURE_EQUIP_SEAL)
  1070.     @sets_sealed_equip_types.each{|e_type| value.push(e_type)}
  1071.     @sets_sealed_equip_types_remove.each{|e_type| value.delete(e_type)}
  1072.     return true if value.include?(etype_id)
  1073.   end
  1074.  
  1075.   alias eme_ees_special_flag special_flag
  1076.   def special_flag(flag_id)
  1077.     return false if @ees_removed_special_flags.include?(flag_id)
  1078.     return @ees_added_special_flags.include?(flag_id) ? true : eme_ees_special_flag(flag_id)
  1079.   end
  1080.  
  1081.   alias eme_ees_party_ability party_ability
  1082.   def party_ability(ability_id)
  1083.     return false if @ees_removed_party_abilities.include?(ability_id)
  1084.     return @ees_added_party_abilities.include?(ability_id) ? true : eme_ees_party_ability(ability_id)
  1085.   end
  1086.  
  1087.   alias eme_ees_max_tp max_tp
  1088.   def max_tp
  1089.     return eme_ees_max_tp + @ees_bonus_max_tp
  1090.   end
  1091.  
  1092.   alias eme_ees_attack_skill attack_skill_id
  1093.   def attack_skill_id
  1094.     return @new_atk_skill unless @new_atk_skill == nil
  1095.     return eme_ees_attack_skill
  1096.   end
  1097.  
  1098.   alias eme_ees_guard_skill guard_skill_id
  1099.   def guard_skill_id
  1100.     return @new_grd_skill unless @new_grd_skill == nil
  1101.     return eme_ees_guard_skill
  1102.   end
  1103.  
  1104. end


如題  因為我裝了被動技能 跟 裝備套裝效果腳本之後

會變成是其中一個發揮效果  

也就是說 被動技能 放在套裝效果的上面

就只有"被動技能"有效果  而套裝效果腳本沒有效果

相反的則反之...

請問有啥方法可以整合這2個腳本....

Lv3.寻梦者 (版主)

…あたしは天使なんかじゃないわ

梦石
0
星屑
2208
在线时间
4033 小时
注册时间
2010-10-4
帖子
10779

开拓者贵宾

2
发表于 2014-10-5 08:19:34 | 只看该作者
方法1:把两段脚本的 param 方法的计算整合起来

方法2:Why not try this? https://rpg.blue/thread-365969-1-2.html
这里的公告不可以无视哦~ https://rpg.blue/forum.php?mod=group&fid=539
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
348
在线时间
294 小时
注册时间
2013-6-1
帖子
121
3
 楼主| 发表于 2014-10-5 09:11:23 | 只看该作者
taroxd 发表于 2014-10-5 08:19
方法1:把两段脚本的 param 方法的计算整合起来

方法2:Why not try this? https://rpg.blue/thread-3 ...

那個腳本我是看過了  不過我得需要依照能力增加百分比的被動技能
而且整合的部分也不知道怎麼整合的說  所以我才要問這個問題....
回复 支持 反对

使用道具 举报

Lv3.寻梦者 (版主)

…あたしは天使なんかじゃないわ

梦石
0
星屑
2208
在线时间
4033 小时
注册时间
2010-10-4
帖子
10779

开拓者贵宾

4
发表于 2014-10-5 09:15:37 | 只看该作者
e900003 发表于 2014-10-5 09:11
那個腳本我是看過了  不過我得需要依照能力增加百分比的被動技能
而且整合的部分也不知道怎麼整合的說   ...


武器是可以在【特性】栏设置百分比的
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
348
在线时间
294 小时
注册时间
2013-6-1
帖子
121
5
 楼主| 发表于 2014-10-5 09:46:39 | 只看该作者
taroxd 发表于 2014-10-5 09:15
武器是可以在【特性】栏设置百分比的


剛剛測試過   在我這裡好像無法使用....



回复 支持 反对

使用道具 举报

Lv3.寻梦者 (版主)

…あたしは天使なんかじゃないわ

梦石
0
星屑
2208
在线时间
4033 小时
注册时间
2010-10-4
帖子
10779

开拓者贵宾

6
发表于 2014-10-5 09:54:37 | 只看该作者
本帖最后由 taroxd 于 2014-10-5 09:55 编辑
e900003 发表于 2014-10-5 09:46
剛剛測試過   在我這裡好像無法使用....


那就自己整合上面两个 param 的计算公式吧

param_base 是基础值,param_plus 是附加值, param_rate 是状态等的影响比率
至于 get_skills_parammu 这种东西就看脚本的注释

[[value, param_max(param_id)].min, param_min(param_id)].max.to_i 这行东西不要管,留着就行

在前面几行让 value 计算出你要的属性值就可以了。

两段脚本的计算公式差别并不大,总之整一个计算公式出来就是了

评分

参与人数 1星屑 +132 收起 理由
VIPArcher + 132 我很赞同

查看全部评分

回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
348
在线时间
294 小时
注册时间
2013-6-1
帖子
121
7
 楼主| 发表于 2014-10-5 10:02:55 | 只看该作者
taroxd 发表于 2014-10-5 09:54
那就自己整合上面两个 param 的计算公式吧

param_base 是基础值,param_plus 是附加值, param_rate 是 ...

我看你還是給個整合腳本還是比較好  看不太懂....
回复 支持 反对

使用道具 举报

Lv3.寻梦者 (版主)

…あたしは天使なんかじゃないわ

梦石
0
星屑
2208
在线时间
4033 小时
注册时间
2010-10-4
帖子
10779

开拓者贵宾

8
发表于 2014-10-5 10:06:46 | 只看该作者
e900003 发表于 2014-10-5 10:02
我看你還是給個整合腳本還是比較好  看不太懂....

  1. class Game_BattlerBase
  2.   def param(param_id)
  3.     value = param_base(param_id) + param_plus(param_id) + sets_param_plus(param_id) #+ [sets_per_param_plus(param_id), 0].max
  4.      value *= (param_rate(param_id) + get_skills_parammu(param_id)) * param_buff_rate(param_id)
  5.     [[value, param_max(param_id)].min, param_min(param_id)].max.to_i
  6.   end
  7. end
复制代码
效果不对的话你就自己改吧。

评分

参与人数 1梦石 +1 收起 理由
VIPArcher + 1 我很赞同

查看全部评分

回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
348
在线时间
294 小时
注册时间
2013-6-1
帖子
121
9
 楼主| 发表于 2014-10-5 10:20:53 | 只看该作者
taroxd 发表于 2014-10-5 10:06
效果不对的话你就自己改吧。

你說是要插入在哪個腳本的第幾行好了   想到的地方都不對....

点评

講錯了 應該是說那個腳本插入上去之後 被動技能的百分比增加會變成沒有增加....  发表于 2014-10-5 10:48
剛剛找到問題所在了 謝謝你了((剛剛才發現那個套裝效果的百分比增加有BUG....  发表于 2014-10-5 10:42
那就不知道了。这是我唯一看到两个脚本会冲突的地方  发表于 2014-10-5 10:36
測試過了 完全沒效果....  发表于 2014-10-5 10:32
插到两个脚本的下面  发表于 2014-10-5 10:24
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9280
在线时间
2504 小时
注册时间
2011-5-20
帖子
15389

开拓者

10
发表于 2014-10-5 10:31:23 | 只看该作者
e900003 发表于 2014-10-4 17:02
我看你還是給個整合腳本還是比較好  看不太懂....

你要整合脚本就得放你的工程上来···

点评

说得好像你会解决一样  发表于 2014-10-5 23:11
[img]http://service.t.sina.com.cn/widget/qmd/5339802982/c02e16bd/7.png
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-11-7 04:40

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表