Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin
- Armor Changes Variable v0.5
- by kirinelf
- Requested by: chigoo
- Instructions:
- You can adjust the variable to change by modifying:
- VARIABLE = 1
- Change 1 to the new variable ID.
- Copy and paste the following in the module:
- ARMOR_TYPE_ID[n] = m
- where n is the armor type ID and m is the value to change the variable to.
- For example, ARMOR_TYPE_ID[1] = 1 will make all General Armor change the variable
- to 1.
- =end
- module ARMOR_VARIABLE
- VARIABLE = 1 # Variable to change.
- ARMOR_TYPE_ID = {}
- ARMOR_TYPE_ID[3] = 1 # ARMOR_TYPE_ID[Armor Type ID] = Value to set Variable to.
- ARMOR_TYPE_ID[4] = 2
- #========================================================================
- # Do not edit anything under this line unless you know what you're doing!
- #========================================================================
- end
- class Game_Actor < Game_Battler
- alias armor_change_equip change_equip
- def change_equip(slot_id, item)
- ans = armor_change_equip(slot_id, item)
- update_equip_var if(slot_id == 3)
- return ans # // For whatever reason
- end
- def update_equip_var()
- eq = equips[3]
- $game_variables[ARMOR_VARIABLE::VARIABLE] = eq ? ARMOR_VARIABLE::ARMOR_TYPE_ID[eq.atype_id] : 0
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment