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

Project1

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

[已经解决] 求教大神教一下这个套装脚本的使用问题

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1971
在线时间
926 小时
注册时间
2015-10-26
帖子
356

开拓者

跳转到指定楼层
1
发表于 2018-8-30 11:30:30 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
50星屑
脚本在最下面

这个套装脚本感觉很不错,利用套装给角色加属性和技能都可以。
但是使用中发现给角色的套装加成里面,按数值加成的设置有效,但是按百分比的加成就无效。
比如我在Set_Bonuses下面设置这一小段:
  12  => {                     #2号套装加成效果
    1 => [[0, 0, 0]],        #1件装备时
    2 => [[0, 0, 0]],   
    3 => [[0, 0, 0]],
    4 => [[0,0,500],[1,1,20],[2,2,25],[5,3,50]]
    }
[0,0,500]这一节有效,能给角色加500HP
但是后面的是按百分比加成的,[1,1,20](加20%MP)[2,2,25](加25%暴击率)[5,3,50](第三个属性抗性50%)就统统无效了
谷歌翻译了下注释,还是不知道问题在哪里,是不是按百分比加成的地方填法不一样?

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 = 100
  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, 20], [1, 3], [1, 9], [1, 42]],
  372.          2 => [[0, 118], [0, 119]],
  373.          3 => [[1, 263], [1, 272], [1, 289]],
  374.          4 => [[1, 257], [1, 266]],
  375.          5 => [[1, 258], [1, 267]],
  376.          6 => [[1, 259], [1, 268]],
  377.          7 => [[1, 260], [1, 269]],
  378.          8 => [[1, 261], [1, 270]],
  379.          9 => [[1, 262], [1, 271]],
  380.          10 => [[1, 264], [1, 273], [1, 255], [1, 246], [1, 282]],
  381.          11 => [[1, 265], [1, 274]],
  382.          12 => [[1, 5], [1, 6], [1, 7], [1, 8]],
  383.          13 => [[0, 666], [0, 555]]
  384.        }
  385.  
  386. #----------------------------------------------------------------------------
  387. # Sets syntax
  388. #----------------------------------------------------------------------------
  389. # Set_Bonuses = {
  390. #       set id => {
  391. #         amount of pieces required => [[sort, parameter, bonus]], [sort, random parameter, 0]]
  392. #                 }
  393. #                }
  394. #
  395. # set_id must correspond to set_id of Sets
  396. # amount of pieces required indicates how many pieces of the set the actor must
  397. # be wearing before receiving the bonus. If you want to skip one, make the only
  398. # element in it's array [0, 0, 0].
  399. # sort indicates which kind of parameters the bonuses change. See SPECIAL VALUES
  400. # for all sorts.
  401. # parameter can be a value depending on sort. See SPECIAL VALUES in the
  402. # instructions for their corresponding stats.
  403. # Bonus is a direct value added to 'parameter'. If 0, no bonus is added. If
  404. # negative, bonus becomes negative.
  405. # Random paramter is just a random parameter to prevent the last bonus from
  406. # being doubled. Always make the bonus of this element 0.
  407. #
  408. # Add a comma after a ']' or '}' if it's not the last element in the array/hash.
  409. #
  410. # Don't forget to add a bonus of [0, 0, 0] at the end! Or else, the last bonus
  411. # will be doubled!
  412. #----------------------------------------------------------------------------
  413. Set_Bonuses =
  414. {
  415.   1 => {
  416.     1 => [[0, 0, 0]],
  417.     2 => [[0, 0, 500]],
  418.     3 => [[0, 2, 50]],
  419.     4 => [[0, 3, 50]]
  420.        },
  421.  
  422.   2 => {
  423.     1 => [[0, 2, 0]],
  424.     2 => [[0, 2, 100],[0, 6, 50],[4, 6, 358]]
  425.        },
  426.  
  427.   3 => {
  428.     1 => [[0, 2, 0]],
  429.     2 => [[0, 4, 50],[0, 5, 50]],
  430.     3 => [[0, 4, 100],[0, 6, 10],[2, 8, 100]]
  431.        },
  432.  
  433.   4 => {
  434.     1 => [[0, 2, 0]],
  435.     2 => [[0, 3, 1],[0, 5, 1]]
  436.        },
  437.  
  438.   5 => {
  439.     1 => [[0, 2, 0]],
  440.     2 => [[0, 3, 1],[0, 5, 1]]
  441.        },
  442.  
  443.   6 => {
  444.     1 => [[0, 2, 0]],
  445.     2 => [[0, 3, 1],[0, 5, 1]]
  446.        },
  447.  
  448.   7 => {
  449.     1 => [[0, 2, 0]],
  450.     2 => [[0, 3, 1],[0, 5, 1]]
  451.        },
  452.  
  453.   8 => {
  454.     1 => [[0, 2, 0]],
  455.     2 => [[0, 3, 1],[0, 5, 1]]
  456.        },
  457.  
  458.   9 => {
  459.     1 => [[0, 2, 0]],
  460.     2 => [[0, 3, 1],[0, 5, 1]]
  461.        },
  462.  
  463.   10 => {
  464.     1 => [[0, 2, 0]],
  465.     2 => [[0, 3, 1],[0, 5, 1]],
  466.     3 => [[0, 3, 50],[0, 5, 50]],
  467.     4 => [[0, 3, 50],[0, 5, 50]],
  468.     5 => [[0, 3, 50],[0, 5, 50],[4, 5, 240]]
  469.        },
  470.  
  471.   11 => {
  472.     1 => [[0, 2, 0]],
  473.     2 => [[0, 3, 1],[0, 5, 1]]
  474.        },
  475.  
  476.   12  => {                     #2号套装加成效果
  477.     1 => [[0, 0, 0]],        #1件装备时
  478.     2 => [[0, 0, 0]],   
  479.     3 => [[0, 0, 0]],
  480.     4 => [[5,4,0],[2,7,25]]
  481.     }
  482. }
  483.  
  484. #-----------------------------------------------------------------------------
  485. # Sets syntax
  486. #-----------------------------------------------------------------------------
  487. # Set_Sounds = {
  488. #   set_id => {
  489. #     amount_of_pieces_required => [file_name, volume, pitch]
  490. #   }
  491. # }
  492. #
  493. # Resembles the other two parts so I think not much of an explanation is needed.
  494. # When the required amount of pieces has been equipped, the sound sound will be
  495. # played. Doesn't apply for unequipping. Again, watch the comma's!!
  496. #----------------------------------------------------------------------------
  497. Set_Sounds =
  498. {
  499.   12 => {
  500.     1 => ["Flash1", 100, 100], # <- comma here since it isn't the last one!
  501.     2 => ["Flash1", 100, 100],  # <- no comma here since it IS the last one!
  502.     3 => ["Flash1", 100, 100],  # <- no comma here since it IS the last one!
  503.     4 => ["Flash1", 100, 100]  # <- no comma here since it IS the last one!
  504.        }
  505. }
  506.  
  507. end
  508.  
  509. # Only edit things past here if you know what you're doing
  510.  
  511. $imported = {} if $imported.nil?
  512. $imported["Emerald's Equipment Sets"] = true
  513.  
  514. #============================================================================
  515. #
  516. # Game_Actor
  517. # Handles everything for this script.
  518. #============================================================================
  519. class Game_Actor < Game_Battler
  520.  
  521.   attr_reader :active_sets
  522.   attr_reader :item_sets
  523.  
  524.   alias eme_ees_setup setup
  525.   def setup(actor_id)
  526.     @non_set_skills = []
  527.     @skill_from_sets = false
  528.     reset_bonuses
  529.     @active_sets = []
  530.     @item_sets = [0] * (EME::Sets.size + 1)
  531.     eme_ees_setup(actor_id)
  532.   end
  533.  
  534.   alias eme_init_equips init_equips
  535.   def init_equips(equips)
  536.     eme_init_equips(equips)
  537.     equips.each_with_index{|item_id, i|
  538.       etype_id = index_to_etype_id(i)
  539.       slot_id = empty_slot(etype_id)
  540.       for set_id in 1..EME::Sets.size
  541.         for ees_set_equip in EME::Sets[set_id]
  542.           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)
  543.             @item_sets[set_id] += 1
  544.             @active_sets.push(set_id) unless @active_sets.include?(set_id)
  545.           end
  546.         end
  547.       end
  548.     }
  549.     refresh
  550.   end
  551.  
  552.   def ees_is_the_set_item?(item, ees_set_equip)
  553.     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)
  554.   end
  555.  
  556.   alias eme_ees_learn_skill learn_skill
  557.   def learn_skill(skill_id)
  558.     eme_ees_learn_skill(skill_id)
  559.     @non_set_skills.push(skill_id) unless @skill_from_sets
  560.     @skill_from_sets = false
  561.   end
  562.  
  563.   alias eme_ebs_change_equip change_equip
  564.   def change_equip(slot_id, item)
  565.       for set_id in 1..EME::Sets.size
  566.         for ees_set_equip in EME::Sets[set_id]
  567.           if slot_id != nil and @equips[slot_id] != nil and @equips[slot_id].object != nil
  568.             if ees_is_the_set_item?(@equips[slot_id].object, ees_set_equip)
  569.               @item_sets[set_id] -= 1
  570.               @active_sets.delete(set_id) if @item_sets[set_id] == 0
  571.             end
  572.           end
  573.           if item != nil and ees_is_the_set_item?(item, ees_set_equip)
  574.             @item_sets[set_id] += 1
  575.             @active_sets.push(set_id) unless @active_sets.include?(set_id)
  576.             if EME::Set_Sounds.has_key?(set_id) and EME::Set_Sounds[set_id].has_key?(set_amount_wearing(set_id))
  577.               sound = EME::Set_Sounds[set_id][set_amount_wearing(set_id)]
  578.               Audio.se_play("Audio/SE/" + sound[0], sound[1], sound[2])
  579.             end
  580.           end
  581.         end
  582.       end
  583.     set_check
  584.     eme_ebs_change_equip(slot_id, item)
  585.   end
  586.  
  587.   def unlearn_set_skills(set_id)
  588.     EME::Set_Bonuses[set_id].each_value{|bonus_array|
  589.       bonus_array.each{|bonus|
  590.         if bonus[0] == 4
  591.           forget_skill(bonus[2]) unless @non_set_skills.include?(bonus[2])
  592.           @ees_skills.delete(bonus[2])
  593.         end
  594.       }
  595.     }
  596.   end
  597.  
  598.   def item_set_reset_all
  599.     @active_sets.each{|set_id| item_set_reset(set_id)}
  600.   end
  601.  
  602.   def item_set_reset(set_id)
  603.     return unless set_id > 0 and @item_sets[set_id] > 0
  604.     unlearn_set_skills(set_id)
  605.   end
  606.  
  607.   def release_unequippable_items(item_gain = true)
  608.     @equips.each_with_index do |item, i|
  609.       if !equippable?(item.object) || item.object.etype_id != equip_slots[i]
  610.         trade_item_with_party(nil, item.object) if item_gain
  611.         item.object = nil
  612.       end
  613.     end
  614.   end
  615.  
  616.   def release_unequippable_items(item_gain = true)
  617.     loop do
  618.       change_equips = 0
  619.       @equips.each_with_index do |item, i|
  620.         if !equippable?(item.object) or item.object.etype_id != equip_slots[i]
  621.           next if (RPG::Weapon.method_defined?(:two_handed?) and dual_wield? and (equip_slots[i] == 1 and item.object.etype_id == 0))
  622.           trade_item_with_party(nil, item.object) if item_gain
  623.           change_equips += 1 unless item.object.nil?
  624.           unless item.object.nil?
  625.           for set_id in 1..EME::Sets.size
  626.             for ees_set_equip in EME::Sets[set_id]
  627.               if ees_is_the_set_item?(item.object, ees_set_equip)
  628.                 @item_sets[set_id] -= 1
  629.                 @active_sets.delete(set_id) if @item_sets[set_id] == 0
  630.               end
  631.             end
  632.           end
  633.           end
  634.           item.object = nil
  635.         end
  636.       end
  637.       set_check
  638.       break if change_equips == 0
  639.     end
  640.   end
  641.  
  642.   alias eme_ebs_discard_equip discard_equip
  643.   def discard_equip(item)
  644.     slot_id = equips.index(item)
  645.     if slot_id != nil
  646.       for set_id in 1..EME::Sets.size
  647.         for ees_set_equip in EME::Sets[set_id]
  648.           if ees_is_the_set_item?(item, ees_set_equip)
  649.             @item_sets[set_id] -= 1
  650.             @active_sets.delete(set_id) if @item_sets[set_id] == 0
  651.           end
  652.         end
  653.       end
  654.     end
  655.     eme_ebs_discard_equip(item)
  656.     refresh
  657.   end
  658.  
  659.   def set_amount_wearing(set_id)
  660.     return @item_sets[set_id]
  661.   end
  662.  
  663.   def set_check
  664.     item_set_reset_all
  665.     reset_bonuses
  666.     @active_sets.each{|set| change_bonuses(set) unless set == nil}
  667.   end
  668.  
  669.   def change_bonuses(set_id)
  670.     return if set_id == 0 or set_amount_wearing(set_id) == 0
  671.     EME::Set_Bonuses[set_id].each_key{|key|
  672.       if set_amount_wearing(set_id) >= key
  673.         for g in 0...EME::Set_Bonuses[set_id][key].size
  674.           sort = EME::Set_Bonuses[set_id][key][g][0]
  675.           stat = EME::Set_Bonuses[set_id][key][g][1]
  676.           stat_bonus = EME::Set_Bonuses[set_id][key][g][2]
  677.           case EME::Set_Bonuses[set_id][key][g][0]
  678.           when 0
  679.             sets_param_change(stat, stat_bonus)
  680.           when 1
  681.             sets_per_param_change(stat, stat_bonus)
  682.           when 2
  683.             sets_xparam_change(stat, stat_bonus)
  684.           when 3
  685.             sets_sparam_change(stat, stat_bonus)
  686.           when 4
  687.             next if skill_learn?(stat_bonus)
  688.             @skill_from_sets = true
  689.             learn_skill(stat_bonus)
  690.             @ees_skills.push(stat_bonus)
  691.           when 5
  692.             stat -= 1
  693.             sets_element_rate_change(stat, stat_bonus)
  694.           when 6
  695.             stat -= 1
  696.             sets_debuff_rate_change(stat, stat_bonus)
  697.           when 7
  698.             stat -= 1
  699.             sets_state_rate_change(stat, stat_bonus)
  700.           when 8
  701.             sets_state_resist_change(stat, stat_bonus)
  702.           when 9
  703.             sets_atk_elements_change(stat, stat_bonus)
  704.           when 10
  705.             sets_atk_states_change(stat) if stat_bonus > 0
  706.             sets_atk_states_rate_change(stat, stat_bonus)
  707.           when 11
  708.             if stat < 2
  709.               change_sets_additional_wtypes(stat_bonus, (stat == 0 ? true : false))
  710.             elsif stat < 4
  711.               change_sets_additional_atypes(stat_bonus, (stat == 2))
  712.             elsif stat == 4
  713.               @eme_ebs_two_swords_style = true
  714.             end
  715.           when 12
  716.             sets_atk_specials_change(stat, stat_bonus)
  717.           when 13
  718.             add_sets_skill_types(stat, stat_bonus)
  719.           when 14
  720.             add_sets_sealed_skill_types(stat, stat_bonus)
  721.           when 15
  722.             add_sets_sealed_skills(stat, stat_bonus)
  723.           when 16
  724.             add_sets_fixed_equip_types(stat, stat_bonus)
  725.           when 17
  726.             add_sets_sealed_equip_types(stat, stat_bonus)
  727.           when 18
  728.             stat_bonus < 0 ? change_special_flags(stat, true) : change_special_flags(stat)
  729.           when 19
  730.             stat_bonus < 0 ? change_party_abilities(stat, true) : change_party_abilities(stat)
  731.           when 20
  732.             case stat
  733.             when 0
  734.               set_bonus_max_tp(stat_bonus)
  735.             when 1
  736.               set_atk_skill(stat_bonus)
  737.             when 2
  738.               set_grd_skill(stat_bonus)
  739.             end
  740.           end
  741.         end
  742.       end
  743.     }
  744.   end
  745.  
  746. #-------------------------------------------#
  747. # LABEL FOR AUTHOR                          #
  748. # Don't mind this ;)                        #
  749. #-------------------------------------------#
  750.  
  751.   def reset_bonuses
  752.     @sets_param_plus = [0] * 8
  753.     @sets_per_param_plus = [0] * 8
  754.     @sets_xparam_plus = [0] * 10
  755.     @sets_sparam_plus = [0] * 10
  756.     @sets_element_rate = [0] * (EME::MAX_ELEMENTS)
  757.     @sets_debuff_rate = [0] * 8
  758.     @sets_state_rate = [0] * ($data_states.size + 1)
  759.     @sets_state_resist = []
  760.     @sets_state_resist_remove = []
  761.     @sets_atk_elements = []
  762.     @sets_atk_elements_remove = []
  763.     @sets_atk_states = []
  764.     @sets_atk_states_rate = [0] * $data_states.size
  765.     @sets_atk_speed_plus = 0
  766.     @sets_atk_times_plus = 0
  767.     @sets_skill_types = []
  768.     @sets_skill_types_remove = []
  769.     @sets_sealed_skill_types = []
  770.     @sets_sealed_skill_types_remove = []
  771.     @sets_sealed_skills = []
  772.     @sets_sealed_skills_remove = []
  773.     @sets_fixed_equip_types = []
  774.     @sets_fixed_equip_types_remove = []
  775.     @sets_sealed_equip_types = []
  776.     @sets_sealed_equip_types_remove = []
  777.  
  778.     @ees_added_special_flags = []
  779.     @ees_removed_special_flags = []
  780.     @ees_added_party_abilities = []
  781.     @ees_removed_party_abilities = []
  782.     @ees_bonus_max_tp = 0
  783.     @new_atk_skill = nil
  784.     @new_grd_skill = nil
  785.  
  786.     @ees_skills = []
  787.     @sets_wtypes = []
  788.     @sets_atypes = []
  789.     @sets_removed_wtypes = []
  790.     @sets_removed_atypes = []
  791.     @eme_ebs_two_swords_style = false
  792.   end
  793.  
  794.   def sets_param_plus(param_id)
  795.     @sets_param_plus[param_id]
  796.   end
  797.  
  798.   def sets_param_change(param_id, value)
  799.     @sets_param_plus[param_id] += value
  800.   end
  801.  
  802.   def sets_per_param_plus(param_id)
  803.     value = param_base(param_id) + param_plus(param_id)
  804.     value *= @sets_per_param_plus[param_id] / 100
  805.     return value
  806.   end
  807.  
  808.   def sets_per_param_change(param_id, value)
  809.     @sets_per_param_plus[param_id] += value
  810.   end
  811.  
  812.   def sets_xparam_plus(param_id)
  813.     @sets_xparam_plus[param_id]
  814.   end
  815.  
  816.   def sets_xparam_change(param_id, value)
  817.     @sets_xparam_plus[param_id] += value
  818.   end
  819.  
  820.   def sets_sparam_plus(param_id)
  821.     @sets_sparam_plus[param_id]
  822.   end
  823.  
  824.   def sets_sparam_change(param_id, value)
  825.     @sets_sparam_plus[param_id] += value
  826.   end
  827.  
  828.   def sets_element_rate(element_id)
  829.     @sets_element_rate[element_id]
  830.   end
  831.  
  832.   def sets_element_rate_change(element_id, value)
  833.     @sets_element_rate[element_id] += value
  834.   end
  835.  
  836.   def sets_debuff_rate(param_id)
  837.     @sets_debuff_rate[param_id]
  838.   end
  839.  
  840.   def sets_debuff_rate_change(param_id, value)
  841.     @sets_debuff_rate[param_id] += value
  842.   end
  843.  
  844.   def sets_state_rate(state_id)
  845.     @sets_state_rate[state_id]
  846.   end
  847.  
  848.   def sets_state_rate_change(state_id, value)
  849.     @sets_state_rate[state_id] += value
  850.   end
  851.  
  852.   def sets_state_resist(state_id)
  853.     @sets_state_resist[state_id]
  854.   end
  855.  
  856.   def sets_state_resist_remove(state_id)
  857.     @sets_state_resist_remove[state_id]
  858.   end
  859.  
  860.   def sets_state_resist_change(state_id, value)
  861.     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))
  862.   end
  863.  
  864.   def sets_atk_elements(element_id)
  865.     @sets_atk_elements[element_id]
  866.   end
  867.  
  868.   def sets_atk_elements_remove(element_id)
  869.     @sets_atk_elements_remove[element_id]
  870.   end
  871.  
  872.   def sets_atk_elements_change(element_id, value)
  873.     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))
  874.   end
  875.  
  876.   def sets_atk_states(state_id)
  877.     @sets_atk_states[state_id]
  878.   end
  879.  
  880.   def sets_atk_states_change(state_id)
  881.     @sets_atk_states.push(state_id) unless @sets_atk_states.include?(state_id)
  882.   end
  883.  
  884.   def sets_atk_states_rate(state_id)
  885.     @sets_atk_states_rate[state_id]
  886.   end
  887.  
  888.   def sets_atk_states_rate_change(state_id, value)
  889.     @sets_atk_states_rate[state_id] += value
  890.   end
  891.  
  892.   def sets_atk_speed_plus
  893.     @sets_atk_speed_plus
  894.   end
  895.  
  896.   def sets_atk_times_plus
  897.     @sets_atk_times_plus
  898.   end
  899.  
  900.   def sets_atk_specials_change(parameter, value)
  901.     parameter == 0 ? @sets_atk_speed_plus += value : @sets_atk_times_plus += value
  902.   end
  903.  
  904.   def sets_skill_types(skill_type_id)
  905.     @sets_skill_types[skill_type_id]
  906.   end
  907.  
  908.   def sets_skill_types_remove(skill_type_id)
  909.     @sets_skill_types_remove[skill_type_id]
  910.   end
  911.  
  912.   def add_sets_skill_types(skill_type_id, value)
  913.     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))
  914.   end
  915.  
  916.   def sets_sealed_skill_types(skill_type_id)
  917.     @sets_sealed_skill_types[skill_type_id]
  918.   end
  919.  
  920.   def sets_sealed_skill_types_remove(skill_type_id)
  921.     @sets_sealed_skill_types_remove[skill_type_id]
  922.   end
  923.  
  924.   def add_sealed_skill_types(skill_type_id, value)
  925.     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))
  926.   end
  927.  
  928.   def sets_sealed_skills(skill_id)
  929.     @sets_sealed_skills[skill_id]
  930.   end
  931.  
  932.   def sets_sealed_skills_remove(skill_id)
  933.     @sets_sealed_skills_remove[skill_id]
  934.   end
  935.  
  936.   def add_sets_sealed_skills(skill_id, value)
  937.     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))
  938.   end
  939.  
  940.   def sets_additional_wtypes
  941.     @sets_wtypes
  942.   end
  943.  
  944.   def sets_additional_atypes
  945.     @sets_atypes
  946.   end
  947.  
  948.   def sets_removed_wtypes
  949.     @sets_removed_wtypes
  950.   end
  951.  
  952.   def sets_removed_atypes
  953.     @sets_removed_atypes
  954.   end
  955.  
  956.   def change_sets_additional_wtypes(wtype_id, positive_change = true)
  957.     positive_change ? @sets_wtypes.push(wtype_id) : @sets_removed_wtypes.push(wtype_id)
  958.   end
  959.  
  960.   def change_sets_additional_atypes(atype_id, positive_change = true)
  961.     positive_change ? @sets_atypes.push(atype_id) : @sets_removed_atypes.push(atype_id)
  962.   end
  963.  
  964.   def sets_fixed_equip_types(equip_type_id)
  965.     @sets_fixed_equip_types[equip_type_id]
  966.   end
  967.  
  968.   def sets_fixed_equip_types_remove(equip_type_id)
  969.     @sets_fixed_equip_types_remove[equip_type_id]
  970.   end
  971.  
  972.   def add_fixed_equip_types(equip_type_id, value)
  973.     value >= 0 ? @sets_fixed_equip_types.push(equip_type_id) : @sets_fixed_equip_types_remove.delete(sequip_type_id)
  974.   end
  975.  
  976.   def sets_sealed_equip_types(equip_type_id)
  977.     @sets_sealed_equip_types[equip_type_id]
  978.   end
  979.  
  980.   def sets_sealed_equip_types_remove(equip_type_id)
  981.     @sets_sealed_equip_types_remove[equip_type_id]
  982.   end
  983.  
  984.   def add_sealed_equip_types(equip_type_id, value)
  985.     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))
  986.   end
  987.  
  988.   def change_special_flags(flag_id, negative = false)
  989.     !negative ? @ees_added_special_flags.push(flag_id) : @ees_removed_special_flags.push(flag_id)
  990.   end
  991.  
  992.   def change_party_abilities(ability_id, negative = false)
  993.     !negative ? @ees_added_party_abilities.push(ability_id) : @ees_removed_party_abilities.push(ability_id)
  994.   end
  995.  
  996.   def set_bonus_max_tp(value)
  997.     @ees_bonus_max_tp += value
  998.   end
  999.  
  1000.   def set_atk_skill(skill_id)
  1001.     @new_atk_skill = skill_id
  1002.   end
  1003.  
  1004.   def set_grd_skill(skill_id)
  1005.     @new_grd_skill = skill_id
  1006.   end
  1007.  
  1008. #-------------------------------------------#
  1009. # 'NOTHER LABEL FOR AUTHOR                  #
  1010. # Don't mind this ;)                        #
  1011. #-------------------------------------------#
  1012.  
  1013.   def param(param_id)
  1014.     value = param_base(param_id) + param_plus(param_id) + sets_param_plus(param_id) #+ [sets_per_param_plus(param_id), 0].max
  1015.     value *= param_rate(param_id) * param_buff_rate(param_id)
  1016.     [[value, param_max(param_id)].min, param_min(param_id)].max.to_i
  1017.   end
  1018.  
  1019.   alias eme_ebs_xparam xparam
  1020.   def xparam(xparam_id)
  1021.     value = eme_ebs_xparam(xparam_id) + sets_xparam_plus(xparam_id) / 100
  1022.     return value
  1023.   end
  1024.  
  1025.   alias eme_ebs_sparam sparam
  1026.   def sparam(sparam_id)
  1027.     value = eme_ebs_sparam(sparam_id) + sets_sparam_plus(sparam_id) / 100
  1028.     return value
  1029.   end
  1030.  
  1031.   alias eme_ebs_element_rate element_rate
  1032.   def element_rate(element_id)
  1033.     value = eme_ebs_element_rate(element_id) + sets_element_rate(element_id) / 100
  1034.     return value
  1035.   end
  1036.  
  1037.   alias eme_ebs_debuff_rate debuff_rate
  1038.   def debuff_rate(param_id)
  1039.     value = eme_ebs_debuff_rate(param_id) + sets_debuff_rate(param_id) / 100
  1040.     return value
  1041.   end
  1042.  
  1043.   alias eme_ebs_state_rate state_rate
  1044.   def state_rate(state_id)
  1045.     value = eme_ebs_state_rate(state_id) + sets_state_rate(state_id) / 100
  1046.     return value
  1047.   end
  1048.  
  1049.   alias eme_ebs_state_resist_set state_resist_set
  1050.   def state_resist_set
  1051.     value = eme_ebs_state_resist_set
  1052.     @sets_state_resist.each{|state| value.push(state) unless value.include?(element)}
  1053.     @sets_state_resist_remove.each{|state| value.delete(state)}
  1054.     return value
  1055.   end
  1056.  
  1057.   alias eme_ebs_atk_elements atk_elements
  1058.   def atk_elements
  1059.     value = eme_ebs_atk_elements
  1060.     @sets_atk_elements.each{|element| value.push(element) unless value.include?(element)}
  1061.     @sets_atk_elements_remove.each{|element| value.delete(element)}
  1062.     return value
  1063.   end
  1064.  
  1065.   alias eme_ebs_atk_states atk_states
  1066.   def atk_states
  1067.     value = eme_ebs_atk_states
  1068.     @sets_atk_states.each{|state| value.push(@sets_atk_states[i]) }
  1069.     return value
  1070.   end
  1071.  
  1072.   alias eme_ebs_atk_states_rate atk_states_rate
  1073.   def atk_states_rate(state_id)
  1074.     value = eme_ebs_atk_states_rate(state_id) + sets_atk_states_rate(state_id) / 100
  1075.     return value
  1076.   end
  1077.  
  1078.   alias eme_ebs_atk_speed atk_speed
  1079.   def atk_speed
  1080.     value = eme_ebs_atk_speed + sets_atk_speed_plus / 100
  1081.     return value
  1082.   end
  1083.  
  1084.   alias eme_ebs_atk_times atk_times_add
  1085.   def atk_times_add
  1086.     value = [eme_ebs_atk_times + sets_atk_times_plus / 100, 0].max
  1087.     return value
  1088.   end
  1089.  
  1090.   alias eme_ebs_dual_wield? dual_wield?
  1091.   def dual_wield?
  1092.     return true if @eme_ebs_two_swords_style
  1093.     eme_ebs_dual_wield?
  1094.   end
  1095.  
  1096.   alias eme_ebs_added_skill_types added_skill_types
  1097.   def added_skill_types
  1098.     value = eme_ebs_added_skill_types
  1099.     @sets_skill_types.each{|sk_type| value.push(sk_type)}
  1100.     @sets_skill_types_remove.each{|sk_type| value.delete(sk_type)}
  1101.     return value
  1102.   end
  1103.  
  1104.   def skill_type_sealed?(stype_id)
  1105.     value = features_set(FEATURE_STYPE_SEAL)
  1106.     @sets_sealed_skill_types.each{|sk_type| value.push(sk_type)}
  1107.     @sets_sealed_skill_types_remove.each{|sk_type| value.delete(sk_type)}
  1108.     return true if value.include?(stype_id)
  1109.   end
  1110.  
  1111.   def skill_sealed?(skill_id)
  1112.     value = features_set(FEATURE_SKILL_SEAL)
  1113.     @sets_sealed_skills.each{|skill| value.push(skill)}
  1114.     @sets_sealed_skills_remove.each{|skill| value.delete(skill)}
  1115.     return true if value.include?(skill_id)
  1116.   end
  1117.  
  1118.   def equip_wtype_ok?(wtype_id)
  1119.     value = features_set(FEATURE_EQUIP_WTYPE)
  1120.     @sets_wtypes.each{|w_type| value.push(w_type)}
  1121.     @sets_removed_wtypes.each{|w_type| value.delete(w_type)}
  1122.     return true if value.include?(wtype_id)
  1123.   end
  1124.  
  1125.   def equip_atype_ok?(atype_id)
  1126.     value = features_set(FEATURE_EQUIP_ATYPE)
  1127.     @sets_atypes.each{|a_type| value.push(a_type)}
  1128.     @sets_removed_atypes.each{|a_type| value.delete(a_type)}
  1129.     return true if value.include?(atype_id)
  1130.   end
  1131.  
  1132.   def equip_type_fixed?(etype_id)
  1133.     value = features_set(FEATURE_EQUIP_FIX)
  1134.     @sets_fixed_equip_types.each{|e_type| value.push(e_type)}
  1135.     @sets_fixed_equip_types_remove.each{|e_type| value.delete(e_type)}
  1136.     return true if value.include?(etype_id)
  1137.   end
  1138.  
  1139.   def equip_type_sealed?(etype_id)
  1140.     value = features_set(FEATURE_EQUIP_SEAL)
  1141.     @sets_sealed_equip_types.each{|e_type| value.push(e_type)}
  1142.     @sets_sealed_equip_types_remove.each{|e_type| value.delete(e_type)}
  1143.     return true if value.include?(etype_id)
  1144.   end
  1145.  
  1146.   alias eme_ees_special_flag special_flag
  1147.   def special_flag(flag_id)
  1148.     return false if @ees_removed_special_flags.include?(flag_id)
  1149.     return @ees_added_special_flags.include?(flag_id) ? true : eme_ees_special_flag(flag_id)
  1150.   end
  1151.  
  1152.   alias eme_ees_party_ability party_ability
  1153.   def party_ability(ability_id)
  1154.     return false if @ees_removed_party_abilities.include?(ability_id)
  1155.     return @ees_added_party_abilities.include?(ability_id) ? true : eme_ees_party_ability(ability_id)
  1156.   end
  1157.  
  1158.   alias eme_ees_max_tp max_tp
  1159.   def max_tp
  1160.     return eme_ees_max_tp + @ees_bonus_max_tp
  1161.   end
  1162.  
  1163.   alias eme_ees_attack_skill attack_skill_id
  1164.   def attack_skill_id
  1165.     return @new_atk_skill unless @new_atk_skill == nil
  1166.     return eme_ees_attack_skill
  1167.   end
  1168.  
  1169.   alias eme_ees_guard_skill guard_skill_id
  1170.   def guard_skill_id
  1171.     return @new_grd_skill unless @new_grd_skill == nil
  1172.     return eme_ees_guard_skill
  1173.   end
  1174.  
  1175. end

最佳答案

查看完整内容

看1014行。sets_per_param_plus这个方法就是增加百分比的方法。 但是最后添加那他注释掉了可能考虑按照这样来会导致数据太大。 而且他是会叠加的比如一个两件套+10%力量,另外两件套+20%力量,那么最终他就是加了30%*(基础+plus)

Lv2.观梦者

梦石
0
星屑
277
在线时间
53 小时
注册时间
2014-1-24
帖子
18
2
发表于 2018-8-30 11:30:31 | 只看该作者
看1014行。sets_per_param_plus这个方法就是增加百分比的方法。
但是最后添加那他注释掉了可能考虑按照这样来会导致数据太大。
而且他是会叠加的比如一个两件套+10%力量,另外两件套+20%力量,那么最终他就是加了30%*(基础+plus)

点评

原来是这样,晕了啊,那么求教一下sort8那里说明奖励设置成正数就免疫,负数就失去免疫,也没有效果是怎么回事呢  发表于 2018-9-6 10:00
回复

使用道具 举报

Lv2.观梦者

梦石
0
星屑
809
在线时间
176 小时
注册时间
2017-1-15
帖子
81
3
发表于 2018-9-3 23:14:35 | 只看该作者
抗性哪里要加2个小数,50.00这样
属性哪里我也不知道怎么弄
回复

