- Joined
- May 5, 2014
- Messages
- 24
- Reaction score
- 3
- First Language
- english
- Primarily Uses
So ok I have kind of a mess on my hands this time, I have this script, What it does is when a specified Item is added or removed an actor is removed or added as well, what I need done is that when an actor is removed, his Level is set back to 1, BUT here is the curve ball, I am using TDS Stat Distibution, http://rpgmaker.net/scripts/225/ I also need all the gained and spent PARAM points to be removed or set back to default, This is really a hurdle but I could use help so bad! please I would appreciate it so much
module EE
module ActorAsItem
#---------------------------------------------------------------------------
ACTORS = [ # Dont edit this line
#---------------------------------------------------------------------------
#---------------------------------------------------------------------
# [item_type, item_id, actor_id],
# item_type: :item, :weapon, or :armor
#---------------------------------------------------------------------
[:item, 24, 8],
[:item, 23, 7],
[:item, 18, 1],
[:item, 19, 3],
[:item, 20, 4],
[:item, 21, 5],
[:item, 31, 9],
[:item, 32, 11],
[:item, 33, 10],
[:item, 34, 13],
[:item, 35, 12],
[:item, 39, 14],
#---------------------------------------------------------------------------
] # Dont edit this line
#---------------------------------------------------------------------------
def self.items
return ACTORS.select{ |arr| arr.first == :item}
end
def self.weapons
return ACTORS.select{ |arr| arr.first == :weapon}
end
def self.armors
return ACTORS.select{ |arr| arr.first == :armor}
end
def self.get_items(item_class)
return items if item_class == RPG::Item
return weapons if item_class == RPG::Weapon
return armors if item_class == RPG::Armor
return []
end
def self.get_actor_id(item_class, item_id)
get_items(item_class).each do |arr|
return arr[2] if arr[1] == item_id
end
return nil
end
end
end
class Game_Party
alias :e222_gp_gi_ias :gain_item
def gain_item(item, amount, include_equip = false)
e222_gp_gi_ias(item, amount, include_equip)
container = item_container(item.class)
return unless container
actor_id = EE::ActorAsItem.get_actor_id(item.class, item.id)
return unless actor_id
if item_number(item) > 0
$game_party.add_actor(actor_id)
else
$game_party.remove_actor(actor_id) if $game_party.all_members.size > 1
end
end
def actors
return @actors
end
end
class Game_Map
alias :e222_gm_update_ias :update
def update(update_main = false)
e222_gm_update_ias(update_main)
check_party_equip
end
def check_party_equip
$game_party.all_members.each do |actor|
actor.equips.each do |item|
next unless item
actor_id = EE::ActorAsItem.get_actor_id(item.class, item.id)
next unless actor_id
$game_party.add_actor(actor_id) unless $game_party.actors.include?(actor_id)
end
end
end
end
module EE
module ActorAsItem
#---------------------------------------------------------------------------
ACTORS = [ # Dont edit this line
#---------------------------------------------------------------------------
#---------------------------------------------------------------------
# [item_type, item_id, actor_id],
# item_type: :item, :weapon, or :armor
#---------------------------------------------------------------------
[:item, 24, 8],
[:item, 23, 7],
[:item, 18, 1],
[:item, 19, 3],
[:item, 20, 4],
[:item, 21, 5],
[:item, 31, 9],
[:item, 32, 11],
[:item, 33, 10],
[:item, 34, 13],
[:item, 35, 12],
[:item, 39, 14],
#---------------------------------------------------------------------------
] # Dont edit this line
#---------------------------------------------------------------------------
def self.items
return ACTORS.select{ |arr| arr.first == :item}
end
def self.weapons
return ACTORS.select{ |arr| arr.first == :weapon}
end
def self.armors
return ACTORS.select{ |arr| arr.first == :armor}
end
def self.get_items(item_class)
return items if item_class == RPG::Item
return weapons if item_class == RPG::Weapon
return armors if item_class == RPG::Armor
return []
end
def self.get_actor_id(item_class, item_id)
get_items(item_class).each do |arr|
return arr[2] if arr[1] == item_id
end
return nil
end
end
end
class Game_Party
alias :e222_gp_gi_ias :gain_item
def gain_item(item, amount, include_equip = false)
e222_gp_gi_ias(item, amount, include_equip)
container = item_container(item.class)
return unless container
actor_id = EE::ActorAsItem.get_actor_id(item.class, item.id)
return unless actor_id
if item_number(item) > 0
$game_party.add_actor(actor_id)
else
$game_party.remove_actor(actor_id) if $game_party.all_members.size > 1
end
end
def actors
return @actors
end
end
class Game_Map
alias :e222_gm_update_ias :update
def update(update_main = false)
e222_gm_update_ias(update_main)
check_party_equip
end
def check_party_equip
$game_party.all_members.each do |actor|
actor.equips.each do |item|
next unless item
actor_id = EE::ActorAsItem.get_actor_id(item.class, item.id)
next unless actor_id
$game_party.add_actor(actor_id) unless $game_party.actors.include?(actor_id)
end
end
end
end
Last edited by a moderator: