Save-Point
Rare Candy Scriptlet - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Material Development (https://www.save-point.org/forum-8.html)
+--- Forum: Scripts Database (https://www.save-point.org/forum-39.html)
+--- Thread: Rare Candy Scriptlet (/thread-288.html)



Rare Candy Scriptlet - kyonides - 04-29-2010

Rare Candy Scriptlet
by Kyonides-Arkanthos

Features

Here you can find 2 versions of the same scriptlet that will allow you to use an item to level up or down your hero at will.

Instructions

Go to the items database and create 1 or 2 new items (just in case you want to add the Anti Rare Candy one, too). Make sure their scopes are equal to One Ally. The rest if up to you. Later copy either one of the scriptlets and testplay your game.

Scriptlets

Rare Candy Only Version

Code:
module MoreEffects
  RARE_CANDY_ID = 33
end

class Game_Battler
  alias kyon_rare_candy_game_battler_item_effect item_effect
  def item_effect(item)
    if item.id == MoreEffects::RARE_CANDY_ID && item.scope == 3 &&
      self.level < 99 && self.hp > 0
      self.level += 1
      return true
    end
    kyon_rare_candy_game_battler_item_effect(item)
  end
end

Rare Candy + Anti Rare Candy Version

Code:
module Effects
  # Rare Candy and Anti-Rare Candy
  CANDIES = [33, 34]
end

class Game_Battler
  alias kyon_anti_rare_candy_game_battler_item_effect item_effect
  def item_effect(item)
    if Effects::CANDIES.include?(item.id) && item.scope == 3 && self.hp > 0
      self.level += 1 if item.id == Effects::CANDIES[0] && self.level < 99
      self.level -= 1 if item.id == Effects::CANDIES[1] && self.level > 1
      return true
    end
    kyon_anti_rare_candy_game_battler_item_effect(item)
  end
end

Author's Notes

Yeah, I know this is an extremely simple scriptlet.