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

Project1

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

[已经解决] 套装脚本求教改正BUG

[复制链接]

Lv2.观梦者

梦石
0
星屑
352
在线时间
377 小时
注册时间
2013-1-30
帖子
219
跳转到指定楼层
1
发表于 2014-11-16 15:11:12 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 qknight 于 2014-11-17 03:19 编辑

这是一个套装脚本,能够实现装备了相应的套装后增加属性的功能。但是在下发现一旦敌人使用了某些技能(比如说71号的暗影、72的黑暗),这时候系统就会报错,说1022行出了问题
“undefined method'/' for nil:NilClass”,求指导如何修改这个BUG

问题已解决!将MAX_ELEMENTS改成20后果然不会报错了!
  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 www.rpgmakervxace.net 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. # http://www.rpgmakervxace.net/index.php?/topic/1092-ees-emeralds-equipment-sets/
  345. #============================================================================
  346. #
  347. # CONFIGURATION
  348. #
  349. #============================================================================

  350. module EME
  351.   
  352.   MAX_ELEMENTS = 10

  353. #----------------------------------------------------------------------------
  354. # Sets syntax
  355. #----------------------------------------------------------------------------
  356. # Sets = {
  357. #          set_id => [[equipment_type, equipment_id]]
  358. #        }
  359. #
  360. # set_id must be bigger than 0
  361. # equipment_type can be either 0 (weapon) or 1 (armor)
  362. # Add a comma after a ']' if it's not the last element in the array/hash.
  363. #
  364. # Don't forget to add a ungettable item at the end! Else, the last item will
  365. # count for two!
  366. #----------------------------------------------------------------------------

  367. Sets = {
  368.          1 => [[0, 20], [1, 3], [1, 9], [1, 42]],
  369.          2 => [[0, 118], [0, 119]],
  370.          3 => [[1, 263], [1, 272], [1, 289]],
  371.          4 => [[1, 257], [1, 266]],
  372.          5 => [[1, 258], [1, 267]],
  373.          6 => [[1, 259], [1, 268]],
  374.          7 => [[1, 260], [1, 269]],
  375.          8 => [[1, 261], [1, 270]],
  376.          9 => [[1, 262], [1, 271]],
  377.          10 => [[1, 264], [1, 273], [1, 255], [1, 246], [1, 282]],
  378.          11 => [[1, 265], [1, 274]]
  379.        }

  380. #----------------------------------------------------------------------------
  381. # Sets syntax
  382. #----------------------------------------------------------------------------
  383. # Set_Bonuses = {
  384. #       set id => {
  385. #         amount of pieces required => [[sort, parameter, bonus]], [sort, random parameter, 0]]
  386. #                 }
  387. #                }
  388. #
  389. # set_id must correspond to set_id of Sets
  390. # amount of pieces required indicates how many pieces of the set the actor must
  391. # be wearing before receiving the bonus. If you want to skip one, make the only
  392. # element in it's array [0, 0, 0].
  393. # sort indicates which kind of parameters the bonuses change. See SPECIAL VALUES
  394. # for all sorts.
  395. # parameter can be a value depending on sort. See SPECIAL VALUES in the
  396. # instructions for their corresponding stats.
  397. # Bonus is a direct value added to 'parameter'. If 0, no bonus is added. If
  398. # negative, bonus becomes negative.
  399. # Random paramter is just a random parameter to prevent the last bonus from
  400. # being doubled. Always make the bonus of this element 0.
  401. #
  402. # Add a comma after a ']' or '}' if it's not the last element in the array/hash.
  403. #
  404. # Don't forget to add a bonus of [0, 0, 0] at the end! Or else, the last bonus
  405. # will be doubled!
  406. #----------------------------------------------------------------------------
  407. Set_Bonuses =
  408. {
  409.   1 => {
  410.     1 => [[0, 0, 0]],
  411.     2 => [[0, 0, 500]],
  412.     3 => [[0, 2, 50]],
  413.     4 => [[0, 3, 50]]
  414.        },

  415.   2 => {
  416.     1 => [[0, 2, 0]],
  417.     2 => [[0, 2, 100],[0, 6, 50],[4, 6, 358]]
  418.        },

  419.   3 => {
  420.     1 => [[0, 2, 0]],
  421.     2 => [[0, 4, 50],[0, 5, 50]],
  422.     3 => [[0, 4, 100],[0, 6, 10],[2, 8, 100]]
  423.        },

  424.   4 => {
  425.     1 => [[0, 2, 0]],
  426.     2 => [[0, 3, 1],[0, 5, 1]]
  427.        },

  428.   5 => {
  429.     1 => [[0, 2, 0]],
  430.     2 => [[0, 3, 1],[0, 5, 1]]
  431.        },

  432.   6 => {
  433.     1 => [[0, 2, 0]],
  434.     2 => [[0, 3, 1],[0, 5, 1]]
  435.        },

  436.   7 => {
  437.     1 => [[0, 2, 0]],
  438.     2 => [[0, 3, 1],[0, 5, 1]]
  439.        },

  440.   8 => {
  441.     1 => [[0, 2, 0]],
  442.     2 => [[0, 3, 1],[0, 5, 1]]
  443.        },

  444.   9 => {
  445.     1 => [[0, 2, 0]],
  446.     2 => [[0, 3, 1],[0, 5, 1]]
  447.        },

  448.   10 => {
  449.     1 => [[0, 2, 0]],
  450.     2 => [[0, 3, 1],[0, 5, 1]],
  451.     3 => [[0, 3, 50],[0, 5, 50]],
  452.     4 => [[0, 3, 50],[0, 5, 50]],
  453.     5 => [[0, 3, 50],[0, 5, 50],[4, 5, 240]]
  454.        },

  455.   11 => {
  456.     1 => [[0, 2, 0]],
  457.     2 => [[0, 3, 1],[0, 5, 1]]
  458.        }
  459. }

  460. #-----------------------------------------------------------------------------
  461. # Sets syntax
  462. #-----------------------------------------------------------------------------
  463. # Set_Sounds = {
  464. #   set_id => {
  465. #     amount_of_pieces_required => [file_name, volume, pitch]
  466. #   }
  467. # }
  468. #
  469. # Resembles the other two parts so I think not much of an explanation is needed.
  470. # When the required amount of pieces has been equipped, the sound sound will be
  471. # played. Doesn't apply for unequipping. Again, watch the comma's!!
  472. #----------------------------------------------------------------------------
  473. Set_Sounds =
  474. {
  475.   1 => {
  476.     1 => ["Flash1", 100, 100], # <- comma here since it isn't the last one!
  477.     2 => ["Flash1", 100, 100]  # <- no comma here since it IS the last one!
  478.        }
  479. }

  480. end

  481. # Only edit things past here if you know what you're doing

  482. $imported = {} if $imported.nil?
  483. $imported["Emerald's Equipment Sets"] = true

  484. #============================================================================
  485. #
  486. # Game_Actor
  487. # Handles everything for this script.
  488. #============================================================================
  489. class Game_Actor < Game_Battler
  490.   
  491.   attr_reader :active_sets
  492.   attr_reader :item_sets
  493.   
  494.   alias eme_ees_setup setup
  495.   def setup(actor_id)
  496.     @non_set_skills = []
  497.     @skill_from_sets = false
  498.     reset_bonuses
  499.     @active_sets = []
  500.     @item_sets = [0] * (EME::Sets.size + 1)
  501.     eme_ees_setup(actor_id)
  502.   end

  503.   alias eme_init_equips init_equips
  504.   def init_equips(equips)
  505.     eme_init_equips(equips)
  506.     equips.each_with_index{|item_id, i|
  507.       etype_id = index_to_etype_id(i)
  508.       slot_id = empty_slot(etype_id)
  509.       for set_id in 1..EME::Sets.size
  510.         for ees_set_equip in EME::Sets[set_id]
  511.           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)
  512.             @item_sets[set_id] += 1
  513.             @active_sets.push(set_id) unless @active_sets.include?(set_id)
  514.           end
  515.         end
  516.       end
  517.     }
  518.     refresh
  519.   end
  520.    
  521.   def ees_is_the_set_item?(item, ees_set_equip)
  522.     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)
  523.   end

  524.   alias eme_ees_learn_skill learn_skill
  525.   def learn_skill(skill_id)
  526.     eme_ees_learn_skill(skill_id)
  527.     @non_set_skills.push(skill_id) unless @skill_from_sets
  528.     @skill_from_sets = false
  529.   end

  530.   alias eme_ebs_change_equip change_equip
  531.   def change_equip(slot_id, item)
  532.       for set_id in 1..EME::Sets.size
  533.         for ees_set_equip in EME::Sets[set_id]
  534.           if slot_id != nil and @equips[slot_id] != nil and @equips[slot_id].object != nil
  535.             if ees_is_the_set_item?(@equips[slot_id].object, ees_set_equip)
  536.               @item_sets[set_id] -= 1
  537.               @active_sets.delete(set_id) if @item_sets[set_id] == 0
  538.             end
  539.           end
  540.           if item != nil and ees_is_the_set_item?(item, ees_set_equip)
  541.             @item_sets[set_id] += 1
  542.             @active_sets.push(set_id) unless @active_sets.include?(set_id)
  543.             if EME::Set_Sounds.has_key?(set_id) and EME::Set_Sounds[set_id].has_key?(set_amount_wearing(set_id))
  544.               sound = EME::Set_Sounds[set_id][set_amount_wearing(set_id)]
  545.               Audio.se_play("Audio/SE/" + sound[0], sound[1], sound[2])
  546.             end
  547.           end
  548.         end
  549.       end
  550.     set_check
  551.     eme_ebs_change_equip(slot_id, item)
  552.   end

  553.   def unlearn_set_skills(set_id)
  554.     EME::Set_Bonuses[set_id].each_value{|bonus_array|
  555.       bonus_array.each{|bonus|
  556.         if bonus[0] == 4
  557.           forget_skill(bonus[2]) unless @non_set_skills.include?(bonus[2])
  558.           @ees_skills.delete(bonus[2])
  559.         end
  560.       }
  561.     }
  562.   end
  563.   
  564.   def item_set_reset_all
  565.     @active_sets.each{|set_id| item_set_reset(set_id)}
  566.   end
  567.   
  568.   def item_set_reset(set_id)
  569.     return unless set_id > 0 and @item_sets[set_id] > 0
  570.     unlearn_set_skills(set_id)
  571.   end
  572.   
  573.   def release_unequippable_items(item_gain = true)
  574.     @equips.each_with_index do |item, i|
  575.       if !equippable?(item.object) || item.object.etype_id != equip_slots[i]
  576.         trade_item_with_party(nil, item.object) if item_gain
  577.         item.object = nil
  578.       end
  579.     end
  580.   end

  581.   def release_unequippable_items(item_gain = true)
  582.     loop do
  583.       change_equips = 0
  584.       @equips.each_with_index do |item, i|
  585.         if !equippable?(item.object) or item.object.etype_id != equip_slots[i]
  586.           next if (RPG::Weapon.method_defined?(:two_handed?) and dual_wield? and (equip_slots[i] == 1 and item.object.etype_id == 0))
  587.           trade_item_with_party(nil, item.object) if item_gain
  588.           change_equips += 1 unless item.object.nil?
  589.           unless item.object.nil?
  590.           for set_id in 1..EME::Sets.size
  591.             for ees_set_equip in EME::Sets[set_id]
  592.               if ees_is_the_set_item?(item.object, ees_set_equip)
  593.                 @item_sets[set_id] -= 1
  594.                 @active_sets.delete(set_id) if @item_sets[set_id] == 0
  595.               end
  596.             end
  597.           end
  598.           end
  599.           item.object = nil
  600.         end
  601.       end
  602.       set_check
  603.       break if change_equips == 0
  604.     end
  605.   end

  606.   alias eme_ebs_discard_equip discard_equip
  607.   def discard_equip(item)
  608.     slot_id = equips.index(item)
  609.     if slot_id != nil
  610.       for set_id in 1..EME::Sets.size
  611.         for ees_set_equip in EME::Sets[set_id]
  612.           if ees_is_the_set_item?(item, ees_set_equip)
  613.             @item_sets[set_id] -= 1
  614.             @active_sets.delete(set_id) if @item_sets[set_id] == 0
  615.           end
  616.         end
  617.       end
  618.     end
  619.     eme_ebs_discard_equip(item)
  620.     refresh
  621.   end
  622.   
  623.   def set_amount_wearing(set_id)
  624.     return @item_sets[set_id]
  625.   end

  626.   def set_check
  627.     item_set_reset_all
  628.     reset_bonuses
  629.     @active_sets.each{|set| change_bonuses(set) unless set == nil}
  630.   end
  631.   
  632.   def change_bonuses(set_id)
  633.     return if set_id == 0 or set_amount_wearing(set_id) == 0
  634.     EME::Set_Bonuses[set_id].each_key{|key|
  635.       if set_amount_wearing(set_id) >= key
  636.         for g in 0...EME::Set_Bonuses[set_id][key].size
  637.           sort = EME::Set_Bonuses[set_id][key][g][0]
  638.           stat = EME::Set_Bonuses[set_id][key][g][1]
  639.           stat_bonus = EME::Set_Bonuses[set_id][key][g][2]
  640.           case EME::Set_Bonuses[set_id][key][g][0]
  641.           when 0
  642.             sets_param_change(stat, stat_bonus)
  643.           when 1
  644.             sets_per_param_change(stat, stat_bonus)
  645.           when 2
  646.             sets_xparam_change(stat, stat_bonus)
  647.           when 3
  648.             sets_sparam_change(stat, stat_bonus)
  649.           when 4
  650.             next if skill_learn?(stat_bonus)
  651.             @skill_from_sets = true
  652.             learn_skill(stat_bonus)
  653.             @ees_skills.push(stat_bonus)
  654.           when 5
  655.             stat -= 1
  656.             sets_element_rate_change(stat, stat_bonus)
  657.           when 6
  658.             stat -= 1
  659.             sets_debuff_rate_change(stat, stat_bonus)
  660.           when 7
  661.             stat -= 1
  662.             sets_state_rate_change(stat, stat_bonus)
  663.           when 8
  664.             sets_state_resist_change(stat, stat_bonus)
  665.           when 9
  666.             sets_atk_elements_change(stat, stat_bonus)
  667.           when 10
  668.             sets_atk_states_change(stat) if stat_bonus > 0
  669.             sets_atk_states_rate_change(stat, stat_bonus)
  670.           when 11
  671.             if stat < 2
  672.               change_sets_additional_wtypes(stat_bonus, (stat == 0 ? true : false))
  673.             elsif stat < 4
  674.               change_sets_additional_atypes(stat_bonus, (stat == 2))
  675.             elsif stat == 4
  676.               @eme_ebs_two_swords_style = true
  677.             end
  678.           when 12
  679.             sets_atk_specials_change(stat, stat_bonus)
  680.           when 13
  681.             add_sets_skill_types(stat, stat_bonus)
  682.           when 14
  683.             add_sets_sealed_skill_types(stat, stat_bonus)
  684.           when 15
  685.             add_sets_sealed_skills(stat, stat_bonus)
  686.           when 16
  687.             add_sets_fixed_equip_types(stat, stat_bonus)
  688.           when 17
  689.             add_sets_sealed_equip_types(stat, stat_bonus)
  690.           when 18
  691.             stat_bonus < 0 ? change_special_flags(stat, true) : change_special_flags(stat)
  692.           when 19
  693.             stat_bonus < 0 ? change_party_abilities(stat, true) : change_party_abilities(stat)
  694.           when 20
  695.             case stat
  696.             when 0
  697.               set_bonus_max_tp(stat_bonus)
  698.             when 1
  699.               set_atk_skill(stat_bonus)
  700.             when 2
  701.               set_grd_skill(stat_bonus)
  702.             end
  703.           end
  704.         end
  705.       end
  706.     }
  707.   end

  708. #-------------------------------------------#
  709. # LABEL FOR AUTHOR                          #
  710. # Don't mind this ;)                        #
  711. #-------------------------------------------#

  712.   def reset_bonuses
  713.     @sets_param_plus = [0] * 8
  714.     @sets_per_param_plus = [0] * 8
  715.     @sets_xparam_plus = [0] * 10
  716.     @sets_sparam_plus = [0] * 10
  717.     @sets_element_rate = [0] * (EME::MAX_ELEMENTS)
  718.     @sets_debuff_rate = [0] * 8
  719.     @sets_state_rate = [0] * ($data_states.size + 1)
  720.     @sets_state_resist = []
  721.     @sets_state_resist_remove = []
  722.     @sets_atk_elements = []
  723.     @sets_atk_elements_remove = []
  724.     @sets_atk_states = []
  725.     @sets_atk_states_rate = [0] * $data_states.size
  726.     @sets_atk_speed_plus = 0
  727.     @sets_atk_times_plus = 0
  728.     @sets_skill_types = []
  729.     @sets_skill_types_remove = []
  730.     @sets_sealed_skill_types = []
  731.     @sets_sealed_skill_types_remove = []
  732.     @sets_sealed_skills = []
  733.     @sets_sealed_skills_remove = []
  734.     @sets_fixed_equip_types = []
  735.     @sets_fixed_equip_types_remove = []
  736.     @sets_sealed_equip_types = []
  737.     @sets_sealed_equip_types_remove = []
  738.    
  739.     @ees_added_special_flags = []
  740.     @ees_removed_special_flags = []
  741.     @ees_added_party_abilities = []
  742.     @ees_removed_party_abilities = []
  743.     @ees_bonus_max_tp = 0
  744.     @new_atk_skill = nil
  745.     @new_grd_skill = nil
  746.    
  747.     @ees_skills = []
  748.     @sets_wtypes = []
  749.     @sets_atypes = []
  750.     @sets_removed_wtypes = []
  751.     @sets_removed_atypes = []
  752.     @eme_ebs_two_swords_style = false
  753.   end

  754.   def sets_param_plus(param_id)
  755.     @sets_param_plus[param_id]
  756.   end

  757.   def sets_param_change(param_id, value)
  758.     @sets_param_plus[param_id] += value
  759.   end

  760.   def sets_per_param_plus(param_id)
  761.     value = param_base(param_id) + param_plus(param_id)
  762.     value *= @sets_per_param_plus[param_id] / 100
  763.     return value
  764.   end

  765.   def sets_per_param_change(param_id, value)
  766.     @sets_per_param_plus[param_id] += value
  767.   end
  768.   
  769.   def sets_xparam_plus(param_id)
  770.     @sets_xparam_plus[param_id]
  771.   end

  772.   def sets_xparam_change(param_id, value)
  773.     @sets_xparam_plus[param_id] += value
  774.   end

  775.   def sets_sparam_plus(param_id)
  776.     @sets_sparam_plus[param_id]
  777.   end
  778.   
  779.   def sets_sparam_change(param_id, value)
  780.     @sets_sparam_plus[param_id] += value
  781.   end
  782.   
  783.   def sets_element_rate(element_id)
  784.     @sets_element_rate[element_id]
  785.   end
  786.   
  787.   def sets_element_rate_change(element_id, value)
  788.     @sets_element_rate[element_id] += value
  789.   end
  790.   
  791.   def sets_debuff_rate(param_id)
  792.     @sets_debuff_rate[param_id]
  793.   end

  794.   def sets_debuff_rate_change(param_id, value)
  795.     @sets_debuff_rate[param_id] += value
  796.   end
  797.   
  798.   def sets_state_rate(state_id)
  799.     @sets_state_rate[state_id]
  800.   end

  801.   def sets_state_rate_change(state_id, value)
  802.     @sets_state_rate[state_id] += value
  803.   end
  804.   
  805.   def sets_state_resist(state_id)
  806.     @sets_state_resist[state_id]
  807.   end
  808.   
  809.   def sets_state_resist_remove(state_id)
  810.     @sets_state_resist_remove[state_id]
  811.   end
  812.   
  813.   def sets_state_resist_change(state_id, value)
  814.     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))
  815.   end
  816.   
  817.   def sets_atk_elements(element_id)
  818.     @sets_atk_elements[element_id]
  819.   end
  820.   
  821.   def sets_atk_elements_remove(element_id)
  822.     @sets_atk_elements_remove[element_id]
  823.   end

  824.   def sets_atk_elements_change(element_id, value)
  825.     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))
  826.   end
  827.   
  828.   def sets_atk_states(state_id)
  829.     @sets_atk_states[state_id]
  830.   end

  831.   def sets_atk_states_change(state_id)
  832.     @sets_atk_states.push(state_id) unless @sets_atk_states.include?(state_id)
  833.   end
  834.   
  835.   def sets_atk_states_rate(state_id)
  836.     @sets_atk_states_rate[state_id]
  837.   end

  838.   def sets_atk_states_rate_change(state_id, value)
  839.     @sets_atk_states_rate[state_id] += value
  840.   end
  841.   
  842.   def sets_atk_speed_plus
  843.     @sets_atk_speed_plus
  844.   end

  845.   def sets_atk_times_plus
  846.     @sets_atk_times_plus
  847.   end
  848.   
  849.   def sets_atk_specials_change(parameter, value)
  850.     parameter == 0 ? @sets_atk_speed_plus += value : @sets_atk_times_plus += value
  851.   end
  852.    
  853.   def sets_skill_types(skill_type_id)
  854.     @sets_skill_types[skill_type_id]
  855.   end
  856.   
  857.   def sets_skill_types_remove(skill_type_id)
  858.     @sets_skill_types_remove[skill_type_id]
  859.   end

  860.   def add_sets_skill_types(skill_type_id, value)
  861.     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))
  862.   end
  863.   
  864.   def sets_sealed_skill_types(skill_type_id)
  865.     @sets_sealed_skill_types[skill_type_id]
  866.   end
  867.   
  868.   def sets_sealed_skill_types_remove(skill_type_id)
  869.     @sets_sealed_skill_types_remove[skill_type_id]
  870.   end

  871.   def add_sealed_skill_types(skill_type_id, value)
  872.     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))
  873.   end
  874.   
  875.   def sets_sealed_skills(skill_id)
  876.     @sets_sealed_skills[skill_id]
  877.   end
  878.   
  879.   def sets_sealed_skills_remove(skill_id)
  880.     @sets_sealed_skills_remove[skill_id]
  881.   end

  882.   def add_sets_sealed_skills(skill_id, value)
  883.     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))
  884.   end
  885.   
  886.   def sets_additional_wtypes
  887.     @sets_wtypes
  888.   end
  889.   
  890.   def sets_additional_atypes
  891.     @sets_atypes
  892.   end
  893.   
  894.   def sets_removed_wtypes
  895.     @sets_removed_wtypes
  896.   end
  897.   
  898.   def sets_removed_atypes
  899.     @sets_removed_atypes
  900.   end
  901.   
  902.   def change_sets_additional_wtypes(wtype_id, positive_change = true)
  903.     positive_change ? @sets_wtypes.push(wtype_id) : @sets_removed_wtypes.push(wtype_id)
  904.   end
  905.   
  906.   def change_sets_additional_atypes(atype_id, positive_change = true)
  907.     positive_change ? @sets_atypes.push(atype_id) : @sets_removed_atypes.push(atype_id)
  908.   end
  909.   
  910.   def sets_fixed_equip_types(equip_type_id)
  911.     @sets_fixed_equip_types[equip_type_id]
  912.   end
  913.   
  914.   def sets_fixed_equip_types_remove(equip_type_id)
  915.     @sets_fixed_equip_types_remove[equip_type_id]
  916.   end

  917.   def add_fixed_equip_types(equip_type_id, value)
  918.     value >= 0 ? @sets_fixed_equip_types.push(equip_type_id) : @sets_fixed_equip_types_remove.delete(sequip_type_id)
  919.   end
  920.   
  921.   def sets_sealed_equip_types(equip_type_id)
  922.     @sets_sealed_equip_types[equip_type_id]
  923.   end
  924.   
  925.   def sets_sealed_equip_types_remove(equip_type_id)
  926.     @sets_sealed_equip_types_remove[equip_type_id]
  927.   end

  928.   def add_sealed_equip_types(equip_type_id, value)
  929.     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))
  930.   end
  931.   
  932.   def change_special_flags(flag_id, negative = false)
  933.     !negative ? @ees_added_special_flags.push(flag_id) : @ees_removed_special_flags.push(flag_id)
  934.   end
  935.   
  936.   def change_party_abilities(ability_id, negative = false)
  937.     !negative ? @ees_added_party_abilities.push(ability_id) : @ees_removed_party_abilities.push(ability_id)
  938.   end
  939.   
  940.   def set_bonus_max_tp(value)
  941.     @ees_bonus_max_tp += value
  942.   end
  943.   
  944.   def set_atk_skill(skill_id)
  945.     @new_atk_skill = skill_id
  946.   end
  947.   
  948.   def set_grd_skill(skill_id)
  949.     @new_grd_skill = skill_id
  950.   end
  951.   
  952. #-------------------------------------------#
  953. # 'NOTHER LABEL FOR AUTHOR                  #
  954. # Don't mind this ;)                        #
  955. #-------------------------------------------#

  956.   def param(param_id)
  957.     value = param_base(param_id) + param_plus(param_id) + sets_param_plus(param_id) #+ [sets_per_param_plus(param_id), 0].max
  958.     value *= param_rate(param_id) * param_buff_rate(param_id)
  959.     [[value, param_max(param_id)].min, param_min(param_id)].max.to_i
  960.   end
  961.   
  962.   alias eme_ebs_xparam xparam
  963.   def xparam(xparam_id)
  964.     value = eme_ebs_xparam(xparam_id) + sets_xparam_plus(xparam_id) / 100
  965.     return value
  966.   end
  967.   
  968.   alias eme_ebs_sparam sparam
  969.   def sparam(sparam_id)
  970.     value = eme_ebs_sparam(sparam_id) + sets_sparam_plus(sparam_id) / 100
  971.     return value
  972.   end
  973.   
  974.   alias eme_ebs_element_rate element_rate
  975.   def element_rate(element_id)
  976.     value = eme_ebs_element_rate(element_id) + sets_element_rate(element_id) / 100
  977.     return value
  978.   end
  979.   
  980.   alias eme_ebs_debuff_rate debuff_rate
  981.   def debuff_rate(param_id)
  982.     value = eme_ebs_debuff_rate(param_id) + sets_debuff_rate(param_id) / 100
  983.     return value
  984.   end

  985.   alias eme_ebs_state_rate state_rate
  986.   def state_rate(state_id)
  987.     value = eme_ebs_state_rate(state_id) + sets_state_rate(state_id) / 100
  988.     return value
  989.   end

  990.   alias eme_ebs_state_resist_set state_resist_set
  991.   def state_resist_set
  992.     value = eme_ebs_state_resist_set
  993.     @sets_state_resist.each{|state| value.push(state) unless value.include?(element)}
  994.     @sets_state_resist_remove.each{|state| value.delete(state)}
  995.     return value
  996.   end
  997.   
  998.   alias eme_ebs_atk_elements atk_elements
  999.   def atk_elements
  1000.     value = eme_ebs_atk_elements
  1001.     @sets_atk_elements.each{|element| value.push(element) unless value.include?(element)}
  1002.     @sets_atk_elements_remove.each{|element| value.delete(element)}
  1003.     return value
  1004.   end
  1005.   
  1006.   alias eme_ebs_atk_states atk_states
  1007.   def atk_states
  1008.     value = eme_ebs_atk_states
  1009.     @sets_atk_states.each{|state| value.push(@sets_atk_states[i]) }
  1010.     return value
  1011.   end
  1012.   
  1013.   alias eme_ebs_atk_states_rate atk_states_rate
  1014.   def atk_states_rate(state_id)
  1015.     value = eme_ebs_atk_states_rate(state_id) + sets_atk_states_rate(state_id) / 100
  1016.     return value
  1017.   end
  1018.   
  1019.   alias eme_ebs_atk_speed atk_speed
  1020.   def atk_speed
  1021.     value = eme_ebs_atk_speed + sets_atk_speed_plus / 100
  1022.     return value
  1023.   end

  1024.   alias eme_ebs_atk_times atk_times_add
  1025.   def atk_times_add
  1026.     value = [eme_ebs_atk_times + sets_atk_times_plus / 100, 0].max
  1027.     return value
  1028.   end

  1029.   alias eme_ebs_dual_wield? dual_wield?
  1030.   def dual_wield?
  1031.     return true if @eme_ebs_two_swords_style
  1032.     eme_ebs_dual_wield?
  1033.   end
  1034.   
  1035.   alias eme_ebs_added_skill_types added_skill_types
  1036.   def added_skill_types
  1037.     value = eme_ebs_added_skill_types
  1038.     @sets_skill_types.each{|sk_type| value.push(sk_type)}
  1039.     @sets_skill_types_remove.each{|sk_type| value.delete(sk_type)}
  1040.     return value
  1041.   end
  1042.   
  1043.   def skill_type_sealed?(stype_id)
  1044.     value = features_set(FEATURE_STYPE_SEAL)
  1045.     @sets_sealed_skill_types.each{|sk_type| value.push(sk_type)}
  1046.     @sets_sealed_skill_types_remove.each{|sk_type| value.delete(sk_type)}
  1047.     return true if value.include?(stype_id)
  1048.   end

  1049.   def skill_sealed?(skill_id)
  1050.     value = features_set(FEATURE_SKILL_SEAL)
  1051.     @sets_sealed_skills.each{|skill| value.push(skill)}
  1052.     @sets_sealed_skills_remove.each{|skill| value.delete(skill)}
  1053.     return true if value.include?(skill_id)
  1054.   end
  1055.   
  1056.   def equip_wtype_ok?(wtype_id)
  1057.     value = features_set(FEATURE_EQUIP_WTYPE)
  1058.     @sets_wtypes.each{|w_type| value.push(w_type)}
  1059.     @sets_removed_wtypes.each{|w_type| value.delete(w_type)}
  1060.     return true if value.include?(wtype_id)
  1061.   end

  1062.   def equip_atype_ok?(atype_id)
  1063.     value = features_set(FEATURE_EQUIP_ATYPE)
  1064.     @sets_atypes.each{|a_type| value.push(a_type)}
  1065.     @sets_removed_atypes.each{|a_type| value.delete(a_type)}
  1066.     return true if value.include?(atype_id)
  1067.   end

  1068.   def equip_type_fixed?(etype_id)
  1069.     value = features_set(FEATURE_EQUIP_FIX)
  1070.     @sets_fixed_equip_types.each{|e_type| value.push(e_type)}
  1071.     @sets_fixed_equip_types_remove.each{|e_type| value.delete(e_type)}
  1072.     return true if value.include?(etype_id)
  1073.   end
  1074.   
  1075.   def equip_type_sealed?(etype_id)
  1076.     value = features_set(FEATURE_EQUIP_SEAL)
  1077.     @sets_sealed_equip_types.each{|e_type| value.push(e_type)}
  1078.     @sets_sealed_equip_types_remove.each{|e_type| value.delete(e_type)}
  1079.     return true if value.include?(etype_id)
  1080.   end
  1081.   
  1082.   alias eme_ees_special_flag special_flag
  1083.   def special_flag(flag_id)
  1084.     return false if @ees_removed_special_flags.include?(flag_id)
  1085.     return @ees_added_special_flags.include?(flag_id) ? true : eme_ees_special_flag(flag_id)
  1086.   end
  1087.   
  1088.   alias eme_ees_party_ability party_ability
  1089.   def party_ability(ability_id)
  1090.     return false if @ees_removed_party_abilities.include?(ability_id)
  1091.     return @ees_added_party_abilities.include?(ability_id) ? true : eme_ees_party_ability(ability_id)
  1092.   end
  1093.   
  1094.   alias eme_ees_max_tp max_tp
  1095.   def max_tp
  1096.     return eme_ees_max_tp + @ees_bonus_max_tp
  1097.   end
  1098.   
  1099.   alias eme_ees_attack_skill attack_skill_id
  1100.   def attack_skill_id
  1101.     return @new_atk_skill unless @new_atk_skill == nil
  1102.     return eme_ees_attack_skill
  1103.   end

  1104.   alias eme_ees_guard_skill guard_skill_id
  1105.   def guard_skill_id
  1106.     return @new_grd_skill unless @new_grd_skill == nil
  1107.     return eme_ees_guard_skill
  1108.   end

  1109. end
复制代码

Lv3.寻梦者 (版主)

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

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

开拓者贵宾

2
发表于 2014-11-16 15:25:15 | 只看该作者
调高 MAX_ELEMENTS 的值。

评分

参与人数 1梦石 +1 收起 理由
VIPArcher + 1 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
75
在线时间
231 小时
注册时间
2014-10-5
帖子
296
3
发表于 2014-11-19 21:27:40 | 只看该作者
求楼主告诉我这个脚本怎么用的,需要怎么设置,我正好需要这个脚本

点评

你们可以私聊,么么哒~  发表于 2014-11-19 23:21
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
352
在线时间
377 小时
注册时间
2013-1-30
帖子
219
4
 楼主| 发表于 2014-11-21 15:30:06 | 只看该作者
RM无节操小分队 发表于 2014-11-19 21:27
求楼主告诉我这个脚本怎么用的,需要怎么设置,我正好需要这个脚本

首先最上面的更新简介就跳过,从150行看起,了解对应的大分类里有哪些子分类,以及子分类各自代表了哪些属性。设定从370行开始改,这里我已经设置了11种套装,其中【0,20】就代表20号武器,【1,3】代表3号防具,你可以全删了自行设定套装。接下来是411行开始,设定套装的功能。这里有几号套装就设几个大分类,小分类中开头的1、2、3、4代表穿戴有该系列套装的1、2、3、4件部件时有哪些加成。当然因为是套装,所以推荐从2件起才开始有加成。至于加成栏的[0, 6, 50]则代表加成150行介绍的0大类第6子分类的属性50点,依次类推

点评

谢谢了,我去自己编辑一下试试  发表于 2014-11-22 19:57
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-15 05:43

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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