RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Cursed Equipment

0 Members and 1 Guest are viewing this topic.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Cursed Equipment
Version: 1.0
Author: modern algebra
Date: August 23, 2010

Version History


  • <Version 1.0> 08.23.2010 - Original Release

Description


This script allows you to make cursed equipment; equipment that, once equipped, cannot be unequipped from the Equip scene. The only way it can be removed is manually, by an event command or a script call, or through items and skills that are specifically noted to remove curses.

Essentially, it operates like the Fix Equipment Actor Option, but it applies to weapons and armors, rather than by actor, and an actor will not be prevented from unequipping other equipment, only the cursed ones.

Features

  • Allows you to set certain items so that they cannot be unequipped by the player
  • Can still remove cursed equipment manually through event commands or script commands
  • Allows you to create items and skills with a property that will unequip any cursed items on an actor to whom it is applied
  • Would allow you to make, for instance, a special pendant given to a character by a loved one which can never be unequipped.

Instructions

Please see the header of the script for instructions.

Script


Code: [Select]
#==============================================================================
#    Cursed Equipment
#    Version: 1.0
#    Author: modern algebra (rmrk.net)
#    Date: August 23, 2010
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Description:
#
#    This script allows you to make cursed equipment; equipment that, once
#   equipped, cannot be unequipped from the Equip scene. The only way it can be
#   removed is manually, by an event command or a script call, or through items
#   and skills that are specifically noted to remove curses.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Instructions:
#
#    Place the script below the default scripts but above Main in the Script
#   Editor (F11). If you are using any custom scripts that modify equipment,
#   this script should be below them as well.
#
#    The script is easy to use. To specify an equippable item as cursed, put
#   the following code in its note field in the database:
#        \curse
#   Any items with that in their note field will be unremovable by the player.
#
#    To specify an item or skill as being able to remove cursed equipment, set
#   the following code in its notebox:
#        \uncurse
#
#    And that's pretty much it. If you wish to manually remove a particular
#   cursed piece of equipment, you can use the regular event command and it
#   will work. If you want to make an event that removes all cursed equipment
#   from an actor, you can use the following code in a script call:
#        $game_actors[actor_id].unequip_cursed_equips
#==============================================================================

#==============================================================================
# *** RPG
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    modified classes - UsableItem; Weapon; Armor
#==============================================================================

module RPG
  #==========================================================================
  # ** UsableItem
  #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  #  Summary of Changes:
  #    new method - remove_curse?
  #==========================================================================
 
  class UsableItem
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # * Remove Curse?
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    def remove_curse?
      @uncurse = !self.note[/\\UNCURSE/i].nil? if @uncurse.nil?
      return @uncurse
    end
  end
 
  #==========================================================================
  # ** Weapon
  #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  #  Summary of Changes:
  #    new method - cursed?
  #==========================================================================
 
  class Weapon
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # * Cursed?
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    def cursed?
      @cursed = !self.note[/\\CURSE/i].nil? if @cursed.nil?
      return @cursed
    end
  end
 
  #==========================================================================
  # ** Armor
  #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  #  Summary of Changes:
  #    new method - cursed?
  #==========================================================================
 
  class Armor
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # * Cursed?
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    def cursed?
      @cursed = !self.note[/\\CURSE/i].nil? if @cursed.nil?
      return @cursed
    end
  end
end

#==============================================================================
# ** Game_Actor
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased method - skill_effect; skill_test; item_effect; item_test
#    new method - unequip_cursed_equips
#==============================================================================

