RPG Maker Forums

The effect of original script is "After using the script command: create_party_corpse, all the equipped equipment of each character in the team will be lost to a new coffin event"

Now below Hime's script, a new script (NOT written by me) is inserted,
The effect has been modified to lose all the items in the backpack

But the effect I want to achieve is "After using the command, part of the items in the backpack will fall in the coffin event"

For example, if there are 10 potions in the backpack, only 3~5 potions will be lost

Ruby:
module TH
  module Corpse_Retrieval

    Lose_Normal_Items = true # Whether to lose items
    Lose_Key_Items = false # Whether to lose key items
    Lose_Weapons = true # Whether to lose the weapon
    Lose_Armors = true # Whether to lose armor
    Include_Equiped = true # (When Lose_Weapons is true) Whether to include the  equipped equipment

    def self.setup_event_commands(corpse_items, list)
      list << RPG::EventCommand.new(101, 0, ["", 0, 0, 2])
      list << RPG::EventCommand.new(401, 0, ["Corpse retrieved"])
      corpse_items[:item].each do |id, amount|
        list << RPG::EventCommand.new(126, 0, [id, 0, 0, amount, false]); end
      corpse_items[:weapons].each do |id, amount|
        list << RPG::EventCommand.new(127, 0, [id, 0, 0, amount, false]); end
      corpse_items[:armors].each do |id, amount|
        list << RPG::EventCommand.new(128, 0, [id, 0, 0, amount, false]); end
      list << RPG::EventCommand.new("delete_corpse_event")
      list << RPG::EventCommand.new
    end
  end
end

class Game_Party <Game_Unit

  def collect_party_items
    corpse_items = {}
    items.each do |item|
      if item.key_item?
        next unless TH::Corpse_Retrieval::Lose_Key_Items
      else; next unless TH::Corpse_Retrieval::Lose_Normal_Items; end
      corpse_items[item.id] = item_number(item)
      lose_item(item, item_number(item)); end
    return corpse_items
  en

  def collect_party_weapons
    corpse_weapons = {}
    weapons.each do |item|
      corpse_weapons[item.id] = item_number(item)
      lose_item(item, item_number(item)); end
    return corpse_weapons
  end

  def collect_party_armors
    corpse_armors = {}
    armors.each do |item|
      corpse_armors[item.id] = item_number(item)
      lose_item(item, item_number(item)); end
    return corpse_armors
  end

  def collect_corpse_items
    corpse_items = {}
    corpse_items[:item]    = collect_party_items
    corpse_items[:weapons] = collect_party_weapons if TH::Corpse_Retrieval::Lose_Weapons
    corpse_items[:armors]  = collect_party_armors if TH::Corpse_Retrieval::Lose_Armors
    corpse_items
  end

  def create_party_corpse
    $game_party.members.each {|member| member.clear_equipments} if TH::Corpse_Retrieval::Include_Equiped
   corpse_items = collect_corpse_items
    return corpse_items
  end

end

Does anyone know how to modify the code that can achieve the effect I said?
Maybe I should ask the author for help?
@Tsukihime

http://himeworks.com/2013/03/28/corpse-retrieval/

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,090
Members
137,586
Latest member
Usagiis
Top