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.

I need help with the Dynamic Enemy Drop script

I'm trying to use Seph's dynamic drop script since it allows for multiple counts of a single drop (good for the crafting system im using), but i get a syntax errror whenever i try to define more than one Enemy on the script, such as:

1 => {32 => [4, 70], 33 => [3, 65],}
2 => {32 => [2, 70], 35 => [3, 70], 36 => [2, 60],}

After which i get a syntac error at line 220:
def self.collect_item_list(c1, c2, c3, enemy_id,)

What do i need to do to solve this problem?
 
Get rid of the commas at the end...

1 => {32 => [4, 70], 33 => [3, 65]}
2 => {32 => [2, 70], 35 => [3, 70], 36 => [2, 60]}

The method def should be...

def self.collect_item_list(c1, c2, c3, enemy_id, level = nil)
 
I made the changes but im still getting syntax errors. The error occurs Line 123,


120 Enemy_item_Drops= {
121 #Enemy 1
122 1 => {32 => [5, 70], 33 => [5, 65]}
123 2 => {32 => [2, 70], 35 => [3, 70], 36 => [2, 60]}
124
125 #Item1 : 3* 50%, Item 2 : 2 * 30%, Item 3 : 1 * 10%
126
127 }

and line 220:
220 def self.collect_item_list(c1, c2, c3, enemy_id, level=nil)
221 #Starts item List
222 items= [ ]
 
Andf or the line 220 error?

217 #--------------------------------------------------------------------------
218 # * Collect Item List
219#--------------------------------------------------------------------------
220 def self. collect_item_list (c1, c2, c3, enemy_id, level = nil)
221
222 # Starts Item List
223 items = [32, 33, 34, 35, 36, 37, 38, 39, 40]
224 # If Enemy Has Additional Item Drop
225 if c1.has_key?(enemy_id)
226 # Pass Through Item List
227 c1[enemy_id].each do |item_id, par|
228 par[0].times do
229 items << item_id if rand(100) < par[1]
230 end
231 end
232 end
 
the Entire Script.
I only defined 2 enemies so far.

Code:
==============================================================================

# ** Dynamic & Additional Enemy Drops

#------------------------------------------------------------------------------

# SephirothSpawn

# Version 3

# 2007-03-01

# SDK : Version 2.0+, Part 1

#------------------------------------------------------------------------------

# * 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

#   Version 3 ---------------------------------------------------- (2007-03-01)

#     - Update : Re-scripted the entire system. Added Dynamic Drops.

#------------------------------------------------------------------------------

# * Requirements :

#

#   Method & Class Library 2.1+

#   Dynamic Enemies (3.0 +) (Optional : Required For Dynamic Drops)

#------------------------------------------------------------------------------

# * 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.

#

#   With the Dynamic Enemies script, you can also make drops occur at certain

#   levels.

#

#   You can set a number of times an item can be dropped in each way.

#

#   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 Drops (Item, Weapon, Armor & Overall Drops)

#    - <Type> = { enemy_id => max, ... }

#

#    Types : Max_Item_Drops, Max_Weapon_Drops, 

#            Max_Armor_Drops, Max_Overall_Drops

#

#   Additional Drops

#    - <Type> = { enemy_id => { item_id => [max, drop_percent], ... }, ... }

#

#    Types : Enemy_Item_Drops, Enemy_Weapon_Drops, Enemy_Armor_Drops

#

#   Dynamic Drops

#    - <Type> = { 

#        enemy_id => {

#          level => { 

#            <operator> => { item_id => [max, drop_percent], ... }

#            , ... }

#          , ... }

#        , ... }

#      }

#

#    <Type> = Dynamic_Item_Drops, Dynamic_Weapon_Drops, Dynamic_Armor_Drops

#

#    <operator> : 0 - Less Than, 1 - Less Than or Equal To, 2 - Equals, 

#                 3 - Greater Than or Equal To, 4 - Greater Than

#------------------------------------------------------------------------------

# * Syntax :

#

#   Force Enemy to Drop Items (Auto-added to inventory)

#    - <game_enemy>.multi_item_drops

#    - <game_enemy>.multi_weapon_drops