class Game_Actor
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Stem Test
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias odragb_curseqp_skltst_5tx2 skill_test
  def skill_test (user, skill, *args)
    if skill.remove_curse?
      equips.each { |equip| return true if !equip.nil? && equip.cursed? }
    end
    return odragb_curseqp_skltst_5tx2 (user, skill, *args) # Run Original Method
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Skill Effect
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias mdgebra_curse_sklefct_2df3 skill_effect
  def skill_effect (user, skill, *args)
    unequip_cursed_equips if skill.remove_curse?
    mdgebra_curse_sklefct_2df3 (user, skill, *args) # Run Original Method
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Item Test
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias malgba_crs_itmtst_2bk7 item_test
  def item_test (user, item, *args)
    if item.remove_curse?
      equips.each { |equip| return true if !equip.nil? && equip.cursed? }
    end
    return malgba_crs_itmtst_2bk7 (user, item, *args) # Run Original Method
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Item Effect
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modrnl_cursed_itmefct_9ik1 item_effect
  def item_effect (user, item, *args)
    modrnl_cursed_itmefct_9ik1 (user, item, *args) # Run Original Method
    unequip_cursed_equips if item.remove_curse?
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Unequip Cursed Items
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def unequip_cursed_equips
    for i in 0...equips.size
      change_equip (i, nil, false) if !equips[i].nil? && equips[i].cursed?
    end
  end
end

#==============================================================================
# ** Scene_Equip
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased method - update_equip_selection
#==============================================================================

class Scene_Equip
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Update Equip Region Selection
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias malg_crseqp_updteqpselect_6yj3 update_equip_selection
  def update_equip_selection (*args)
    if Input.trigger? (Input::C) && !@equip_window.item.nil? && @equip_window.item.cursed?
      Sound.play_buzzer
      return
    end
    malg_crseqp_updteqpselect_6yj3 (*args) # Run Original Method
  end
end

Credit


  • modern algebra

Thanks

  • The Mormegil, for the request

Support


Please post in this topic at RMRK for support, no matter how old this topic is. Do not PM me.

Known Compatibility Issues

No known compatibility issues, but it should be pasted below any scripts that substantially modify Scene_Equip and will likely still not work with some.

**
Rep:
Level 82
This is useful! I was wondering about a script like this a while ago.
Current Projects:
* Ars Mechanicum 1: Genesis (RMVX)
* The Gladiator Project (RMXP)

**
Rep: +0/-0Level 73
RMRK Junior
"Please post in this topic at RMRK for support, no matter how old this topic is"

I hope this still applies : P


I desperately need help with this script. Everything works how it´s supposed to work. But sometimes (not too rare or too frequent) an error which kicks me out of the game. But when I reload and to the exact same thing again, there is no error anymore. At least till next time it spontaniously wants to kick me : (
I don´t remember what error EXACTLY but it was definitively an "stack Level is too deep!" Error. Can someone tell me how to fix this? I refuse to give up this script because it´s very very important for my Story X.x

I hope someone can help me!

And if you need more infos about the stack Level error (i honestly don´t know if there are multiple sorts of Stack Level errors) I will write everything down when it happens once more!

mfg
Daedae

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Most Missed Member2014 Zero to Hero2014 Best IRC Quote2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
The most likely possibility is that you have the script in your database twice or you copied and pasted the script within itself. Either that or another script you have refers to this script and keeps going or something. Now, I'm not a scripter, but I'm pretty good at troubleshooting. If problems persist upload the project and see if someone can fix it.
EDIT:
@TDS -  Oh yeah. I forgot that could happen.
« Last Edit: March 13, 2011, 12:43:46 AM by Welfare-Daddy Pacman »
it's like a metaphor or something i don't know

pokeball TDSOffline
***
Rep:
Level 84
-T D S-
Silver - GIAW 11 (Hard)Silver - Game In A Week VII
Or it could be that he's pressing F12 to reset the game while testing, which would explain why the error appears randomly for him.
« Last Edit: March 13, 2011, 12:27:05 AM by TDS »

**
Rep: +0/-0Level 73
RMRK Junior
I don´t remember pressing F12 to restart it. Sure I did this one time or another, but there were moments the error occured even if I didn´t press F12 since starting the game again.

But I will try and goo further with my balancing work and if the Problem persists, I will try to upload it and search for help If I´m allowed to.

Thank you very much for your fast answers!