- Joined
- Aug 20, 2020
- Messages
- 5
- Reaction score
- 0
- First Language
- English
- Primarily Uses
- RMVXA
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
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/
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/
Last edited:
