Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[Request]Drop more than 1 item ans Mining system

Eldnar

Member

I know that exists trillion of unhappy posts as that :s
Then I do come to ask will Be that anybody has or does anyone know how to do a script of monsters drop more than an item?? Only that I want a simple method.....
Ohhh!!! its possible make with events but.....
only that the one that I want has to be for script.....
because I want probabilities of low drop and high type 0.25% or 75%... something like that
Only that this has some details... is has to be compatible with Mr.Mo ABS, and this has to can drop more than an item, more than a weapon, more than an armor, that everything TOGETHER!
I have a code here of enemy alone drops that he doesn't work with the mr.mo abs....:
Needs SDK:
Code:
#==============================================================================
# ** Additional Enemy Drops
#------------------------------------------------------------------------------
# SephirothSpawn
# Version 2.1
# 2006-12-13
#------------------------------------------------------------------------------
# * Version History :
#
#   Version 1 ---------------------------------------------------- (2006-07-09)
#   Version 2 ---------------------------------------------------- (2006-09-20)
#    - Update : Re-scripted Much of the System
#    Version 2.1 ------------------------------------------------- (2006-12-13)
#     - Addition : Added Max Number of Drops Feature
#------------------------------------------------------------------------------
# * Description :
#
#   This script was designed to let you control multiple item, weapon & armor
#   drops for each enemy. You can also control the drop percentages as well.
#
#   As a bonus, you can limit the number of items, weapons, armors or total
#   items dropped by a monster.
#------------------------------------------------------------------------------
# * Instructions :
#
#   Place The Script Below the SDK and Above Main.
#   To Customize your drops, refer to the customization instructions.
#------------------------------------------------------------------------------
# * Customization :
#
#   Max_Item_Drops
#    - Description : Limits Number of Random Drops
#    - Key : Monster ID
#    - Value : Max Drops
#
#   <drop_type> = { monster_id => { key => percent, ... }
#
#   Enemy_Item_Drops
#    - Description : List Of Items Dropped By Monster
#    - Key : Item ID
#
#   Enemy_Weapon_Drops
#    - Description : List Of Weapons Dropped By Monster
#    - Key : Weapon ID
#
#   Enemy_Armor_Drops
#    - Description : List Of Armors Dropped By Monster
#    - Key : Armor ID
#------------------------------------------------------------------------------
# * Syntax :
#
#   Collect Random Drop List of Items, Weapons or Armors. These methods will
#   return a random list of dropped items.
#    - <game_enemy>.multi_item_drops
#    - <game_enemy>.multi_weapon_drops
#    - <game_enemy>.multi_armor_drops
#
#   Force Enemy to Drop Items, Weapons & Armors. All items will be 
#   automatically gained, and a list of RPG::Items, RPG::Weapons & RPG::Armors
#   will be returned.
#    - <game_enemy>.drop_multi_items
#==============================================================================

#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log('Additional Enemy Drops', 'SephirothSpawn', 2.1, '2006-12-13')

#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.state('Additional Enemy Drops')
  
#==============================================================================
# ** Game_Enemy
#==============================================================================

class Game_Enemy < Game_Battler
  #--------------------------------------------------------------------------
  # * Max Item, Weapon & Armor Drops
  #  ~ enemy_id => max_items
  #--------------------------------------------------------------------------
  Max_Item_Drops = {}
  Max_Weapon_Drops = {}
  Max_Armor_Drops = {}
  Max_Overall_Drops = {}
  #--------------------------------------------------------------------------
  # * Enemy Item Drops
  #  ~ enemy_id => { item_id => drop_percent, ... }
  #--------------------------------------------------------------------------
  Enemy_Item_Drops = {
    5 => {39 => 90, 2 => 30, 3 => 10}
  }
  #--------------------------------------------------------------------------
  # * Enemy Weapon Drops
  #  ~ enemy_id => { weapon_id => drop_percent, ... }
  #--------------------------------------------------------------------------
  Enemy_Weapon_Drops = {
    5 => {1 => 95}
  }
  #--------------------------------------------------------------------------
  # * Enemy Item Drops
  #  ~ enemy_id => { item_id => drop_percent, ... }
  #--------------------------------------------------------------------------
  Enemy_Armor_Drops = {
    5 => {1 => 95}
  }
  #--------------------------------------------------------------------------
  # * Multiple Item Drops
  #--------------------------------------------------------------------------
  def multi_item_drops
    items = []
    # Item Lists
    if Enemy_Item_Drops.has_key?(@enemy_id)
      # Passes Each Item
      Enemy_Item_Drops[@enemy_id].each do |item_id, drop_percent|
        # Adds items If Randomly Dropped
        if rand(100) < drop_percent
          items << $data_items[item_id]
        end
      end
    end
    # If List Larger than Max Items
    if Max_Item_Drops.has_key?(@enemy_id)
      # Until List Size is Smaller
      until items.size <= Max_Item_Drops[@enemy_id]
        # Delete Random items
        items.delete(items[rand(items.size)])
      end
    end
    # Return list
    return items
  end
  #--------------------------------------------------------------------------
  # * Multiple Weapon Drops
  #--------------------------------------------------------------------------
  def multi_weapon_drops
    items = []
    # Item Lists
    if Enemy_Weapon_Drops.has_key?(@enemy_id)
      # Passes Each Weapon
      Enemy_Weapon_Drops[@enemy_id].each do |weapon_id, drop_percent|
        # Adds items If Randomly Dropped
        if rand(100) < drop_percent
          items << $data_weapons[weapon_id]
        end
      end
    end
    # If List Larger than Max Items
    if Max_Weapon_Drops.has_key?(@enemy_id)
      # Until List Size is Smaller
      until items.size <= Max_Weapon_Drops[@enemy_id]
        # Delete Random items
        items.delete(items[rand(items.size)])
      end
    end
    # Return list
    return items
  end
  #--------------------------------------------------------------------------
  # * Multiple Armor Drops
  #--------------------------------------------------------------------------
  def multi_armor_drops
    items = []
    if Enemy_Armor_Drops.has_key?(@enemy_id)
      # Passes Each Armor
      Enemy_Armor_Drops[@enemy_id].each do |armor_id, drop_percent|
        # Adds items If Randomly Dropped
        if rand(100) < drop_percent
          items << $data_armors[armor_id]
        end
      end
    end
    # If List Larger than Max Items
    if Max_Armor_Drops.has_key?(@enemy_id)
      # Until List Size is Smaller
      until items.size <= Max_Armor_Drops[@enemy_id]
        # Delete Random items
        items.delete(items[rand(items.size)])
      end
    end
    # Return list
    return items
  end
  #--------------------------------------------------------------------------
  # * Drop Multi Items
  #--------------------------------------------------------------------------
  def drop_multi_items
    # Starts Item List
    items = []
    items << multi_item_drops
    items << multi_weapon_drops
    items << multi_armor_drops
    items.flatten!
    # If List Larger than Max Items
    if Max_Overall_Drops.has_key?(@enemy_id)
      # Until List Size is Smaller
      until items.size <= Max_Overall_Drops[@enemy_id]
        # Delete Random items
        items.delete(items[rand(items.size)])
      end
    end
    # Passes Through Item Drop List
    for item in items
      case item
      when RPG::Item
        $game_party.gain_item(item_id, 1)
      when RPG::Weapon
        $game_party.gain_weapon(item_id, 1)
      when RPG::Armor
        $game_party.gain_armor(item_id, 1)
      end
    end
    # Returns Drop List
    return items
  end
