Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Enemy drop more than one item
#1
This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.


read the comment in the class Extra_drop. ;)

First, go to Scene_Battle 2
and replace your def start_phase5, with this one

Code:
def start_phase5
    # フェーズ 5 ã?«ç§»è¡Œ
    @phase = 5
    # ãƒ?トル終äº�  ME ã‚’æ¼”å¥?
    $game_system.me_play($game_system.battle_end_me)
    # ãƒ?トル開始å‰?ã?® BGM ã?«æˆ»ã?™
    $game_system.bgm_play($game_temp.map_bgm)
    # EXPã€?ゴールドã€?トレジャーをåˆ?期化
    exp = 0
    gold = 0
    treasures = []
    
    # ループ
    for enemy in $game_troop.enemies
      # エãƒ?ミーã?Œéš� ã‚Œç� ¶æ…‹ã?§ã?ªã?„å� ´å?ˆ
      unless enemy.hidden
        # ç?²å¾— EXPã€?ゴールドを追å� �
        exp += enemy.exp
        gold += enemy.gold
        #EDIT
        
        item_get = $game_system.enemy_drops[enemy.id][0][0]
        prob = $game_system.enemy_drops[enemy.id][0][1]
        item_get1 = $game_system.enemy_drops[enemy.id][1][0]
        prob1 = $game_system.enemy_drops[enemy.id][1][1]
         item_get2 = $game_system.enemy_drops[enemy.id][2][0]
        prob2 = $game_system.enemy_drops[enemy.id][2][1]
        if rand(100) < prob
          treasures.push($data_items[item_get])
        end
        if rand(100) < prob1
          treasures.push($data_weapons[item_get1])
        end
        if rand(100) < prob2
          treasures.push($data_armors[item_get2])
        end
        
        #EDIT
        # トレジャー出ç?¾åˆ¤å®š
=begin        
        if rand(100) < enemy.treasure_prob
          if enemy.item_id > 0
            treasures.push($data_items[enemy.item_id])
          end
          if enemy.weapon_id > 0
            treasures.push($data_weapons[enemy.weapon_id])
          end
          if enemy.armor_id > 0
            treasures.push($data_armors[enemy.armor_id])
          end
        end
=end        
      end
    end
    # トレジャーã?®æ•°ã‚’ 6 個ã?¾ã?§ã?«é™?定
    treasures = treasures[0..5]
    # EXP ç?²å¾—
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      if actor.cant_get_exp? == false
        last_level = actor.level
        actor.exp += exp
        if actor.level > last_level
          @status_window.level_up(i)
        end
      end
    end
    # ゴールドç?²å¾—
    $game_party.gain_gold(gold)
    # トレジャーç?²å¾—
    for item in treasures
      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
    # ãƒ?トルリザルトウィンドウを作æˆ?
    @result_window = Window_BattleResult.new(exp, gold, treasures)
    # ウェイトカウントを設定
    @phase5_wait_count = 100
  end

then make a new script above the main, and put this in it

Code:
class Game_System
  attr_accessor :enemy_drops
  alias item_int initialize
  def initialize
    item_int
    @enemy_drops = []
    @enemy_drops.fill([], 1..$data_enemies.size)
  end
end
class Extra_Drops
#written by rpgmaker
#Monster drop three items, based on drop percent
#Instruction
#item_id:drop percent, weapon_id:drop percent, armor_id:drop percent
#ex
#{1:10,2:10,3:10
#the first will give it first item in the database, with 10 percent probability
#add them after name of the monster in the monster database section
def get_item_ids
  @gain_extra_id = []
    @probability = []
for i in 1...$data_enemies.size
  enemy = $data_enemies[i]
  @name = $data_enemies[i].name
  get_id = @name.index("{")
  string = @name.slice!(get_id + 1, @name.size - 1)
  @name.slice!("{")
  new_str = string.split(',')
  for k in 0...new_str.size
    str = new_str[k].split(':')
    @gain_extra_id.push(str[0])
    @probability.push(str[1])
    $game_system.enemy_drops[i].push([(str[0]).to_i,(str[1]).to_i])
  end
end
end
end


.zip   extra_drop.zip (Size: 208.58 KB / Downloads: 1)

READ THIS

Code:
#Monster drop three items, based on drop percent
#Instruction
#item_id:drop percent, weapon_id:drop percent, armor_id:drop percent
#{1:10,2:10,3:10
#ex
#Ghost{1:10,2:10,3:10
#the first will give it first item in the database, with 10 percent probability
#add them after name of the monster in the monster database section
#note, you don't need to use the original drop item any more ,it is unless. But #remember to add something like that to ever monster name {1:10,2:10,3:10
#else you will get error. i will post an update soon, so that you will not require to #do it for every one
enjoy ;)
}


Possibly Related Threads…
Thread Author Replies Views Last Post
  Wallet and Item Capacity Levels Ragnarok Rob 0 5,634 08-11-2006, 01:00 PM
Last Post: Ragnarok Rob
  Fix for Item Detail Vieuw Derk-Jan 0 1,925 12-26-2005, 01:00 PM
Last Post: Derk-Jan
  Item Inventory SephirothSpawn 0 2,243 12-02-2005, 01:00 PM
Last Post: SephirothSpawn
  Cool, sortable item menu Jimmie 0 2,040 12-01-2005, 01:00 PM
Last Post: Jimmie
  Item Encyclopedia GoldenShadow 0 2,268 08-14-2005, 01:00 PM
Last Post: GoldenShadow
  New Item Icon Menu Chrono Cry 0 2,065 04-21-2005, 01:00 PM
Last Post: Chrono Cry



Users browsing this thread: