Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Equipment + Status Buff (RMXP)

I know there is a script like this, but I cant remember where is it and who made it. What I'm looking for is when you equip an MUST BE armor type equipment. It give you a status sharpen and cannot be removed until you take off that armor.
 
Is this for one state only? or do you want different armors to give different kind of states?
And when the armor is removed, is the state automatically removed also, or will it just make it possible again to have the state removed?

Over and out - Gando
 

Haki

Member

Here is the script. Paste it above main:

Code:
class Game_Actor < Game_Battler
  
  ASSIGNED_STATUS = {14 => 13} #assign status id to armor id here
  
    def equip(equip_type, id)
    case equip_type
    when 0 
      if id == 0 or $game_party.weapon_number(id) > 0
        $game_party.gain_weapon(@weapon_id, 1)
        @weapon_id = id
        $game_party.lose_weapon(id, 1)
      end
    when 1 
      if id == 0 or $game_party.armor_number(id) > 0
        update_auto_state($data_armors[@armor1_id], $data_armors[id])
        $game_party.gain_armor(@armor1_id, 1)
        @armor1_id = id
        $game_party.lose_armor(id, 1)
      end
    when 2
      if id == 0 or $game_party.armor_number(id) > 0
        update_auto_state($data_armors[@armor2_id], $data_armors[id])
        $game_party.gain_armor(@armor2_id, 1)
        @armor2_id = id
        $game_party.lose_armor(id, 1)
      end
    when 3 
      if id == 0 or $game_party.armor_number(id) > 0
        update_auto_state($data_armors[@armor3_id], $data_armors[id])
        $game_party.gain_armor(@armor3_id, 1)
      if ASSIGNED_STATUS[id] != nil
        add_state(ASSIGNED_STATUS[id])
      else
        remove_state(ASSIGNED_STATUS[@armor3_id])
      end
        @armor3_id = id
        $game_party.lose_armor(id, 1)

      end
    when 4
      if id == 0 or $game_party.armor_number(id) > 0
        update_auto_state($data_armors[@armor4_id], $data_armors[id])
        $game_party.gain_armor(@armor4_id, 1)
        @armor4_id = id
        $game_party.lose_armor(id, 1)
      end
    end
  end
end

I didn't test it much but it should work.
 
Wonderful!! It works flawlessly except one thing that may be noted.

Code:
  ASSIGNED_STATUS = {14 => 13} #assign status id to armor id here

That makes it seem as if the first integer is for status id and the second is for amor id when its actually the other way around but a great addition thanks i'll be sure to credit you!
 
HOLY CRAP I'M HELPING WITH A SCRIPT REQUEST D:
And as with all my help, though this is the first time in a script request, it is not perfect :(

You can add more armor/states as such:
Code:
  ASSIGNED_STATUS = {14 => 13, 15 => 16} #assign status id to armor id here
What that will do, assuming that you did not change the default settings of the database, is if you equip Steel Armor you gain the state Blink, and if you equip Iron Armor you gain the state Sharp.

Unfortunately with what I did, you for whatever reason I couldn't find, one of two things will happen.  Either you will be able to de/equip the armors on and off and eventually Blink will become permanent even when the Steel Armor is not equipped, or the Iron Armor will stop giving you the Sharp state (although in this 2nd case the Steel Armor still gave Blink when it should, and the state was removed with the armor).

These two occurrences I observed, however I had to play a bit to get either one to happen.  It might not happen with you - my computer does occasionally do very odd things (including making all color selections in MSPaint turn red randomly).
 

Haki

Member

Here is the updated script. You can now have weapons, helmets, shields and accessories which inflict a permanent status. If you find a bug please tell me.

Code:
class Game_Actor < Game_Battler
  
  ASSIGNED_STATUS = {11 => 3, 5 => 17} #Chest Armor => Status
  ASSIGNED_STATUS2 = {23 => 3} #Weapon_ID => Status_ID
  ASSIGNED_STATUS3 = {8 => 3} #Shield_ID => Status_ID
  ASSIGNED_STATUS4 = {10 => 3} #Helmet_ID => Status_ID
  ASSIGNED_STATUS5 = {9 => 3} #Accesory_ID => Status_ID
  
    def equip(equip_type, id)
    case equip_type
    when 0 
      if id == 0 or $game_party.weapon_number(id) > 0
        $game_party.gain_weapon(@weapon_id, 1)
      if ASSIGNED_STATUS2[id] != nil
        add_state(ASSIGNED_STATUS2[id])
      elsif ASSIGNED_STATUS2[@weapon_id] != ASSIGNED_STATUS5[@armor4_id] and ASSIGNED_STATUS2[@weapon_id] != ASSIGNED_STATUS3[@armor1_id] and ASSIGNED_STATUS2[@weapon_id] != ASSIGNED_STATUS4[@armor2_id] and ASSIGNED_STATUS2[@weapon_id] != ASSIGNED_STATUS[@armor3_id]
        remove_state(ASSIGNED_STATUS[@weapon_id])
      end
  @weapon_id = id
        $game_party.lose_weapon(id, 1)
      end
    when 1 
      if id == 0 or $game_party.armor_number(id) > 0
        update_auto_state($data_armors[@armor1_id], $data_armors[id])
        $game_party.gain_armor(@armor1_id, 1)
      if ASSIGNED_STATUS3[id] != nil
        add_state(ASSIGNED_STATUS3[id])
      elsif ASSIGNED_STATUS3[@armor1_id] != ASSIGNED_STATUS5[@armor4_id] and ASSIGNED_STATUS3[@armor1_id] != ASSIGNED_STATUS2[@weapon_id] and ASSIGNED_STATUS3[@armor1_id] != ASSIGNED_STATUS4[@armor2_id] and ASSIGNED_STATUS3[@armor1_id] != ASSIGNED_STATUS[@armor3_id] 
        remove_state(ASSIGNED_STATUS3[@armor1_id])
      end
        @armor1_id = id
        $game_party.lose_armor(id, 1)
      end
    when 2
      if id == 0 or $game_party.armor_number(id) > 0
        update_auto_state($data_armors[@armor2_id], $data_armors[id])
        $game_party.gain_armor(@armor2_id, 1)
      if ASSIGNED_STATUS4[id] != nil
        add_state(ASSIGNED_STATUS4[id])
      elsif ASSIGNED_STATUS4[@armor2_id] != ASSIGNED_STATUS5[@armor4_id] and ASSIGNED_STATUS4[@armor2_id] != ASSIGNED_STATUS3[@armor1_id] and ASSIGNED_STATUS4[@armor2_id] != ASSIGNED_STATUS2[@weapon_id] and ASSIGNED_STATUS4[@armor2_id] != ASSIGNED_STATUS[@armor3_id]
        remove_state(ASSIGNED_STATUS4[@armor2_id])
      end
        @armor2_id = id
        $game_party.lose_armor(id, 1)
      end
    when 3 
      if id == 0 or $game_party.armor_number(id) > 0
        update_auto_state($data_armors[@armor3_id], $data_armors[id])
        $game_party.gain_armor(@armor3_id, 1)
      if ASSIGNED_STATUS[id] != nil
        add_state(ASSIGNED_STATUS[id])
      elsif ASSIGNED_STATUS[@armor3_id] != ASSIGNED_STATUS5[@armor4_id] and ASSIGNED_STATUS[@armor3_id] != ASSIGNED_STATUS3[@armor1_id] and ASSIGNED_STATUS[@armor3_id] != ASSIGNED_STATUS4[@armor2_id] and ASSIGNED_STATUS[@armor3_id] != ASSIGNED_STATUS2[@weapon_id]
        remove_state(ASSIGNED_STATUS[@armor3_id])
      end
        @armor3_id = id
        $game_party.lose_armor(id, 1)
      end
    when 4
      if id == 0 or $game_party.armor_number(id) > 0
        update_auto_state($data_armors[@armor4_id], $data_armors[id])
        $game_party.gain_armor(@armor4_id, 1)
      if ASSIGNED_STATUS5[id] != nil
        add_state(ASSIGNED_STATUS5[id])
      elsif ASSIGNED_STATUS5[@armor4_id] != ASSIGNED_STATUS3[@armor1_id] and ASSIGNED_STATUS5[@armor4_id] != ASSIGNED_STATUS2[@weapon_id] and ASSIGNED_STATUS5[@armor4_id] != ASSIGNED_STATUS4[@armor2_id] and ASSIGNED_STATUS5[@armor4_id] != ASSIGNED_STATUS[@armor3_id] 
        remove_state(ASSIGNED_STATUS5[@armor4_id])
      end
        @armor4_id = id
        $game_party.lose_armor(id, 1)
      end
    end
  end
end
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top