end

#==============================================================================
# ** Window_BattleResult
#==============================================================================

class Window_BattleResult < Window_Base
  #--------------------------------------------------------------------------
  # * Add Multiple Drops
  #--------------------------------------------------------------------------
  def add_multi_drops
    # Collects Extra Droppings
    for enemy in $game_troop.enemies
      # Adds Extra Treasures
      @treasures << enemy.drop_multi_items
    end
    # Flatten Array
    @treasures.flatten!
    # Sort Treasures By ID
    @treasures.sort! {|a, b| a.id <=> b.id}
    # Sort Treasures By Type
    @treasures.sort! do |a, b| 
      a_class = a.is_a?(RPG::Item) ? 0 : a.is_a?(RPG::Weapon) ? 1 : 2
      b_class = b.is_a?(RPG::Item) ? 0 : b.is_a?(RPG::Weapon) ? 1 : 2
      a_class <=> b_class
    end
    # Adjust Height & Window Contents
    self.height = [@treasures.size * 32 + 64, 256].min
    self.contents = Bitmap.new(width - 32, @treasures.size * 32 + 32)
    # Adjust Y
    self.y = 160 - height / 2
    # Refresh Window
    refresh
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    if Input.press?(Input::UP)
      self.oy -= 4 if self.oy > 0
    elsif Input.press?(Input::DOWN)
      self.oy += 4 if self.oy < self.contents.height - 64
    end
  end
end

#==============================================================================
# ** Scene_Battle
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias seph_enemydrops_scnbtl_sp5 start_phase5
  #--------------------------------------------------------------------------
  # * Start After Battle Phase
  #--------------------------------------------------------------------------
  def start_phase5
    # Original Start Phase 5
    seph_enemydrops_scnbtl_sp5
    # Add Extra Item Drops
    @result_window.add_multi_drops
  end
end

#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end

The problem of that script and that in the abs him no add the won items..... Finally... if somebody knows how to modify a class or until that script for being compatible with the mr.mo abs...

---------The other request is a script of mining...---------------

It is the following: The script has to create an ability to mine. That of that for keeping in a variable of the detabase variable example of ID 1... that every time that you to mine could have the chance of you increase her/it the where it is time that you mine.... +1 in the variable that podesse to give the ores of the mine random type example:
[
MINE_NAME = 'Mine of Copper'
ITEMS_NEED = [ITEM, 1, 1, NOT_CONSUMED]
MINE_RESULTS = [ITEM, 1, 5], [ITEM, 2, 1]
LEVEL = [1]
]
Where MINE_NAME - > it would be the method of recognizing that mine type is.
ITEMS_NEED - > it would be if nedd of some item where the ITEM would be the item type [Comun Item, Weapon, armor...] the first 1 would be ID of the item and where the second 1 would be the amount needs and NOT_CONSUMED would be if it spent the item for you use him/
MINE_RESULTS - > it would serialize the result that will give the mine where the first 1 would be ID of the item and the 5 would be the amount of the item.
LEVEL - > it would Be the value of the variable for could mine for instance if the variable

Then if of that for doing that the hero had a suffix of the animation for mining. it would be like this: the script for recognizing the animation had to have the suffix "_mine" added in the name of the graph of the character would have to be like this if the name of the character went "001-Fighter" would have to be for animation "001-Fighter_mine" that was made when it mines oh for defining in the event for mining he would have to call a script like this:
[MINE_NAME = 'Mine of Copper'
CHANCES_TO_MINE = 5] where how many times CHANCES_TO_MINE went he can mine in the that stone and that depending on the level of the variable you can get right the chance of mining as much as for wandering... That has to be for script not for event and me I know that he/she gives for doing for event!!!!but he/she has to be for script. Sheltered at once Who does one of those he/she will have credits in my future game online!!!
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top