Falcao mana stones with Diablo 2 runes

Would there be anyway to change this script:

So that it could function (while still retaining its core features) like rune words in Diablo 2.
The basic premise is that you would add runes in the correct to order to form a word and that would drastically change the weapons properties.
This thread was moved from RGSS3 Scripts (RMVX Ace) to RGSS3 Script Requests.
Would there be anyway to change this script:

So that it could function (while still retaining its core features) like rune words in Diablo 2.
The basic premise is that you would add runes in the correct to order to form a word and that would drastically change the weapons properties.
Removed for changes
Looks great! Quick question, would there be a way to add a name to the item:
Example. Long sword but then adding three runes in combo adds the name “knight’s valor”.
Also can you add other parameters such as critical/ exp gain, etc
Looks great! Quick question, would there be a way to add a name to the item:
Example. Long sword but then adding three runes in combo adds the name “knight’s valor”.
Also can you add other parameters such as critical/ exp gain, etc
That will require a bit more work as there is no default add_param for xparam or sparam.
I updated the code above as I realized a critical mistake.
Except for your additions it should work normally now.
But since you want xparams and sparams does that also mean you need them to be part of the normal script where you can specify them in the note tags on the item?
That would be a 50% rewrite of the script functionality.
If you asked for that the first time, I might have already have it done.
You'll have to wait.
That will require a bit more work as there is no default add_param for xparam or sparam.
I updated the code above as I realized a critical mistake.
Except for your additions it should work normally now.
But since you want xparams and sparams does that also mean you need them to be part of the normal script where you can specify them in the note tags on the item?
That would be a 50% rewrite of the script functionality.
If you asked for that the first time, I might have already have it done.
You'll have to wait.
I appreciate the hard work. Sorry,’in my initial request I should have specified more regarding params and xparams and new name
I appreciate the hard work. Sorry,’in my initial request I should have specified more regarding params and xparams and new name
I think this should work. I was able to copy some code from a previous script I did.
I haven't tested the extra parameters.

In the post above you replied to my post which put my old code in there. Can you remove that please.

Spoiler: Falcao Mana Stones Extension
Ruby:
# ╔═══════════════════════════════════════════════╦════════════════════╗
# ║ Title: Falcao Mana Stone Extension            ║  Version: 1.01     ║
# ║ Author: Roninator2                            ║                    ║
# ╠═══════════════════════════════════════════════╬════════════════════╣
# ║ Function:                                     ║   Date Created     ║
# ║                                               ╠════════════════════╣
# ║   Add Mana Stone Combination features         ║    16 Jun 2024     ║
# ╚═══════════════════════════════════════════════╩════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Requires: Falcao Mana Stones                                       ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Brief Description:                                                 ║
# ║    Gives the option to add more bonuses when stones and added      ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Instructions:                                                      ║
# ║   When stones are added in a particular order, bonus features      ║
# ║   are added to the item.                                           ║
# ║                                                                    ║
# ║   Fill out the combo's to be used in the FalMana Stone area below  ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Updates:                                                           ║
# ║ 1.00 - 16 Nov 2024 - Script finished                               ║
# ║ 1.01 - 17 Nov 2024 - Converted to Item features not actor          ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Credits and Thanks:                                                ║
# ║   Roninator2                                                       ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Terms of use:                                                      ║
# ║  Follow the original Authors terms of use where applicable         ║
# ║    - When not made by me (Roninator2)                              ║
# ║  Free for all uses in RPG Maker except nudity                      ║
# ║  Anyone using this script in their project before these terms      ║
# ║  were changed are allowed to use this script even if it conflicts  ║
# ║  with these new terms. New terms effective 03 Apr 2024             ║
# ║  No part of this code can be used with AI programs or tools        ║
# ║  Credit must be given                                              ║
# ╚════════════════════════════════════════════════════════════════════╝

module FalMana

  STONE_COMBO = { # add your combos here
                  # [item id's, ...] => [:param, value]
                 [17,17] => [:mhp, 50],
                 [18,18] => [:mmp, 20],
                 [17,18] => [:atk, 5],
                 [19,20] => [:def, 5],
                 [19,20,21] => [:def, 50],
                }
  COMBO_NAMES = {
                 [17,17] => " of Knight's Valor",
                 [18,18] => " of two",
                 [17,18] => " of three",
                 [19,20] => " of four",
                 [19,20,21] => " of five",
                }
end
             
# ╔════════════════════════════════════════════════════════════════════╗
# ║                      End of editable region                        ║
# ╚════════════════════════════════════════════════════════════════════╝

module FalMana

  def self.socket_manastone(item, index, value, actor)
    item.manaslots[index] = value
    actor.add_param(value.manastone_param[0], value.manastone_param[1])
    stone_combo(item, :add)
    name_combo(item)
  end
 
  def self.remove_manastone(item, index, value, actor)
    stone_combo(item, :remove)
    item.manaslots[index] = nil
    actor.add_param(value.manastone_param[0], - value.manastone_param[1])
    name_combo(item)
  end
 
  def self.clear_manastones(item, actor)
    stone_combo(item, :clear)
    item.manaslots.each {|m| actor.add_param(m.manastone_param[0],
    - m.manastone_param[1]) unless m.nil?}
    item.manaslots.size.times {|i| item.manaslots[i] = nil}
    name_combo(item)
  end
 
  def self.stone_combo(item, process)
    return if item.nil?
    return if item.manaslots.nil?
    combo = FalMana::STONE_COMBO
    if @cb_on.nil?
      @cb_on = {}
      combo.each do |a|
        @cb_on[a[0]] = false
      end
    end
    item.name = item.original_name
    combo.each_with_index { |c,i|
      s = c[0].size
      cb = false
      item.manaslots.each_with_index { |mi,j|
        next if j == 0
        k = -1
        dv = []
        s.times do
          dv[j+k] = item.manaslots[j+k].nil? ? nil : item.manaslots[j+k].id
          k += 1
        end
        dv.compact!
        if c[0] == dv
          @cb_on.each do |cba|
            p = c[1][0]
            v = c[1][1]
            adjust_param(p, v, item, process, cba) if cba[0] == dv
          end
        end
      }
    }
  end
  def self.name_combo(item)
    return if item.nil?
    return if item.manaslots.nil?
    combo = FalMana::STONE_COMBO
    combo.each_with_index { |c,i|
      s = c[0].size
      item.manaslots.each_with_index { |mi,j|
        next if j == 0
        k = -1
        dv = []
        s.times do
          dv[j+k] = item.manaslots[j+k].nil? ? nil : item.manaslots[j+k].id
          k += 1
        end
        dv.compact!
        if c[0] == dv
          add_name = FalMana::COMBO_NAMES[dv]
          item.name = item.name + add_name if add_name != nil
        end
      }
    }
  end
 
  def self.adjust_param(param, value, item, option, cba)
    case option
    when :add
      case param
      when :tgr, :grd, :rec, :pha, :mcr, :tcr, :pdr, :mdr, :fdr, :exr
        list = [:tgr, :grd, :rec, :pha, :mcr, :tcr, :pdr, :mdr, :fdr, :exr]
        list.each_with_index do |st, j|
          if param == st
            value = value.to_f / 100 + 1
            item.features.push(RPG::BaseItem::Feature.new(23, j, value))
          end
        end
      when :hit, :eva, :cri, :cev, :mev, :mrf, :cnt, :hrg, :mrg, :trg
        list = [:hit, :eva, :cri, :cev, :mev, :mrf, :cnt, :hrg, :mrg, :trg]
        list.each_with_index do |st, j|
          if param == st
            value = value.to_f / 100
            item.features.push(RPG::BaseItem::Feature.new(22, id, value))
          end
        end
      when :mhp, :mmp, :atk, :def, :mat, :mdf, :agi, :luk
        list = [:mhp, :mmp, :atk, :def, :mat, :mdf, :agi, :luk]
        list.each_with_index do |st, j|
          if param == st
            item.params[j] += value
          end
        end
      end
      @cb_on[cba[0]] = true
    when :remove
      case param
      when :tgr, :grd, :rec, :pha, :mcr, :tcr, :pdr, :mdr, :fdr, :exr
        list = [:tgr, :grd, :rec, :pha, :mcr, :tcr, :pdr, :mdr, :fdr, :exr]
        list.each_with_index do |st, j|
          if param == st
            value = value.to_f / 100 + 1
            ft = RPG::BaseItem::Feature.new(23, j, value)
            item.features.each do |rft|
              rft.delete if rft == ft
            end
            item.features.compact!
          end
        end
      when :hit, :eva, :cri, :cev, :mev, :mrf, :cnt, :hrg, :mrg, :trg
        list = [:hit, :eva, :cri, :cev, :mev, :mrf, :cnt, :hrg, :mrg, :trg]
        list.each_with_index do |st, j|
          if param == st
            value = value.to_f / 100
            ft = RPG::BaseItem::Feature.new(22, j, value)
            item.features.each do |rft|
              rft.delete if rft == ft
            end
            item.features.compact!
          end
        end
      when :mhp, :mmp, :atk, :def, :mat, :mdf, :agi, :luk
        list = [:mhp, :mmp, :atk, :def, :mat, :mdf, :agi, :luk]
        list.each_with_index do |st, j|
          if param == st
            item.params[j] -= value
          end
        end
      end
      @cb_on[cba[0]] = false
    when :clear
      case param
      when :tgr, :grd, :rec, :pha, :mcr, :tcr, :pdr, :mdr, :fdr, :exr
        list = [:tgr, :grd, :rec, :pha, :mcr, :tcr, :pdr, :mdr, :fdr, :exr]
        list.each_with_index do |st, j|
          if param == st
            value = value.to_f / 100 + 1
            ft = RPG::BaseItem::Feature.new(23, j, value)
            item.features.each do |rft|
              rft.delete if rft == ft
            end
            item.features.compact!
          end
        end
      when :hit, :eva, :cri, :cev, :mev, :mrf, :cnt, :hrg, :mrg, :trg
        list = [:hit, :eva, :cri, :cev, :mev, :mrf, :cnt, :hrg, :mrg, :trg]
        list.each_with_index do |st, j|
          if param == st
            value = value.to_f / 100
            ft = RPG::BaseItem::Feature.new(22, j, value)
            item.features.each do |rft|
              rft.delete if rft == ft
            end
            item.features.compact!
          end
        end
      when :mhp, :mmp, :atk, :def, :mat, :mdf, :agi, :luk
        list = [:mhp, :mmp, :atk, :def, :mat, :mdf, :agi, :luk]
        list.each_with_index do |st, j|
          if param == st
            item.params[j] -= value
          end
        end
      end
      @cb_on[cba[0]] = false
    end
  end
 
end

module DataManager
  class <<self
    alias load_database_original_r2_equip_name load_database
  end
  def self.load_database
    load_database_original_r2_equip_name
    load_original_r2_equip_name
  end
  def self.load_original_r2_equip_name
    groups = [$data_weapons, $data_armors]
    for group in groups
      for obj in group
        next if obj.nil?
        obj.load_original_r2_equip_name
      end
    end
  end
end

class RPG::EquipItem
  attr_accessor :original_name
  def load_original_r2_equip_name
    @original_name = self.name
  end
end

class Game_Actor < Game_Battler
  def change_equip(slot_id, item)
    FalMana.stone_combo(@equips[slot_id].object, :clear)
    FalMana.add_param(self, @equips[slot_id].object, true)
    FalMana.add_param(self, item)
    falcaomanastones_change(slot_id, item)
    FalMana.stone_combo(item, :add)
  end
end
Looks good, thanks! I will have to experiment with ex-param, etc and see how values correlate with them
I think this should work. I was able to copy some code from a previous script I did.
I haven't tested the extra parameters.

In the post above you replied to my post which put my old code in there. Can you remove that please.

Spoiler: Falcao Mana Stones Extension
Ruby:
# ╔═══════════════════════════════════════════════╦════════════════════╗
# ║ Title: Falcao Mana Stone Extension            ║  Version: 1.01     ║
# ║ Author: Roninator2                            ║                    ║
# ╠═══════════════════════════════════════════════╬════════════════════╣
# ║ Function:                                     ║   Date Created     ║
# ║                                               ╠════════════════════╣
# ║   Add Mana Stone Combination features         ║    16 Jun 2024     ║
# ╚═══════════════════════════════════════════════╩════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Requires: Falcao Mana Stones                                       ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Brief Description:                                                 ║
# ║    Gives the option to add more bonuses when stones and added      ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Instructions:                                                      ║
# ║   When stones are added in a particular order, bonus features      ║
# ║   are added to the item.                                           ║
# ║                                                                    ║
# ║   Fill out the combo's to be used in the FalMana Stone area below  ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Updates:                                                           ║
# ║ 1.00 - 16 Nov 2024 - Script finished                               ║
# ║ 1.01 - 17 Nov 2024 - Converted to Item features not actor          ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Credits and Thanks:                                                ║
# ║   Roninator2                                                       ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Terms of use:                                                      ║
# ║  Follow the original Authors terms of use where applicable         ║
# ║    - When not made by me (Roninator2)                              ║
# ║  Free for all uses in RPG Maker except nudity                      ║
# ║  Anyone using this script in their project before these terms      ║
# ║  were changed are allowed to use this script even if it conflicts  ║
# ║  with these new terms. New terms effective 03 Apr 2024             ║
# ║  No part of this code can be used with AI programs or tools        ║
# ║  Credit must be given                                              ║
# ╚════════════════════════════════════════════════════════════════════╝

