XP 스크립트

몬스터가 드롭하는 아이템을 여러 개 지정할 수 있습니다.(기본적으로는 한 개만 지정할 수 있음)  물론 각각의 아이템에 대한 드롭율 지정도 가능합니다.  아이템 드롭 지정은 스크립트에 있는

Enemy_Item_Drops = { 에너미id => { 아이템id => 드롭률(%), ... }, ... }
Enemy_Weapon_Drops = { enemy_id => { item_id => drop_percent, ... }, ... }
Enemy_Armor_Drops = { enemy_id => { item_id => drop_percent, ... }, ... }
에서 지정합니다. (몬스터 수가 많으면 귀찮아짐?)


#==============================================================================
# ** Additional Enemy Drops
#------------------------------------------------------------------------------
# SephirothSpawn
# 2006-07-09
# Version 1
#------------------------------------------------------------------------------
# * Customization
#
#  ~ Enemy Item Drops
#    Enemy_Item_Drops = { enemy_id => { item_id => drop_percent, ... }, ... }
#
#  ~ Enemy Weapon Drops
#    Enemy_Weapon_Drops = { enemy_id => { item_id => drop_percent, ... }, ... }
#
#  ~ Enemy Armor Drops
#    Enemy_Armor_Drops = { enemy_id => { item_id => drop_percent, ... }, ... }
#==============================================================================

#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log('Additional Enemy Drops', 'SephirothSpawn', 1, '2006-07-09')

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

class Game_Enemy < Game_Battler
  #--------------------------------------------------------------------------
  # * Enemy Item Drops
  #  ~ enemy_id => { item_id => drop_percent, ... }
  #--------------------------------------------------------------------------
  Enemy_Item_Drops = { 1 => {1 => 50, 2 => 30, 3 => 10}
  }
  #--------------------------------------------------------------------------
  # * Enemy Weapon Drops
  #  ~ enemy_id => { weapon_id => drop_percent, ... }
  #--------------------------------------------------------------------------
  Enemy_Weapon_Drops = { 1 => {1 => 25}
  }
  #--------------------------------------------------------------------------
  # * Enemy Item Drops
  #  ~ enemy_id => { item_id => drop_percent, ... }
  #--------------------------------------------------------------------------
  Enemy_Armor_Drops = { 1 => {1 => 25}
  }
  #--------------------------------------------------------------------------
  # * Get Drop Items
  #--------------------------------------------------------------------------
  def get_drop_items
    # Item, Weapon & Armor Collection List
    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]
          $game_party.gain_item(item_id, 1)
        end
      end
      # 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]
          $game_party.gain_weapon(weapon_id, 1)
        end
      end
      # 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]
          $game_party.gain_armor(armor_id, 1)
        end
      end
    end
    # Return 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.get_drop_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

Who's 백호

?

이상혁입니다.

http://elab.kr


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
1001 ABM(액알)+Jindow(진도우) 3 WMN 2008.04.06 5115
1000 전투 ABP 액알 (Action Battle Player) 14 file 백호 2009.02.22 4556
999 스킬 ABP액알 v1.2 스킬추가, 버그수정판 36 file 백호 2009.02.22 6919
998 기타 ABS 몬스터 HP 게이지 바 11 백호 2009.02.22 2485
997 전투 ABS_v3액션 알피지 46 file 알피지GM 2010.03.07 5806
996 기타 Activation_system file 백호 2009.02.22 775
995 전투 Active Time Battle 2.57 by パラ犬 6 file 백호 2009.02.22 2371
994 전투 Active Time Battle 2.62 by パラ犬 file Alkaid 2010.09.06 1652
993 액터 Actor Customization 6.0.2 by Synthesize 4 file Alkaid 2010.09.17 1911
» 아이템 Additional Item Drop by SephirothSpawn (SDK호환) 1 백호 2009.02.22 891
991 메뉴 Advanced Command Windows by Tsunokiette file 백호 2009.02.22 1307
990 이름입력 Advanced Enter Hero Name Window by RPG Advocate 백호 2009.02.22 1168
989 장비 Advanced Equip Window 백호 2009.02.22 806
988 기타 Advanced Gold display by Dubealex 1 백호 2009.02.22 761
987 기타 Advanced Gold Display by Dubealex (돈 액수를 세자리씩 끊어 표기) 2 Alkaid 2010.11.18 1559
986 HUD Advanced HUD Script 3 file 백호 2009.02.22 1341
985 전투 Advanced Individual Battle Command v2.1 by Trickster@rmxp.org (SDK호환) 1 file 백호 2009.02.22 1189
984 전투 Advanced Limit Breaks (KGC스크립트를 SDK호환용으로 손질한 것) 백호 2009.02.22 1214
983 스킬 Advanced Mission Skills/Shop/Manager by trickster 3 file 백호 2009.02.22 1601
982 이동 및 탈것 Advanced Player Movement by SephirothSpawn (SDK호환) 1 file 백호 2009.02.22 801
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 52 Next
/ 52