Project1

标题: 求得到物品自动提示的脚本。 [打印本页]

作者: RPG_小菜    时间: 2010-7-30 14:01
标题: 求得到物品自动提示的脚本。
本帖最后由 RPG_小菜 于 2010-7-30 18:52 编辑

置顶帖找不到- -
特来求助。就是捡到个物品,自动提示捡到XX.
谢谢了
作者: 小幽的马甲    时间: 2010-7-30 14:03
6R有个功能叫搜索= =
作者: wangswz    时间: 2010-7-30 14:05
被抢先说了
作者: a849797000    时间: 2010-7-30 14:20
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================  

# 注意!!!在对话后得到物品,请在对话后先用事件等待3帧,否则对话框来不及消失。

# 开关定义:

$不显示金钱窗口 = 41

$不显示物品窗口 = 42

$不显示武器窗口 = 43

$不显示防具窗口 = 44

# 以上开关,当打开的时候,获得物品将不会提示,比如默认打开41号开关,获得金钱不再提示

# ————————————————————————————————————

class Interpreter   
  #--------------------------------------------------------------------------
  # ● 增减金钱
  #--------------------------------------------------------------------------
  def command_125
    value = operate_value(@parameters[0], @parameters[1], @parameters[2])
    $game_party.gain_gold(value)
    if $game_switches[$不显示金钱窗口]==false
      carol3_66RPG = Window_Base.new((640-160)/2,128,180,100)
      carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
      if value >= 0
        carol3_66RPG.contents.draw_text(0,0,240,32,"获得金钱:")
        #——声效,可以自己改
        Audio.se_play("Audio/SE/"+"006-System06",80,100)
      else
        carol3_66RPG.contents.draw_text(0,0,240,32,"失去金钱:")
        #——声效,可以自己改
        Audio.se_play("Audio/SE/"+"005-System05",80,100)
      end     
      carol3_66RPG.contents.draw_text(0,32,240,32,value.abs.to_s)
      carol3_66RPG.contents.draw_text(0,32,140,32, $data_system.words.gold,2)
      carol3_66RPG.opacity = 160
      for i in 0..30
        Graphics.update
      end
      for i in 0..10
        carol3_66RPG.opacity -= 30
        carol3_66RPG.contents_opacity -= 30
        Graphics.update
      end
      carol3_66RPG.dispose
    end
    return true
  end
  #--------------------------------------------------------------------------
  # ● 增减物品
  #--------------------------------------------------------------------------
  def command_126
    value = operate_value(@parameters[1], @parameters[2], @parameters[3])
    $game_party.gain_item(@parameters[0], value)
    if $game_switches[$不显示物品窗口]==false
      carol3_66RPG_item = $data_items[@parameters[0]]
      carol3_66RPG = Window_Base.new((640-300)/2,128,300,100)
      carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
      if value >= 0
        carol3_66RPG.contents.draw_text(0,0,240,32,"获得物品:")     
        #——声效,可以自己改
        Audio.se_play("Audio/SE/"+"006-System06",80,100)
      else
        carol3_66RPG.contents.draw_text(0,0,240,32,"失去物品:")     
        #——声效,可以自己改
        Audio.se_play("Audio/SE/"+"005-System05",80,100)
      end
      carol3_66RPG_bitmap = RPG::Cache.icon(carol3_66RPG_item.icon_name)
      carol3_66RPG.contents.blt(0, 32, carol3_66RPG_bitmap, Rect.new(0, 0, 24, 24), 255)
      carol3_66RPG.contents.draw_text(0 + 28, 32, 212, 32, carol3_66RPG_item.name, 0)





     carol3_66RPG.contents.draw_text(0, 32, 268, 32, "×"+value.abs.to_s, 2)
      carol3_66RPG.opacity = 160
      for i in 0..30
        Graphics.update
      end
      for i in 0..10
        carol3_66RPG.opacity -= 30
        carol3_66RPG.contents_opacity -= 30
        Graphics.update
      end
      carol3_66RPG.dispose
    end
    return true
  end
  #--------------------------------------------------------------------------
  # ● 增减武器
  #--------------------------------------------------------------------------
  def command_127
    value = operate_value(@parameters[1], @parameters[2], @parameters[3])
    $game_party.gain_weapon(@parameters[0], value)
    if $game_switches[$不显示武器窗口]==false
      carol3_66RPG_item = $data_weapons[@parameters[0]]
      carol3_66RPG = Window_Base.new((640-300)/2,128,300,100)
      carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
      if value >= 0
        carol3_66RPG.contents.draw_text(0,0,240,32,"获得武器:")     
        #——声效,可以自己改
        Audio.se_play("Audio/SE/"+"006-System06",80,100)
      else
        carol3_66RPG.contents.draw_text(0,0,240,32,"失去武器:")     
        #——声效,可以自己改
        Audio.se_play("Audio/SE/"+"005-System05",80,100)
      end
      carol3_66RPG_bitmap = RPG::Cache.icon(carol3_66RPG_item.icon_name)
      carol3_66RPG.contents.blt(0, 32, carol3_66RPG_bitmap, Rect.new(0, 0, 24, 24), 255)
      carol3_66RPG.contents.draw_text(0 + 28, 32, 212, 32, carol3_66RPG_item.name, 0)
      carol3_66RPG.contents.draw_text(0, 32, 268, 32, "×"+value.abs.to_s, 2)
      carol3_66RPG.opacity = 160
      for i in 0..30
        Graphics.update
      end
      for i in 0..10
        carol3_66RPG.opacity -= 30
        carol3_66RPG.contents_opacity -= 30
        Graphics.update
      end
      carol3_66RPG.dispose
    end
    return true
  end
  #--------------------------------------------------------------------------
  # ● 增减防具
  #--------------------------------------------------------------------------
  def command_128
    value = operate_value(@parameters[1], @parameters[2], @parameters[3])
    $game_party.gain_armor(@parameters[0], value)
    if $game_switches[$不显示防具窗口]==false
      carol3_66RPG_item = $data_armors[@parameters[0]]
      carol3_66RPG = Window_Base.new((640-300)/2,128,300,100)
      carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
      if value >= 0
        carol3_66RPG.contents.draw_text(0,0,240,32,"获得防具:")     
        #——声效,可以自己改
        Audio.se_play("Audio/SE/"+"006-System06",80,100)
      else
        carol3_66RPG.contents.draw_text(0,0,240,32,"失去防具:")     
        #——声效,可以自己改
        Audio.se_play("Audio/SE/"+"005-System05",80,100)
      end
      carol3_66RPG_bitmap = RPG::Cache.icon(carol3_66RPG_item.icon_name)
      carol3_66RPG.contents.blt(0, 32, carol3_66RPG_bitmap, Rect.new(0, 0, 24, 24), 255)
      carol3_66RPG.contents.draw_text(0 + 28, 32, 212, 32, carol3_66RPG_item.name, 0)
      carol3_66RPG.contents.draw_text(0, 32, 268, 32, "×"+value.abs.to_s, 2)
      carol3_66RPG.opacity = 160
      for i in 0..30
        Graphics.update
      end
      for i in 0..10
        carol3_66RPG.opacity -= 30
        carol3_66RPG.contents_opacity -= 30
        Graphics.update
      end
      carol3_66RPG.dispose
    end
    return true
  end
end

  

#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
作者: wsmyzc    时间: 2010-7-30 14:22
发脚本用code引起来啊,还有,LS忘记留QQ了
作者: 调律    时间: 2010-7-30 14:29
据在下所知VX的得失物品自动提示脚本不止一个,这个是站长66版的
  1. #==============================================================================
  2. # ■  Game_Interpreter
  3. #------------------------------------------------------------------------------
  4. #  执行事件命令的解释器。本类在 Game_System 类
  5. # 与 Game_Event 类的内部使用。
  6. #==============================================================================
  7. class Game_Interpreter
  8.   #--------------------------------------------------------------------------
  9.   # ● 得失物品自动提示的刷新时间控制
  10.   #--------------------------------------------------------------------------
  11.   def call_6RgetItem(para1, para2 = nil, para3 = nil)
  12.     temp_window = Window_Gain_Item.new(para1, para2, para3)
  13.     Sound.play_shop
  14.     for i in 0..120
  15.       Graphics.update
  16.       Input.update
  17.       if Input.trigger?(Input::C) or Input.trigger?(Input::B)
  18.         Sound.play_cancel
  19.         break
  20.       end
  21.     end
  22.     for i in 0..15
  23.       temp_window.opacity -= 20
  24.       temp_window.contents_opacity -= 16
  25.       temp_window.update
  26.       Graphics.update
  27.     end   
  28.     temp_window.dispose
  29.     temp_window = nil
  30.   end  
  31.   #--------------------------------------------------------------------------
  32.   # ● 增减金钱
  33.   #--------------------------------------------------------------------------
  34.   def command_125
  35.     value = operate_value(@params[0], @params[1], @params[2])
  36.     $game_party.gain_gold(value)
  37.     call_6RgetItem("gold", value)
  38.     return true
  39.   end
  40.   #--------------------------------------------------------------------------
  41.   # ● 增减物品
  42.   #--------------------------------------------------------------------------
  43.   def command_126
  44.     value = operate_value(@params[1], @params[2], @params[3])
  45.     $game_party.gain_item($data_items[@params[0]], value)
  46.     $game_map.need_refresh = true
  47.     call_6RgetItem("item", $data_items[@params[0]], value)
  48.     return true
  49.   end  
  50.   #--------------------------------------------------------------------------
  51.   # ● 增减武器
  52.   #--------------------------------------------------------------------------
  53.   def command_127
  54.     value = operate_value(@params[1], @params[2], @params[3])
  55.     $game_party.gain_item($data_weapons[@params[0]], value, @params[4])
  56.     call_6RgetItem("item", $data_weapons[@params[0]], value)
  57.     return true
  58.   end
  59.   #--------------------------------------------------------------------------
  60.   # ● 增减防具
  61.   #--------------------------------------------------------------------------
  62.   def command_128
  63.     value = operate_value(@params[1], @params[2], @params[3])
  64.     $game_party.gain_item($data_armors[@params[0]], value, @params[4])
  65.     call_6RgetItem("item", $data_armors[@params[0]], value)
  66.     return true
  67.   end
  68. end


  69. #==============================================================================
  70. # ■ Window_Gold
  71. #------------------------------------------------------------------------------
  72. #  显示金钱的窗口。
  73. #==============================================================================

  74. class Window_Gain_Item < Window_Base
  75.   #--------------------------------------------------------------------------
  76.   # ● 初始化窗口
  77.   #     x : 窗口的X坐标
  78.   #     y : 窗口的Y坐标
  79.   #--------------------------------------------------------------------------
  80.   def initialize(para1, para2 = nil, para3 = nil)
  81.     super(0, 0, 160, WLH + 32)
  82.     self.z = 10000
  83.     case para1
  84.     when "item"
  85.       str = "获得"
  86.       if para3 < 0 then
  87.         str = "失去"
  88.         para3 = - para3
  89.       end
  90.       winwidth = contents.text_size("  你获得了: ×   " + para3.to_s).width + 24 + contents.text_size(para2.name).width
  91.       self.width = winwidth + 64
  92.       self.height = 64
  93.       self.x = (Graphics.width - self.width) / 2
  94.       self.y = (Graphics.height - self.height) / 2
  95.       create_contents
  96.       self.contents.draw_text(0, 0, self.width, 32, "  你" + str + "了: ")
  97.       tx = contents.text_size("  你" + str + "了:").width
  98.       draw_item_name(para2, tx , 0, true)
  99.       self.contents.draw_text(tx + 24, 0, self.width, 32, para2.name)
  100.       tx = contents.text_size("  你" + str + "了: ").width + 24 + contents.text_size(para2.name).width
  101.       self.contents.draw_text(tx, 0, self.width, 32, " ×" + para3.to_s)
  102.     when "gold"
  103.       str = "获得"
  104.       if para2 < 0 then
  105.         str = "失去"
  106.         para2 = - para2
  107.       end
  108.       winwidth = contents.text_size("  你获得了:   " + Vocab.gold.to_s).width + contents.text_size(para2).width
  109.       self.width = winwidth + 64
  110.       self.height = 64
  111.       self.x = (Graphics.width - self.width) / 2
  112.       self.y = (Graphics.height - self.height) / 2
  113.       create_contents
  114.       self.contents.draw_text(0, 0, self.width, 32, "  你" + str + "了: #{para2} " + Vocab.gold.to_s)
  115.     end
  116.   end
  117.   #--------------------------------------------------------------------------
  118.   # ● 物品名的描画
  119.   #     item : 物品(特技、武器、防具可)
  120.   #     x    : 描画目标 X 坐标
  121.   #     y    : 描画目标 Y 坐标
  122.   #     enabled : 有效标记录。是false 的时候半透明绘画
  123.   #--------------------------------------------------------------------------
  124.   def draw_item_name(item, x, y, enabled = true)
  125.     if item != nil
  126.       draw_icon(item.icon_index, x, y, enabled)
  127.       self.contents.font.color = normal_color
  128.       self.contents.font.color.alpha = enabled ? 255 : 128
  129.     end
  130.   end  
  131. end
复制代码

作者: Hanven    时间: 2010-7-30 14:34
提示: 作者被禁止或删除 内容自动屏蔽
作者: RPG_小菜    时间: 2010-7-30 18:51
忘了- -





欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1