module FalMana

  STONE_COMBO = { # add your combos here
                  # [item id's, ...] => [:param, value]
                 [17,17] => [:mhp, 50],
                 [18,18] => [:mmp, 20],
                 [17,18] => [:atk, 5],
                 [19,20] => [:def, 5],
                 [19,20,21] => [:def, 50],
                }
  COMBO_NAMES = {
                 [17,17] => " of Knight's Valor",
                 [18,18] => " of two",
                 [17,18] => " of three",
                 [19,20] => " of four",
                 [19,20,21] => " of five",
                }
end
            
# ╔════════════════════════════════════════════════════════════════════╗
# ║                      End of editable region                        ║
# ╚════════════════════════════════════════════════════════════════════╝

module FalMana

  def self.socket_manastone(item, index, value, actor)
    item.manaslots[index] = value
    actor.add_param(value.manastone_param[0], value.manastone_param[1])
    stone_combo(item, :add)
    name_combo(item)
  end
 
  def self.remove_manastone(item, index, value, actor)
    stone_combo(item, :remove)
    item.manaslots[index] = nil
    actor.add_param(value.manastone_param[0], - value.manastone_param[1])
    name_combo(item)
  end
 
  def self.clear_manastones(item, actor)
    stone_combo(item, :clear)
    item.manaslots.each {|m| actor.add_param(m.manastone_param[0],
    - m.manastone_param[1]) unless m.nil?}
    item.manaslots.size.times {|i| item.manaslots[i] = nil}
    name_combo(item)
  end
 
  def self.stone_combo(item, process)
    return if item.nil?
    return if item.manaslots.nil?
    combo = FalMana::STONE_COMBO
    if @cb_on.nil?
      @cb_on = {}
      combo.each do |a|
        @cb_on[a[0]] = false
      end
    end
    item.name = item.original_name
    combo.each_with_index { |c,i|
      s = c[0].size
      cb = false
      item.manaslots.each_with_index { |mi,j|
        next if j == 0
        k = -1
        dv = []
        s.times do
          dv[j+k] = item.manaslots[j+k].nil? ? nil : item.manaslots[j+k].id
          k += 1
        end
        dv.compact!
        if c[0] == dv
          @cb_on.each do |cba|
            p = c[1][0]
            v = c[1][1]
            adjust_param(p, v, item, process, cba) if cba[0] == dv
          end
        end
      }
    }
  end
  def self.name_combo(item)
    return if item.nil?
    return if item.manaslots.nil?
    combo = FalMana::STONE_COMBO
    combo.each_with_index { |c,i|
      s = c[0].size
      item.manaslots.each_with_index { |mi,j|
        next if j == 0
        k = -1
        dv = []
        s.times do
          dv[j+k] = item.manaslots[j+k].nil? ? nil : item.manaslots[j+k].id
          k += 1
        end
        dv.compact!
        if c[0] == dv
          add_name = FalMana::COMBO_NAMES[dv]
          item.name = item.name + add_name if add_name != nil
        end
      }
    }
  end
 
  def self.adjust_param(param, value, item, option, cba)
    case option
    when :add
      case param
      when :tgr, :grd, :rec, :pha, :mcr, :tcr, :pdr, :mdr, :fdr, :exr
        list = [:tgr, :grd, :rec, :pha, :mcr, :tcr, :pdr, :mdr, :fdr, :exr]
        list.each_with_index do |st, j|
          if param == st
            value = value.to_f / 100 + 1
            item.features.push(RPG::BaseItem::Feature.new(23, j, value))
          end
        end
      when :hit, :eva, :cri, :cev, :mev, :mrf, :cnt, :hrg, :mrg, :trg
        list = [:hit, :eva, :cri, :cev, :mev, :mrf, :cnt, :hrg, :mrg, :trg]
        list.each_with_index do |st, j|
          if param == st
            value = value.to_f / 100
            item.features.push(RPG::BaseItem::Feature.new(22, id, value))
          end
        end
      when :mhp, :mmp, :atk, :def, :mat, :mdf, :agi, :luk
        list = [:mhp, :mmp, :atk, :def, :mat, :mdf, :agi, :luk]
        list.each_with_index do |st, j|
          if param == st
            item.params[j] += value
          end
        end
      end
      @cb_on[cba[0]] = true
    when :remove
      case param
      when :tgr, :grd, :rec, :pha, :mcr, :tcr, :pdr, :mdr, :fdr, :exr
        list = [:tgr, :grd, :rec, :pha, :mcr, :tcr, :pdr, :mdr, :fdr, :exr]
        list.each_with_index do |st, j|
          if param == st
            value = value.to_f / 100 + 1
            ft = RPG::BaseItem::Feature.new(23, j, value)
            item.features.each do |rft|
              rft.delete if rft == ft
            end
            item.features.compact!
          end
        end
      when :hit, :eva, :cri, :cev, :mev, :mrf, :cnt, :hrg, :mrg, :trg
        list = [:hit, :eva, :cri, :cev, :mev, :mrf, :cnt, :hrg, :mrg, :trg]
        list.each_with_index do |st, j|
          if param == st
            value = value.to_f / 100
            ft = RPG::BaseItem::Feature.new(22, j, value)
            item.features.each do |rft|
              rft.delete if rft == ft
            end
            item.features.compact!
          end
        end
      when :mhp, :mmp, :atk, :def, :mat, :mdf, :agi, :luk
        list = [:mhp, :mmp, :atk, :def, :mat, :mdf, :agi, :luk]
        list.each_with_index do |st, j|
          if param == st
            item.params[j] -= value
          end
        end
      end
      @cb_on[cba[0]] = false
    when :clear
      case param
      when :tgr, :grd, :rec, :pha, :mcr, :tcr, :pdr, :mdr, :fdr, :exr
        list = [:tgr, :grd, :rec, :pha, :mcr, :tcr, :pdr, :mdr, :fdr, :exr]
        list.each_with_index do |st, j|
          if param == st
            value = value.to_f / 100 + 1
            ft = RPG::BaseItem::Feature.new(23, j, value)
            item.features.each do |rft|
              rft.delete if rft == ft
            end
            item.features.compact!
          end
        end
      when :hit, :eva, :cri, :cev, :mev, :mrf, :cnt, :hrg, :mrg, :trg
        list = [:hit, :eva, :cri, :cev, :mev, :mrf, :cnt, :hrg, :mrg, :trg]
        list.each_with_index do |st, j|
          if param == st
            value = value.to_f / 100
            ft = RPG::BaseItem::Feature.new(22, j, value)
            item.features.each do |rft|
              rft.delete if rft == ft
            end
            item.features.compact!
          end
        end
      when :mhp, :mmp, :atk, :def, :mat, :mdf, :agi, :luk
        list = [:mhp, :mmp, :atk, :def, :mat, :mdf, :agi, :luk]
        list.each_with_index do |st, j|
          if param == st
            item.params[j] -= value
          end
        end
      end
      @cb_on[cba[0]] = false
    end
  end
 
end

module DataManager
  class <<self
    alias load_database_original_r2_equip_name load_database
  end
  def self.load_database
    load_database_original_r2_equip_name
    load_original_r2_equip_name
  end
  def self.load_original_r2_equip_name
    groups = [$data_weapons, $data_armors]
    for group in groups
      for obj in group
        next if obj.nil?
        obj.load_original_r2_equip_name
      end
    end
  end
end

class RPG::EquipItem
  attr_accessor :original_name
  def load_original_r2_equip_name
    @original_name = self.name
  end
end

class Game_Actor < Game_Battler
  def change_equip(slot_id, item)
    FalMana.stone_combo(@equips[slot_id].object, :clear)
    FalMana.add_param(self, @equips[slot_id].object, true)
    FalMana.add_param(self, item)
    falcaomanastones_change(slot_id, item)
    FalMana.stone_combo(item, :add)
  end
end
I wonder if I could make it so that the rune word would also enable a skill/ aura passive. I’ll try tonight with the rune itself calling a common event
I wonder if I could make it so that the rune word would also enable a skill/ aura passive. I’ll try tonight with the rune itself calling a common event
If the word is applied then apply a state?
I guess that's possible. It would be up to you to make the state passive or whatever.
Have to change the second hash table to be an array not a string.
Spoiler: Falcao Mana Stones Extension 1.02
Ruby:
# ╔═══════════════════════════════════════════════╦════════════════════╗
# ║ Title: Falco Mana Stone Extension             ║  Version: 1.02     ║
# ║ Author: Roninator2                            ║                    ║
# ╠═══════════════════════════════════════════════╬════════════════════╣
# ║ Function:                                     ║   Date Created     ║
# ║                                               ╠════════════════════╣
# ║   Add Mana Stone Combination features         ║    16 Jun 2024     ║
# ╚═══════════════════════════════════════════════╩════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Requires: Falco Mana Stones                                        ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Brief Description:                                                 ║
# ║    Gives the option to add more bonuses when stones and added      ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Instructions:                                                      ║
# ║   When stones are added in a particular order, bonus features      ║
# ║   are added to the item.                                           ║
# ║                                                                    ║
# ║   Fill out the combo's to be used in the FalMana Stone area below  ║
# ║                                                                    ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Updates:                                                           ║
# ║ 1.00 - 16 Nov 2024 - Script finished                               ║
# ║ 1.01 - 17 Nov 2024 - Converted to Item features not actor          ║
# ║ 1.02 - 19 Nov 2024 - Added - adding states with names              ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Credits and Thanks:                                                ║
# ║   Roninator2                                                       ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Terms of use:                                                      ║
# ║  Follow the original Authors terms of use where applicable         ║
# ║    - When not made by me (Roninator2)                              ║
# ║  Free for all uses in RPG Maker except nudity                      ║
# ║  Anyone using this script in their project before these terms      ║
# ║  were changed are allowed to use this script even if it conflicts  ║
# ║  with these new terms. New terms effective 03 Apr 2024             ║
# ║  No part of this code can be used with AI programs or tools        ║
# ║  Credit must be given                                              ║
# ╚════════════════════════════════════════════════════════════════════╝