#    - <game_enemy>.multi_armor_drops

#    - <game_enemy>.drop_multi_items

#==============================================================================

 

#------------------------------------------------------------------------------

# * SDK Log Script

#------------------------------------------------------------------------------

SDK.log('Dynamic + Additional Enemy Drops', 'SephirothSpawn', 3, '2007-03-01')

SDK.check_requirements(2.0, [], {'Method & Class Library' => 2.1}) 

 

#------------------------------------------------------------------------------

# * Begin SDK Enable Test

#------------------------------------------------------------------------------

unless SDK.enabled?('Dynamic Enemies', 3)

  p 'Dynamic Enemies System Not Found. You will not be able to set Dynamic ' +

    'item, weapon and armor drops.'

end

#------------------------------------------------------------------------------

# * End SDK Enable Test

#------------------------------------------------------------------------------

 

#------------------------------------------------------------------------------

# * Begin SDK Enable Test

#------------------------------------------------------------------------------

if SDK.enabled?('Dynamic + Additional Enemy Drops')

  

#==============================================================================

# ** Dynamic_Additiona_Drops

#==============================================================================

  

module DA_Enemy_Drops

  #--------------------------------------------------------------------------

  # * Max Item, Weapon & Armor Drops

  #

  #  ~ enemy_id => max_items

  #--------------------------------------------------------------------------

  Max_Item_Drops    = {1 => 5, 2 => 4}

  Max_Weapon_Drops  = {1 => 0, 2 => 0}

  Max_Armor_Drops   = {1 => 0, 2 => 0}

  Max_Overall_Drops = {1 => 5, 2 => 4}

  #--------------------------------------------------------------------------

  # * Enemy Item Drops

  #

  #  ~ enemy_id => { item_id => [max, drop_percent], ... }

  #--------------------------------------------------------------------------

  Enemy_Item_Drops = {

    # Enemy 1

    1 => {32 => [5, 70], 33 => [5, 65]},

    2 => {32 => [2, 70], 35 => [3, 70], 36 => [2, 60]},

 

      # Item 1 : 3* 50%, Item 2 : 2 * 30%, Item 3 : 1 * 10% 

      

    }

 

  #--------------------------------------------------------------------------

  # * Enemy Weapon Drops

  #

  #  ~ enemy_id => { weapon_id => [max, drop_percent], ... }

  #--------------------------------------------------------------------------

  Enemy_Weapon_Drops = {

    # Enemy 1

    1 => {

      # Weapon 1 : 2 * 25%

      

    }

  }

  #--------------------------------------------------------------------------

  # * Enemy Item Drops

  #

  #  ~ enemy_id => { armor_id => [max, drop_percent], ... }

  #--------------------------------------------------------------------------

  Enemy_Armor_Drops = {

    # Enemy 1

    1 => {

      # Armor 1 : 2 * 25%

     

    }

  }

  #--------------------------------------------------------------------------

  # * Dynamic Item Drops

  #

  #  ~ enemy_id => { level => { <operator_value> => 

  #    { item_id => [max, drop_percent] }, ... }, ... }

  #

  # Operator Value : 0 - Less Than, 1 - Less Than or Equal To, 2 - Equals, 

  #                  3 - Greater Than or Equal To, 4 - Greater Than

  #--------------------------------------------------------------------------

  Dynamic_Item_Drops = {

    # Enemy 1

      # Level 5

      5 => {

        # Greater or Equal to 5

        3 => {

          # Item 4 : 3 * 50%, Item 5 : 2 * 25%

        

        }

      }

    }

 

  #--------------------------------------------------------------------------

  # * Dynamic Weapon Drops

  #

  #  ~ enemy_id => { level => { <operator_value> => 

  #    { weapon_id => [max, drop_percent] }, ... }, ... }

  #

  # Operator Value : 0 - Less Than, 1 - Less Than or Equal To, 2 - Equals, 

  #                  3 - Greater Than or Equal To, 4 - Greater Than

  #--------------------------------------------------------------------------

  Dynamic_Weapon_Drops = {

      # Enemy 1

    

      # Level 5

      5 => {

        # Greater or Equal to 5

        3 => {

          # Weapon 2 : 3 * 25%, Armor 3 : 2 * 5%

          

        }

      }

    }

 

  #--------------------------------------------------------------------------

  # * Dynamic Armor Drops

  #

  #  ~ enemy_id => { level => { <operator_value> => 

  #    { armor_id => [max, drop_percent] }, ... }, ... }

  #

  # Operator Value : 0 - Less Than, 1 - Less Than or Equal To, 2 - Equals, 

  #                  3 - Greater Than or Equal To, 4 - Greater Than

  #--------------------------------------------------------------------------

  Dynamic_Armor_Drops = {

      # Enemy 1

    1 => {

      # Level 5

      5 => {

        # Greater or Equal to 5

        3 => {

          # Armor 2 : 3 * 25%, Armor 3 : 2 * 5%

          

        }

     } 

  }

  #--------------------------------------------------------------------------

  # * Collect Item List

  #--------------------------------------------------------------------------

    def self. collect_item_list (c1, c2, c3, enemy_id, level = nil)

    # Starts Item List

    items = [32, 33, 34, 35, 36, 37, 38, 39, 40]

    # If Enemy Has Additional Item Drop

    if c1.has_key?(enemy_id)

      # Pass Through Item List

      c1[enemy_id].each do |item_id, par|

        par[0].times do

          items << item_id if rand(100) < par[1]

        end

      end

    end 

    # If Max Items Defined

    if c3.has_key?(enemy_id)

      # Until Item List is at max size

      until items.size <= c3[enemy_id]

        # Delete Random Item

        items.delete_at(rand(items.size))

      end

    end

    # Returns Item List

    return items.sort

  end

  #--------------------------------------------------------------------------

  # * Generate Item List

  #--------------------------------------------------------------------------

  def self.generate_item_list(enemy_id, level = nil)

    return self.collect_item_list(Enemy_Item_Drops, Dynamic_Item_Drops, 

      Max_Item_Drops, enemy_id, level)

  end

  #--------------------------------------------------------------------------

  # * Generate Weapon List

  #--------------------------------------------------------------------------

  def self.generate_weapon_list(enemy_id, level = nil)

    return self.collect_item_list(Enemy_Weapon_Drops, Dynamic_Weapon_Drops, 

      Max_Weapon_Drops, enemy_id, level)

  end

  #--------------------------------------------------------------------------

  # * Generate Armor List

  #--------------------------------------------------------------------------

  def self.generate_armor_list(enemy_id, level = nil)

    return self.collect_item_list(Enemy_Armor_Drops, Dynamic_Armor_Drops, 

      Max_Armor_Drops, enemy_id, level)

  end

  #--------------------------------------------------------------------------

  # * Generate Complete List

  #--------------------------------------------------------------------------

  def self.generate_complete_list(enemy_id, level = nil)

    # Start Item List

    list = []

    # Collect Items

    items   = self.generate_item_list(enemy_id, level)

    items.each {|item_id| list << $data_items[item_id]}

    # Collect Weapons

    weapons = self.generate_weapon_list(enemy_id, level)

    weapons.each {|weapon_id| list << $data_weapons[weapon_id]}

    # Collect Armors

    armors  = self.generate_armor_list(enemy_id, level)

    armors.each {|armor_id| list << $data_armors[armor_id]}

    # If Max Items Defined

    if Max_Overall_Drops.has_key?(enemy_id)

      # Until Item List is at max size

      until list.size <= Max_Overall_Drops[enemy_id]

        # Delete Random Item

        list.delete_at(rand(list.size))

      end

    end

    # Gains Items

    for item in list

      # Branch By Item Type

      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

    # Return Drop List

    return list

  end

end

 

#==============================================================================

# ** Game_Enemy

#==============================================================================

 

class Game_Enemy < Game_Battler

  #--------------------------------------------------------------------------

  # * Multiple Item Drops

  #--------------------------------------------------------------------------

  def multi_item_drops

    return DA_Enemy_Drops.generate_item_list(@enemy_id, @level)

  end

  #--------------------------------------------------------------------------

  # * Multiple Weapon Drops

  #--------------------------------------------------------------------------

  def multi_weapon_drops

    return DA_Enemy_Drops.generate_weapon_list(@enemy_id, @level)

  end

  #--------------------------------------------------------------------------

  # * Multiple Armor Drops

  #--------------------------------------------------------------------------

  def multi_armor_drops

    return DA_Enemy_Drops.generate_armor_list(@enemy_id, @level)

  end

  #--------------------------------------------------------------------------

  # * Drop Multi Items

  #--------------------------------------------------------------------------

  def drop_multi_items

    return DA_Enemy_Drops.generate_complete_list(@enemy_id, @level)

  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 - (self.height - 32)

    end

  end

end

 

#==============================================================================

# ** Scene_Battle

#==============================================================================

 

class Scene_Battle

  #--------------------------------------------------------------------------

  # * Alias Listings

  #--------------------------------------------------------------------------

  alias_method :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
 
Ok, o this should be the Completed script?

Code:
#==============================================================================

# ** Dynamic & Additional Enemy Drops

#------------------------------------------------------------------------------

# SephirothSpawn

# Version 3

# 2007-03-01

# SDK : Version 2.0+, Part 1

#------------------------------------------------------------------------------

# * 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

#   Version 3 ---------------------------------------------------- (2007-03-01)

#     - Update : Re-scripted the entire system. Added Dynamic Drops.

#------------------------------------------------------------------------------

# * Requirements :

#

#   Method & Class Library 2.1+

#   Dynamic Enemies (3.0 +) (Optional : Required For Dynamic Drops)

#------------------------------------------------------------------------------

# * 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.

#

#   With the Dynamic Enemies script, you can also make drops occur at certain

#   levels.

#

#   You can set a number of times an item can be dropped in each way.

#

#   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 Drops (Item, Weapon, Armor & Overall Drops)

#    - <Type> = { enemy_id => max, ... }

#

#    Types : Max_Item_Drops, Max_Weapon_Drops, 

#            Max_Armor_Drops, Max_Overall_Drops

#

#   Additional Drops

#    - <Type> = { enemy_id => { item_id => [max, drop_percent], ... }, ... }

#

#    Types : Enemy_Item_Drops, Enemy_Weapon_Drops, Enemy_Armor_Drops

#

#   Dynamic Drops

#    - <Type> = { 

#        enemy_id => {

#          level => { 

#            <operator> => { item_id => [max, drop_percent], ... }

#            , ... }

#          , ... }

#        , ... }

#      }

#

#    <Type> = Dynamic_Item_Drops, Dynamic_Weapon_Drops, Dynamic_Armor_Drops

#

#    <operator> : 0 - Less Than, 1 - Less Than or Equal To, 2 - Equals, 

#                 3 - Greater Than or Equal To, 4 - Greater Than

#------------------------------------------------------------------------------

# * Syntax :

#

#   Force Enemy to Drop Items (Auto-added to inventory)

#    - <game_enemy>.multi_item_drops

#    - <game_enemy>.multi_weapon_drops

#    - <game_enemy>.multi_armor_drops

#    - <game_enemy>.drop_multi_items

#==============================================================================

 

#------------------------------------------------------------------------------

# * SDK Log Script

#------------------------------------------------------------------------------

SDK.log('Dynamic + Additional Enemy Drops', 'SephirothSpawn', 3, '2007-03-01')

SDK.check_requirements(2.0, [], {'Method & Class Library' => 2.1}) 

 

#------------------------------------------------------------------------------

# * Begin SDK Enable Test

#------------------------------------------------------------------------------

unless SDK.enabled?('Dynamic Enemies', 3)

  p 'Dynamic Enemies System Not Found. You will not be able to set Dynamic ' +

    'item, weapon and armor drops.'

end

#------------------------------------------------------------------------------

# * End SDK Enable Test

#------------------------------------------------------------------------------

 

#------------------------------------------------------------------------------

# * Begin SDK Enable Test

#------------------------------------------------------------------------------

if SDK.enabled?('Dynamic + Additional Enemy Drops')

  

#==============================================================================

# ** Dynamic_Additiona_Drops

#==============================================================================

  

module DA_Enemy_Drops

  #--------------------------------------------------------------------------

  # * Max Item, Weapon & Armor Drops

  #

  #  ~ enemy_id => max_items

  #--------------------------------------------------------------------------

  Max_Item_Drops    = {1 => 5, 2 => 4}

  Max_Weapon_Drops  = {1 => 0, 2 => 0}

  Max_Armor_Drops   = {1 => 0, 2 => 0}

  Max_Overall_Drops = {1 => 5, 2 => 4}

  #--------------------------------------------------------------------------

  # * Enemy Item Drops

  #

  #  ~ enemy_id => { item_id => [max, drop_percent], ... }

  #--------------------------------------------------------------------------

  Enemy_Item_Drops = {

    # Enemy 1

    1 => {32 => [5, 70], 33 => [5, 65]},

    2 => {32 => [2, 70], 35 => [3, 70], 36 => [2, 60]}

 

      # Item 1 : 3* 50%, Item 2 : 2 * 30%, Item 3 : 1 * 10% 

      

    }

 

  #--------------------------------------------------------------------------

  # * Enemy Weapon Drops

  #

  #  ~ enemy_id => { weapon_id => [max, drop_percent], ... }

  #--------------------------------------------------------------------------

  Enemy_Weapon_Drops = {

    # Enemy 1

    1 => {

      # Weapon 1 : 2 * 25%

      

    }

  }

  #--------------------------------------------------------------------------

  # * Enemy Item Drops

  #

  #  ~ enemy_id => { armor_id => [max, drop_percent], ... }

  #--------------------------------------------------------------------------

  Enemy_Armor_Drops = {

    # Enemy 1

    1 => {

      # Armor 1 : 2 * 25%

     

    }

  }

  #--------------------------------------------------------------------------

  # * Dynamic Item Drops

  #

  #  ~ enemy_id => { level => { <operator_value> => 

  #    { item_id => [max, drop_percent] }, ... }, ... }

  #

  # Operator Value : 0 - Less Than, 1 - Less Than or Equal To, 2 - Equals, 

  #                  3 - Greater Than or Equal To, 4 - Greater Than

  #--------------------------------------------------------------------------

  Dynamic_Item_Drops = {

    # Enemy 1

      # Level 5

      5 => {

        # Greater or Equal to 5

        3 => {

          # Item 4 : 3 * 50%, Item 5 : 2 * 25%

        

        }

      }

    }

 

  #--------------------------------------------------------------------------

  # * Dynamic Weapon Drops

  #

  #  ~ enemy_id => { level => { <operator_value> => 

  #    { weapon_id => [max, drop_percent] }, ... }, ... }

  #

  # Operator Value : 0 - Less Than, 1 - Less Than or Equal To, 2 - Equals, 

  #                  3 - Greater Than or Equal To, 4 - Greater Than

  #--------------------------------------------------------------------------

  Dynamic_Weapon_Drops = {

      # Enemy 1

    

      # Level 5

      5 => {

        # Greater or Equal to 5

        3 => {

          # Weapon 2 : 3 * 25%, Armor 3 : 2 * 5%

          

        }

      }

    }

 

  #--------------------------------------------------------------------------

  # * Dynamic Armor Drops

  #

  #  ~ enemy_id => { level => { <operator_value> => 

  #    { armor_id => [max, drop_percent] }, ... }, ... }

  #

  # Operator Value : 0 - Less Than, 1 - Less Than or Equal To, 2 - Equals, 

  #                  3 - Greater Than or Equal To, 4 - Greater Than

  #--------------------------------------------------------------------------

  Dynamic_Armor_Drops = {

      # Enemy 1

    1 => {

      # Level 5

      5 => {

        # Greater or Equal to 5

        3 => {

          # Armor 2 : 3 * 25%, Armor 3 : 2 * 5%

          

        }

     } 

  }

  #--------------------------------------------------------------------------

  # * Collect Item List

  #--------------------------------------------------------------------------

     def self.collect_item_list(c1, c2, c3, enemy_id, level = nil)

 

    # Starts Item List

    items = [32, 33, 34, 35, 36, 37, 38, 39, 40]

    # If Enemy Has Additional Item Drop

    if c1.has_key?(enemy_id)

      # Pass Through Item List

      c1[enemy_id].each do |item_id, par|

        par[0].times do

          items << item_id if rand(100) < par[1]

        end

      end

    end 

    # If Max Items Defined

    if c3.has_key?(enemy_id)

      # Until Item List is at max size

      until items.size <= c3[enemy_id]

        # Delete Random Item

        items.delete_at(rand(items.size))

      end

    end

    # Returns Item List

    return items.sort

  end

  #--------------------------------------------------------------------------

  # * Generate Item List

  #--------------------------------------------------------------------------

  def self.generate_item_list(enemy_id, level = nil)

    return self.collect_item_list(Enemy_Item_Drops, Dynamic_Item_Drops, 

      Max_Item_Drops, enemy_id, level)

  end

  #--------------------------------------------------------------------------

  # * Generate Weapon List

  #--------------------------------------------------------------------------

  def self.generate_weapon_list(enemy_id, level = nil)

    return self.collect_item_list(Enemy_Weapon_Drops, Dynamic_Weapon_Drops, 

      Max_Weapon_Drops, enemy_id, level)

  end

  #--------------------------------------------------------------------------

  # * Generate Armor List

  #--------------------------------------------------------------------------

  def self.generate_armor_list(enemy_id, level = nil)

    return self.collect_item_list(Enemy_Armor_Drops, Dynamic_Armor_Drops, 

      Max_Armor_Drops, enemy_id, level)

  end

  #--------------------------------------------------------------------------

  # * Generate Complete List

  #--------------------------------------------------------------------------

  def self.generate_complete_list(enemy_id, level = nil)

    # Start Item List

    list = []

    # Collect Items

    items   = self.generate_item_list(enemy_id, level)

    items.each {|item_id| list << $data_items[item_id]}

    # Collect Weapons

    weapons = self.generate_weapon_list(enemy_id, level)

    weapons.each {|weapon_id| list << $data_weapons[weapon_id]}

    # Collect Armors

    armors  = self.generate_armor_list(enemy_id, level)

    armors.each {|armor_id| list << $data_armors[armor_id]}

    # If Max Items Defined

    if Max_Overall_Drops.has_key?(enemy_id)

      # Until Item List is at max size

      until list.size <= Max_Overall_Drops[enemy_id]

        # Delete Random Item

        list.delete_at(rand(list.size))

      end

    end

    # Gains Items

    for item in list

      # Branch By Item Type

      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

    # Return Drop List

    return list

  end

end

 

#==============================================================================

# ** Game_Enemy

#==============================================================================

 

class Game_Enemy < Game_Battler

  #--------------------------------------------------------------------------

  # * Multiple Item Drops

  #--------------------------------------------------------------------------

  def multi_item_drops

    return DA_Enemy_Drops.generate_item_list(@enemy_id, @level)

  end

  #--------------------------------------------------------------------------

  # * Multiple Weapon Drops

  #--------------------------------------------------------------------------

  def multi_weapon_drops

    return DA_Enemy_Drops.generate_weapon_list(@enemy_id, @level)

  end

  #--------------------------------------------------------------------------

  # * Multiple Armor Drops

  #--------------------------------------------------------------------------

  def multi_armor_drops

    return DA_Enemy_Drops.generate_armor_list(@enemy_id, @level)

  end

  #--------------------------------------------------------------------------

  # * Drop Multi Items

  #--------------------------------------------------------------------------

  def drop_multi_items

    return DA_Enemy_Drops.generate_complete_list(@enemy_id, @level)

  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 - (self.height - 32)

    end

  end

end

 

#==============================================================================

# ** Scene_Battle

#==============================================================================

 

class Scene_Battle

  #--------------------------------------------------------------------------

  # * Alias Listings

  #--------------------------------------------------------------------------

  alias_method :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

I still get the same Syntax error for line 220
 
And you still aren't using the [ code ] tags in your post!!!!

Look at the Dynamic_Armor_Drops hash (Dynamic_Armor_Drops = { ) (Line 205 - 216)
How many open brackets?
How many closed brackets?
 

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