使用道具 举报

Lv2.观梦者

梦石
0
星屑
730
在线时间
93 小时
注册时间
2010-10-28
帖子
32
4
发表于 2018-9-4 21:34:49 | 只看该作者
代码太长 没仔细看……感觉是你用错了sort,因为你用的sort类型好像不是按percentage计算的。注释文档中写的很详细
# Sorts:
# 0  - Standard Parameter
# 1  - Standard Parameter (Percentage)

所以你看对于standard parameter使用sort1才是按照percentage计算的。
再仔细读读注释文档吧,这脚本好复杂……

点评

我简单看了一下(懒了…………)[1,0,30]应该是max hp增加30%吧?没有效果吗?好久没打开软件了 有时间我自己试试 不好意思了~  发表于 2018-9-5 00:39
我用的是sort1啊,像这样[1,0,30],但没起效果  发表于 2018-9-4 21:43
回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1883
在线时间
157 小时
注册时间
2016-1-29
帖子
267
5
发表于 2018-11-1 22:17:38 | 只看该作者
qq420134293 发表于 2018-8-30 11:30
看1014行。sets_per_param_plus这个方法就是增加百分比的方法。
但是最后添加那他注释掉了可能考虑按照这样 ...

大神 这个脚本怎么用啊?
回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1883
在线时间
157 小时
注册时间
2016-1-29
帖子
267
6
发表于 2018-11-1 22:18:54 | 只看该作者
deadseifer 发表于 2018-9-4 21:34
代码太长 没仔细看……感觉是你用错了sort,因为你用的sort类型好像不是按percentage计算的。注释文档中写 ...

大神 这个脚本怎么使用啊 全是英文 我要改哪里才行啊 新手
回复

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
19284
在线时间
3074 小时
注册时间
2013-1-11
帖子
1288
7
发表于 2018-11-2 09:55:01 | 只看该作者
lixinglixing022 发表于 2018-11-1 22:18
大神 这个脚本怎么使用啊 全是英文 我要改哪里才行啊 新手

在Sets上面和Set_Bonuses上面的备注不是有些吗

Sets = {
     1 => [[0, 3], [1, 50]], # 1号套装所需 3号武器和50号防具,0代表武器,1代表防具,后面的是ID
}

Set_Bonuses =
{
  # 1号套装所附加的属性
  1 => {
    1 => [[0, 0, 100]], # 穿齐一件装备所加的属性
    2 => [[0, 0, 500]], # 穿齐两件加的属性
   # [第一个是序号,第二个是属性类型,第三个是属性值]
  },
}

# 附加属性编号
# 0 - MaxHp
# 1 - MaxMp
# 2 - Attack
# 3 - Defense
# 4 - Magic Attack (Spirit)
# 5 - Magic Defence (Resistance)
# 6 - Agility
# 7 - Luck
回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1883
在线时间
157 小时
注册时间
2016-1-29
帖子
267
8
发表于 2018-11-2 10:13:12 | 只看该作者
谢谢咚咚大神了.. 真心好 咚咚大神我能加你好友不
回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1883
在线时间
157 小时
注册时间
2016-1-29
帖子
267
9
发表于 2018-11-2 10:13:55 | 只看该作者
谢谢咚咚大神了.. 真心好 咚咚大神我能加你好友不
回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1883
在线时间
157 小时
注册时间
2016-1-29
帖子
267
10
发表于 2018-11-2 14:30:53 | 只看该作者
张咚咚 发表于 2018-11-2 09:55
在Sets上面和Set_Bonuses上面的备注不是有些吗

Sets = {

咚咚大神 出现这个是不是跟我脚本里面东西有冲突?

QQ图片20181102142733.png (17.37 KB, 下载次数: 22)

QQ图片20181102142733.png

点评

猜测:你是不是插入了2次这个脚本  发表于 2018-11-2 14:45
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-25 07:31

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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