module FalMana

  STONE_COMBO = { # add your combos here
                  # [item id's, ...] => [:param, value]
                  # if you change this mid game you will have to start over
                 [17,17] => [:mhp, 50],
                 [18,18] => [:mmp, 20],
                 [17,18] => [:atk, 5],
                 [19,20] => [:def, 5],
                 [19,20,21] => [:def, 50],
                }
  COMBO_NAMES = {
                  # [item id's, ...] => ["text string", state id to apply]
                 [17,17] => [" of Knight's Valor", 4],
                 [18,18] => [" of two", 0],
                 [17,18] => [" of three", 0],
                 [19,20] => [" of four", 0],
                 [19,20,21] => [" of five", 0],
                }
end
            
# ╔════════════════════════════════════════════════════════════════════╗
# ║                      End of editable region                        ║
# ╚════════════════════════════════════════════════════════════════════╝

module FalMana

  def self.socket_manastone(item, index, value, actor)
    item.manaslots[index] = value
    actor.add_param(value.manastone_param[0], value.manastone_param[1])
    stone_combo(item, :add)
    name_combo(item, actor)
  end
 
  def self.remove_manastone(item, index, value, actor)
    stone_combo(item, :remove)
    item.manaslots[index] = nil
    actor.add_param(value.manastone_param[0], - value.manastone_param[1])
    name_combo(item, actor)
  end
 
  def self.clear_manastones(item, actor)
    stone_combo(item, :clear)
    item.manaslots.each {|m| actor.add_param(m.manastone_param[0],
    - m.manastone_param[1]) unless m.nil?}
    item.manaslots.size.times {|i| item.manaslots[i] = nil}
    name_combo(item, actor)
  end
 
  def self.stone_combo(item, process)
    return if item.nil?
    return if item.manaslots.nil?
    combo = FalMana::STONE_COMBO
    if @cb_on.nil?
      @cb_on = {}
      combo.each do |a|
        @cb_on[a[0]] = false
      end
    end
    item.name = item.original_name
    combo.each_with_index { |c,i|
      s = c[0].size
      cb = false
      item.manaslots.each_with_index { |mi,j|
        next if j == 0
        k = -1
        dv = []
        s.times do
          dv[j+k] = item.manaslots[j+k].nil? ? nil : item.manaslots[j+k].id
          k += 1
        end
        dv.compact!
        if c[0] == dv
          @cb_on.each do |cba|
            p = c[1][0]
            v = c[1][1]
            adjust_param(p, v, item, process, cba) if cba[0] == dv
          end
        end
      }
    }
  end
  def self.name_combo(item, actor)
    return if item.nil?
    return if item.manaslots.nil?
    combo = FalMana::STONE_COMBO
    combo.each_with_index { |c,i|
      s = c[0].size
      item.manaslots.each_with_index { |mi,j|
        next if j == 0
        k = -1
        dv = []
        s.times do
          dv[j+k] = item.manaslots[j+k].nil? ? nil : item.manaslots[j+k].id
          k += 1
        end
        dv.compact!
        if c[0] == dv
          add_name = FalMana::COMBO_NAMES[dv][0]
          item.name = item.name + add_name if add_name != nil
          actor.add_state(FalMana::COMBO_NAMES[dv][1]) if FalMana::COMBO_NAMES[dv][1] > 0
        end
      }
    }
  end
 
  def self.adjust_param(param, value, item, option, cba)
    case option
    when :add
      case param
      when :tgr, :grd, :rec, :pha, :mcr, :tcr, :pdr, :mdr, :fdr, :exr
        list = [:tgr, :grd, :rec, :pha, :mcr, :tcr, :pdr, :mdr, :fdr, :exr]
        list.each_with_index do |st, j|
          if param == st
            value = value.to_f / 100 + 1
            item.features.push(RPG::BaseItem::Feature.new(23, j, value))
          end
        end
      when :hit, :eva, :cri, :cev, :mev, :mrf, :cnt, :hrg, :mrg, :trg
        list = [:hit, :eva, :cri, :cev, :mev, :mrf, :cnt, :hrg, :mrg, :trg]
        list.each_with_index do |st, j|
          if param == st
            value = value.to_f / 100
            item.features.push(RPG::BaseItem::Feature.new(22, id, value))
          end
        end
      when :mhp, :mmp, :atk, :def, :mat, :mdf, :agi, :luk
        list = [:mhp, :mmp, :atk, :def, :mat, :mdf, :agi, :luk]
        list.each_with_index do |st, j|
          if param == st
            item.params[j] += value
          end
        end
      end
      @cb_on[cba[0]] = true
    when :remove
      case param
      when :tgr, :grd, :rec, :pha, :mcr, :tcr, :pdr, :mdr, :fdr, :exr
        list = [:tgr, :grd, :rec, :pha, :mcr, :tcr, :pdr, :mdr, :fdr, :exr]
        list.each_with_index do |st, j|
          if param == st
            value = value.to_f / 100 + 1
            ft = RPG::BaseItem::Feature.new(23, j, value)
            item.features.each do |rft|
              rft.delete if rft == ft
            end
            item.features.compact!
          end
        end
      when :hit, :eva, :cri, :cev, :mev, :mrf, :cnt, :hrg, :mrg, :trg
        list = [:hit, :eva, :cri, :cev, :mev, :mrf, :cnt, :hrg, :mrg, :trg]
        list.each_with_index do |st, j|
          if param == st
            value = value.to_f / 100
            ft = RPG::BaseItem::Feature.new(22, j, value)
            item.features.each do |rft|
              rft.delete if rft == ft
            end
            item.features.compact!
          end
        end
      when :mhp, :mmp, :atk, :def, :mat, :mdf, :agi, :luk
        list = [:mhp, :mmp, :atk, :def, :mat, :mdf, :agi, :luk]
        list.each_with_index do |st, j|
          if param == st
            item.params[j] -= value
          end
        end
      end
      @cb_on[cba[0]] = false
    when :clear
      case param
      when :tgr, :grd, :rec, :pha, :mcr, :tcr, :pdr, :mdr, :fdr, :exr
        list = [:tgr, :grd, :rec, :pha, :mcr, :tcr, :pdr, :mdr, :fdr, :exr]
        list.each_with_index do |st, j|
          if param == st
            value = value.to_f / 100 + 1
            ft = RPG::BaseItem::Feature.new(23, j, value)
            item.features.each do |rft|
              rft.delete if rft == ft
            end
            item.features.compact!
          end
        end
      when :hit, :eva, :cri, :cev, :mev, :mrf, :cnt, :hrg, :mrg, :trg
        list = [:hit, :eva, :cri, :cev, :mev, :mrf, :cnt, :hrg, :mrg, :trg]
        list.each_with_index do |st, j|
          if param == st
            value = value.to_f / 100
            ft = RPG::BaseItem::Feature.new(22, j, value)
            item.features.each do |rft|
              rft.delete if rft == ft
            end
            item.features.compact!
          end
        end
      when :mhp, :mmp, :atk, :def, :mat, :mdf, :agi, :luk
        list = [:mhp, :mmp, :atk, :def, :mat, :mdf, :agi, :luk]
        list.each_with_index do |st, j|
          if param == st
            item.params[j] -= value
          end
        end
      end
      @cb_on[cba[0]] = false
    end
  end
 
end

module DataManager
  class <<self
    alias load_database_original_r2_equip_name load_database
  end
  def self.load_database
    load_database_original_r2_equip_name
    load_original_r2_equip_name
  end
  def self.load_original_r2_equip_name
    groups = [$data_weapons, $data_armors]
    for group in groups
      for obj in group
        next if obj.nil?
        obj.load_original_r2_equip_name
      end
    end
  end
end

class RPG::EquipItem
  attr_accessor :original_name
  def load_original_r2_equip_name
    @original_name = self.name
  end
end

class Game_Actor < Game_Battler
  def change_equip(slot_id, item)
    FalMana.stone_combo(@equips[slot_id].object, :clear)
    FalMana.add_param(self, @equips[slot_id].object, true)
    FalMana.add_param(self, item)
    falcaomanastones_change(slot_id, item)
    FalMana.stone_combo(item, :add)
  end
end
Thanks! Could you give me an example of how to set that up with states?
Thanks! Could you give me an example of how to set that up with states?
I added a line to show where the state number goes
1718843093835.png

In the example in the script the first match will add state id #4 to the actor.
I added a line to show where the state number goes
View attachment 308941
In the example in the script the first match will add state id #4 to the actor.
Phone was acting weird and v 1.02 wasnt loading. Thanks!

Original thread: https://forums.rpgmakerweb.com/threads/falcao-mana-stones-with-diablo-2-runes.169498/