| 
 
| 赞 | 0 |  
| VIP | 0 |  
| 好人卡 | 12 |  
| 积分 | 1 |  
| 经验 | 5827 |  
| 最后登录 | 2020-5-5 |  
| 在线时间 | 116 小时 |  
 Lv1.梦旅人 
	梦石0 星屑55 在线时间116 小时注册时间2008-5-12帖子264 | 
| 
本帖最后由 shinliwei 于 2010-12-10 13:41 编辑
x
加入我们,或者,欢迎回来。您需要 登录 才可以下载或查看,没有帐号?注册会员  
 执行$scene = Scene_Skill_Tree.new时 打开的天赋技能树默认是1号人物的,如何切换到2号人物?复制代码#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/    ◆ 简易天赋树脚本 - FSL_ST ◆ VX ◆
#_/
#_/    ◇ 许可协议 :FSL       ◇
#_/    ◇ 项目分类 : 角色辅助  ◇
#_/    ◇ 项目版本 : 1.7.912   ◇
#_/    ◇ 建立日期 : 2010/9/05 ◇
#_/    ◇ 最后更新 : 2010/9/12 ◇
#_/----------------------------------------------------------------------------
#_/  作者:wangswz
#_/============================================================================
#_/ 【基本机能】复杂化游戏系统。
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#===============================================================================
#-------------------------------------------------------------------------------
# ▼ 通用配置模块
#-------------------------------------------------------------------------------
module FSL
  module ST
    #职业对应天赋树初始化
    St_class_id = []
    #详细设置
    #    每个职业只能设置3个不同的天赋树
    St_class_id[1] = [1,2,3]#包含St_detailed[1]St_detailed[2]St_detailed[3]
    St_class_id[2] = [4,5,6]
    
    #等级天赋点
    #每级增加的天赋点数
    St_up = 1
    
    #深度等级基数 每下降一级深度就需要在该天赋树上多投入多少点
    St_lv = 5
    
    #天赋树
    St_detailed = []
    #基本信息详细设置  默认0            不可出现重复
    #st_detailed[1] = [基本点数, 天赋名,包含的天赋技能]
    St_detailed[1] =  [       0,"神圣",1,2,3,4,5,6]
    St_detailed[2] =  [       0,"统御",7,8,9,10,11,12]
    St_detailed[3] =  [       0,"惩戒",13,14,15,16,17,18]
    St_detailed[4] =  [       0,"武器",2,3,5]
    St_detailed[5] =  [       0,"狂暴",1,3,5]
    St_detailed[6] =  [       0,"防护",3,4,6]
    
    #将天赋树分为5×6格
    # 0 1 2 3 4 5 列
    #0
    #1
    #2
    #3
    #4
    #5
    #深
    
    St_skill = []
    #天赋技能设置   进阶定义                            默认0
    #st_skill[1] = [列,深度,技能id          ,前置技能ID,点数存储]
    
    #神圣
    St_skill[1] =  [ 1,   0,[ 1, 2, 3, 4, 5],       [0],       0]#神圣智慧
    St_skill[2] =  [ 1,   1,[ 6, 7, 8]      ,       [1],       0]#神恩
    St_skill[3] =  [ 2,   2,[ 9, 10]        ,       [0],       0]#不灭信仰
    St_skill[4] =  [ 4,   5,[11]            ,     [3,5],       0]#圣光道标
    St_skill[5] =  [ 3,   0,[12,13,14,15,16],       [0],       0]#光之烙铁
    St_skill[6] =  [ 2,   1,[17,18,19]      ,       [1],       0]#冥想
    #统御
    St_skill[7] =  [ 1,   0,[31,32,33,34,35],       [8],       0]
    St_skill[8] =  [ 3,   0,[22,23,24,25,26],        [],       0]
    St_skill[9] =  [ 2,   1,[36,37,38]      ,        [],       0]
    St_skill[10] = [ 1,   2,[20,21]         ,        [],       0]
    St_skill[11] = [ 2,   4,[30]            ,        [],       0]
    St_skill[12] = [ 3,   5,[27,28,29]      ,        [],       0]
    #惩戒
    St_skill[13] = [ 3,   3,[57]            ,        [],       0]
    St_skill[14] = [ 2,   0,[39,40,41,42,43],        [],       0]
    St_skill[15] = [ 3,   1,[45,46,47,48,49],        [],       0]
    St_skill[16] = [ 1,   1,[50,51,52]      ,        [],       0]
    St_skill[17] = [ 2,   2,[53,54,55,56]   ,        [],       0]
    St_skill[18] = [ 1,   3,[44]            ,        [],       0]
        
    #角色存放值
    #    为每个能够加入队伍的角色建立存储区
    St_actor = []
    St_actor[1] = [[],[],[]]
    St_actor[2] = [[],[],[]]
    St_actor[6] = [[],[],[]]
#-----------------------------进阶定义-----------------------------
    #天赋树列数
    St_Base_x = 5
    #天赋树深度
    St_Base_y = 6
  end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
$fscript = {} if $fscript == nil
                $fscript["FSL_ST"] = [ 1, 7, 912]
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Scene_Skill_Tree
#------------------------------------------------------------------------------
#  天赋技能类
#==============================================================================
class Scene_Skill_Tree < Scene_Base
  #--------------------------------------------------------------------------
  # ● 初始化对像
  #     index : 天赋树
  #--------------------------------------------------------------------------
  def initialize(actor_index = 0)
    @actor = actor_index
  end
  #--------------------------------------------------------------------------
  # ● 开始处理
  #--------------------------------------------------------------------------
  def start
    super
    create_menu_background
    start_command
    @skill_tree_window = Window_Skill_Tree.new(272, 0, 272, 328, $game_party.members[@actor])
    @skill_tree_window.active = false
    @skill_tree_window.visible = false
    @skill_tree_window.index = 2 #??
    @base_window = Window_Base.new(272, 0, 272, 328)
    @skill_status_window = Window_skill_status.new
    @skill_status_window.visible = false
    @base_window2 = Window_Base.new(0, 328, 544, 88)
    @skill_actor_window = Window_actor_Tree.new($game_party.members[@actor])
    @skill_actor_window.active = true
    @skill_data = Window_skill_data.new($game_party.members[@actor].id)
  end
  #--------------------------------------------------------------------------
  # ● 开始处理
  #--------------------------------------------------------------------------
  def start_command
    s1 = FSL::ST::St_detailed[FSL::ST::St_class_id[$game_party.members[@actor].class_id][0]][1]
    s2 = FSL::ST::St_detailed[FSL::ST::St_class_id[$game_party.members[@actor].class_id][1]][1]
    s3 = FSL::ST::St_detailed[FSL::ST::St_class_id[$game_party.members[@actor].class_id][2]][1]
    @command_window = Window_Command.new(272, [s1, s2, s3], 3)
    @command_window.y = 88
    @command_window.active = true
  end
  #--------------------------------------------------------------------------
  # ● 结束处理
  #--------------------------------------------------------------------------
  def terminate
    super
    @skill_tree_window.dispose
    @base_window.dispose
    @base_window2.dispose
    @skill_data.dispose
    @skill_status_window.dispose
    @skill_actor_window.dispose
    @command_window.dispose
  end
  #--------------------------------------------------------------------------
  # ● 更新画面
  #--------------------------------------------------------------------------
  def update
    super
    @skill_tree_window.update
    @skill_actor_window.update
    @skill_status_window.update
    @base_window.update
    @base_window2.update
    @skill_data.update
    @command_window.update
    
    if @skill_actor_window.active
      if @skill_tree_window.visible == false
        if Input.trigger?(Input::R)
          Sound.play_cursor
          @actor += 1
          @actor %= $game_party.members.size
          $scene = Scene_Skill_Tree.new(@actor)
          @skill_tree_window.ST_actor_data($game_party.members[@actor].id)
        elsif Input.trigger?(Input::L)
          Sound.play_cursor
          @actor += $game_party.members.size - 1
          @actor %= $game_party.members.size
          $scene = Scene_Skill_Tree.new(@actor)
          @skill_tree_window.ST_actor_data($game_party.members[@actor].id)
        end
      end
    end
    if @command_window.active
      update_command_selection
    elsif @skill_tree_window.active
      update_skill_tree_selection
    end
  end
  #--------------------------------------------------------------------------
  # ● 更新命令窗口
  #--------------------------------------------------------------------------
  def update_command_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      $scene = Scene_Map.new
    elsif Input.trigger?(Input::C)
      case @command_window.index
      when 0  # 第一天赋
        Sound.play_decision
        @command_window.active = false
        @base_window.visible = false
        @base_window2.visible = false
        @skill_actor_window.active = false
        @skill_tree_window.active = true
        @skill_tree_window.visible = true
        @skill_tree_window.index = FSL::ST::St_class_id[$game_party.members[@actor].class_id][0]
        @skill_tree_window.ST_actor_data($game_party.members[@actor].id)
        @skill_status_window.visible = true
        @skill_status_window.skill = @skill_tree_window.STK
      when 1  # 第二天赋
        Sound.play_decision
        @command_window.active = false
        @base_window.visible = false
        @base_window2.visible = false
        @skill_actor_window.active = false
        @skill_tree_window.active = true
        @skill_tree_window.visible = true
        @skill_tree_window.index = FSL::ST::St_class_id[$game_party.members[@actor].class_id][1]
        @skill_tree_window.ST_actor_data($game_party.members[@actor].id)
        @skill_status_window.visible = true
        @skill_status_window.skill = @skill_tree_window.STK
      when 2  # 第三天赋
        Sound.play_decision
        @command_window.active = false
        @base_window.visible = false
        @base_window2.visible = false
        @skill_actor_window.active = false
        @skill_tree_window.active = true
        @skill_tree_window.visible = true
        @skill_tree_window.index = FSL::ST::St_class_id[$game_party.members[@actor].class_id][2]
        @skill_tree_window.ST_actor_data($game_party.members[@actor].id)
        @skill_status_window.visible = true
        @skill_status_window.skill = @skill_tree_window.STK
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 更新天赋窗口
  #--------------------------------------------------------------------------
  def update_skill_tree_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      @command_window.active = true
      @base_window.visible = true
      @base_window2.visible = true
      @skill_actor_window.active = true
      @skill_tree_window.active = false
      @skill_tree_window.visible = false
      @skill_status_window.visible = false
      @skill_tree_window.ST_actor_data2
    end
      if Input.trigger?(Input::LEFT) || Input.trigger?(Input::RIGHT) || Input.trigger?(Input::UP) || Input.trigger?(Input::DOWN) || Input.trigger?(Input::X)
        @skill_status_window.skill = @skill_tree_window.STK
        @skill_tree_window.ST_actor_data3
        @skill_data.refresh
      end
  end
end
#==============================================================================
# ■ Window_Skill_Tree
#------------------------------------------------------------------------------
#  天赋技能
#==============================================================================
class Window_Skill_Tree < Window_Selectable
  #--------------------------------------------------------------------------
  # ● 初始化对像
  #     x      : 窗口 X 座标
  #     y      : 窗口 Y 座标
  #--------------------------------------------------------------------------
  def initialize(x, y, width, height, actortree)
    @ST_id = actortree.id
    @ST_index = FSL::ST::St_class_id[actortree.class_id][0]
    super(x, y, width, height)
    @ST_x_current = 0
    @ST_y_current = 0
    @ST_width = 48
    @ST_height = 48
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    
    @ST_array = Array.new(FSL::ST::St_Base_x){Array.new(FSL::ST::St_Base_y,0)}
    for i in 2...FSL::ST::St_detailed[@ST_index].size
      x = FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][0]
      y = FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][1]
      @ST_array[x][y] = 1
    end
    for j in 0...FSL::ST::St_Base_y
      for i in 0...FSL::ST::St_Base_x
        if @ST_array[i][j] == 1
          self.cursor_rect = Rect.new((i * @ST_width) - 12,(j * @ST_height) - 12, 48, 48)
          p = 1
          @ST_x_current = i
          @ST_y_current = j
          break
        end
      end
      break if p == 1
    end
    for i in 2...FSL::ST::St_detailed[@ST_index].size
      bx = FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][0]
      by = FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][1]
      x = FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][0] * @ST_width + 12
      y = FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][1] * @ST_height + 12
      if FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][4] == FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][2].size
        m =  FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][2][FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][2].size - 1]
      else
        m =  FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][2][FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][4]]
      end
      n = FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][4]
      l = FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][2].size
      
      
      
      t = true
      #技能总深度是否达到
      if statistics < FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][1] * FSL::ST::St_lv
        t = false
      end#技能总深度是否达到
      
        #技能前置是否满修
        for h in 0...FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][3].size
        if FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][3][h] > 0
          ax = FSL::ST::St_skill[FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][3][h]][0]
          ay = FSL::ST::St_skill[FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][3][h]][1]
          x2 = ax * @ST_width + 12
          y2 = ay * @ST_height + 12
          if FSL::ST::St_skill[FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][3][h]][4] != FSL::ST::St_skill[FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][3][h]][2].size
            t = false
          end
      
          bitmap = Cache.load_bitmap("Graphics/System/", "xy")
          if ay == by
            if ax > bx
              rect = Rect.new(48, 48, 48, 48)
              self.contents.blt(x2 - 12, y2 - 12, bitmap, rect, t ? 255 : 128)
              rect = Rect.new(48, 0, 48, 48)
              self.contents.blt(x - 12, y - 12, bitmap, rect, t ? 255 : 128)
              rect = Rect.new(192, 48, 48, 48)
              for r in (bx + 1)...ax
                self.contents.blt(r * @ST_width, y2 - 12, bitmap, rect, t ? 255 : 128)
              end
            elsif bx > ax
              rect = Rect.new(96, 48, 48, 48)
              self.contents.blt(x2 - 12, y2 - 12, bitmap, rect, t ? 255 : 128)
              rect = Rect.new(96, 0, 48, 48)
              self.contents.blt(x - 12, y - 12, bitmap, rect, t ? 255 : 128)
              rect = Rect.new(192, 48, 48, 48)
              for r in (ax + 1)...bx
                self.contents.blt(r * @ST_width, y2 - 12, bitmap, rect, t ? 255 : 128)
              end
            end
          elsif by > ay
            if ax > bx
              rect = Rect.new(48, 48, 48, 48)
              self.contents.blt(x2 - 12, y2 - 12, bitmap, rect, t ? 255 : 128)
              rect = Rect.new(144, 48, 48, 48)
              self.contents.blt(x - 12, y2 - 12, bitmap, rect, t ? 255 : 128)
              rect = Rect.new(192, 48, 48, 48)
              for r in (bx + 1)...ax
                self.contents.blt(r * @ST_width, y2 - 12, bitmap, rect, t ? 255 : 128)
              end
            elsif bx > ax
              rect = Rect.new(96, 48, 48, 48)
              self.contents.blt(x2 - 12, y2 - 12, bitmap, rect, t ? 255 : 128)
              rect = Rect.new(144, 0, 48, 48)
              self.contents.blt(x - 12, y2 - 12, bitmap, rect, t ? 255 : 128)
              rect = Rect.new(192, 48, 48, 48)
              for r in (ax + 1)...bx
                self.contents.blt(r * @ST_width, y2 - 12, bitmap, rect, t ? 255 : 128)
              end
            else
              rect = Rect.new(0, 48, 48, 48)
              self.contents.blt(x2 - 12, y2 - 12, bitmap, rect, t ? 255 : 128)
            end
            rect = Rect.new(0, 0, 48, 48)
            self.contents.blt(x - 12, y - 12, bitmap, rect, t ? 255 : 128)
            rect = Rect.new(192, 0, 48, 48)
            for r in (ay + 1)...by
                self.contents.blt(x - 12, r * @ST_height, bitmap, rect, t ? 255 : 128)
            end
          end
        
        end
        end#技能前置是否满修
      
      draw_icon($data_skills[m].icon_index, x, y, t)
      self.contents.font.color = normal_color
      self.contents.draw_text(x - 8, y + 16, 48, WLH, n, 0)
      self.contents.font.color = system_color
      self.contents.draw_text(x - 12, y + 16, 44, WLH, l, 2)
      self.contents.font.color = normal_color
      
    end
  end
  #--------------------------------------------------------------------------
  # ● 统计
  #--------------------------------------------------------------------------
  def statistics
      k = 0
      for i in 2...FSL::ST::St_detailed[@ST_index].size
        k += FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][4]
      end
      return k
  end
  #--------------------------------------------------------------------------
  # ● 更新
  #--------------------------------------------------------------------------
  def update
    super
    
    if self.active == true #窗口活动则判断输入
    
      if Input.trigger?(Input::LEFT)
        Sound.play_cursor
        loop do
          if @ST_x_current == 0
            @ST_x_current = (FSL::ST::St_Base_x - 1)
          else
            Sound.play_cursor
            @ST_x_current -= 1 
          end
          if @ST_array[@ST_x_current][@ST_y_current] == 1
            break
          end
        end
        update_cursor
        return
      end
      
      if Input.trigger?(Input::RIGHT)
        Sound.play_cursor
        loop do
          if @ST_x_current == (FSL::ST::St_Base_x - 1)
            @ST_x_current = 0
          else
            @ST_x_current += 1
          end
          if @ST_array[@ST_x_current][@ST_y_current] == 1
            break
          end
        end
        update_cursor
        return
      end
      
      if Input.trigger?(Input::UP)
        Sound.play_cursor
        i = @ST_x_current - 1
        j = @ST_y_current
        loop do
          if i == -1
            i = FSL::ST::St_Base_x - 1
            j -= 1
          end
          j = FSL::ST::St_Base_y - 1 if j == -1
          if @ST_array[i][j] == 1
            @ST_x_current = i
            @ST_y_current = j
            break
          end
          i -= 1
        end
        update_cursor
        return
      end
      
      if Input.trigger?(Input::DOWN)
        Sound.play_cursor
        i = @ST_x_current + 1
        j = @ST_y_current
        loop do
          if i == FSL::ST::St_Base_x
            i = 0
            j += 1
          end
          j = 0 if j == FSL::ST::St_Base_y
          if @ST_array[i][j] == 1
            @ST_x_current = i
            @ST_y_current = j
            break
          end
          i += 1
        end
        update_cursor
        return
      end
      
      if Input.trigger?(Input::X)
        if @st_data == 0
          Sound.play_buzzer
        else
        for i in 2...FSL::ST::St_detailed[@ST_index].size
          xx = FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][0]
          yy = FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][1]
          t = true
          #技能总深度是否达到
          if statistics < FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][1] * FSL::ST::St_lv
            t = false
          end#技能总深度是否达到
          
          for h in 0...FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][3].size
          if FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][3][h] > 0
            if FSL::ST::St_skill[FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][3][h]][4] != FSL::ST::St_skill[FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][3][h]][2].size
              t = false
            end
          end
          end
        
          if @ST_x_current == xx && @ST_y_current == yy
            if FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][4] == FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][2].size
              Sound.play_buzzer
            else
              if t == true
                if FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][4] > 0
                  $game_actors[@ST_id].forget_skill(FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][2][FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][4] - 1])
                end
                $game_actors[@ST_id].learn_skill(FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][2][FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][4]])
                FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][4] += 1
                @st_data -= 1
                
                Sound.play_cursor
              else
                Sound.play_buzzer
              end
            end
          end
        end
        
        self.contents.clear
        for i in 2...FSL::ST::St_detailed[@ST_index].size
          bx = FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][0]
          by = FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][1]
          x = FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][0] * @ST_width + 12
          y = FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][1] * @ST_height + 12
          if FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][4] == FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][2].size
            m =  FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][2][FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][2].size - 1]
          else
            m =  FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][2][FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][4]]
          end
          n = FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][4]
          l = FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][2].size
        
          t = true
          #技能总深度是否达到
          if statistics < FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][1] * FSL::ST::St_lv
            t = false
          end#技能总深度是否达到
          
          #技能前置是否满修
          for h in 0...FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][3].size
          if FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][3][h] > 0
            ax = FSL::ST::St_skill[FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][3][h]][0]
            ay = FSL::ST::St_skill[FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][3][h]][1]
            x2 = ax * @ST_width + 12
            y2 = ay * @ST_height + 12
            if FSL::ST::St_skill[FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][3][h]][4] != FSL::ST::St_skill[FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][3][h]][2].size
              t = false
            end
            bitmap = Cache.load_bitmap("Graphics/System/", "xy")
            if ay == by
              if ax > bx
                rect = Rect.new(48, 48, 48, 48)
                self.contents.blt(x2 - 12, y2 - 12, bitmap, rect, t ? 255 : 128)
                rect = Rect.new(48, 0, 48, 48)
                self.contents.blt(x - 12, y - 12, bitmap, rect, t ? 255 : 128)
                rect = Rect.new(192, 48, 48, 48)
                for r in (bx + 1)...ax
                  self.contents.blt(r * @ST_width, y2 - 12, bitmap, rect, t ? 255 : 128)
                end
              elsif bx > ax
                rect = Rect.new(96, 48, 48, 48)
                self.contents.blt(x2 - 12, y2 - 12, bitmap, rect, t ? 255 : 128)
                rect = Rect.new(96, 0, 48, 48)
                self.contents.blt(x - 12, y - 12, bitmap, rect, t ? 255 : 128)
                rect = Rect.new(192, 48, 48, 48)
                for r in (ax + 1)...bx
                  self.contents.blt(r * @ST_width, y2 - 12, bitmap, rect, t ? 255 : 128)
                end
              end
            elsif by > ay
              if ax > bx
                rect = Rect.new(48, 48, 48, 48)
                self.contents.blt(x2 - 12, y2 - 12, bitmap, rect, t ? 255 : 128)
                rect = Rect.new(144, 48, 48, 48)
                self.contents.blt(x - 12, y2 - 12, bitmap, rect, t ? 255 : 128)
                rect = Rect.new(192, 48, 48, 48)
                for r in (bx + 1)...ax
                  self.contents.blt(r * @ST_width, y2 - 12, bitmap, rect, t ? 255 : 128)
                end
              elsif bx > ax
                rect = Rect.new(96, 48, 48, 48)
                self.contents.blt(x2 - 12, y2 - 12, bitmap, rect, t ? 255 : 128)
                rect = Rect.new(144, 0, 48, 48)
                self.contents.blt(x - 12, y2 - 12, bitmap, rect, t ? 255 : 128)
                rect = Rect.new(192, 48, 48, 48)
                for r in (ax + 1)...bx
                  self.contents.blt(r * @ST_width, y2 - 12, bitmap, rect, t ? 255 : 128)
                end
              else
                rect = Rect.new(0, 48, 48, 48)
                self.contents.blt(x2 - 12, y2 - 12, bitmap, rect, t ? 255 : 128)
              end
              rect = Rect.new(0, 0, 48, 48)
              self.contents.blt(x - 12, y - 12, bitmap, rect, t ? 255 : 128)
              rect = Rect.new(192, 0, 48, 48)
              for r in (ay + 1)...by
                self.contents.blt(x - 12, r * @ST_height, bitmap, rect, t ? 255 : 128)
              end
            end
          
          end
          end#技能前置是否满修
        
          draw_icon($data_skills[m].icon_index, x, y, t)
          self.contents.font.color = normal_color
          self.contents.draw_text(x - 8, y + 16, 48, WLH, n, 0)
          self.contents.font.color = system_color
          self.contents.draw_text(x - 12, y + 16, 44, WLH, l, 2)
          self.contents.font.color = normal_color
        
        end
      end#@st_data
      end#(Input::X)
  
    end #窗口活动则判断输入
  end
  #--------------------------------------------------------------------------
  # ● 更新光标
  #--------------------------------------------------------------------------
  def update_cursor
    if @ST_x_current < 0 || @ST_y_current < 0       # 当光标位置小于0
      self.cursor_rect.empty                        # 隐藏光标
    else
      x = @ST_x_current * @ST_width
      y = @ST_y_current * @ST_height
      rect = Rect.new(x, y, 48 , 48)
      self.cursor_rect = rect                       # 更新光标矩形
    end
  end
  #--------------------------------------------------------------------------
  # ● 设置天赋
  #     index : 天赋
  #--------------------------------------------------------------------------
  def index=(index)
    if @ST_index != index
      @ST_index = index
    end
  end
  #--------------------------------------------------------------------------
  # ● 获取技能
  #--------------------------------------------------------------------------
  def STK
    for i in 2...FSL::ST::St_detailed[@ST_index].size
      x = FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][0]
      y = FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][1]
      if @ST_x_current == x && @ST_y_current == y
        if FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][4] == FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][2].size
          return FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][2][FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][2].size - 1]
        else
          return FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][2][FSL::ST::St_skill[FSL::ST::St_detailed[@ST_index][i]][4]]
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 读取角色具体天赋数值
  #--------------------------------------------------------------------------
  def ST_actor_data(ac)
    @st_actor_data = ac
    @st_data = $game_actors[@st_actor_data].level * FSL::ST::St_up
    for j in 0..2
      m = 2
      if FSL::ST::St_actor[@st_actor_data][j] != nil
        s = FSL::ST::St_class_id[$game_actors[@st_actor_data].class_id][j]
        for i in FSL::ST::St_actor[@st_actor_data][j]
          @st_data -= i
          FSL::ST::St_skill[FSL::ST::St_detailed[s][m]][4] = i
          m += 1
        end
      end
    end
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 存储角色具体天赋数值
  #--------------------------------------------------------------------------
  def ST_actor_data2
    for j in 0..2
      FSL::ST::St_actor[@st_actor_data][j].clear
      p = FSL::ST::St_class_id[$game_actors[@st_actor_data].class_id][j]
      for i in 2...FSL::ST::St_detailed[p].size
        FSL::ST::St_actor[@st_actor_data][j].push(FSL::ST::St_skill[FSL::ST::St_detailed[p][i]][4])
        FSL::ST::St_skill[FSL::ST::St_detailed[p][i]][4] = 0
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 更新角色具体天赋数值
  #--------------------------------------------------------------------------
  def ST_actor_data3
    for j in 0..2
      FSL::ST::St_actor[@st_actor_data][j].clear
      p = FSL::ST::St_class_id[$game_actors[@st_actor_data].class_id][j]
      for i in 2...FSL::ST::St_detailed[p].size
        FSL::ST::St_actor[@st_actor_data][j].push(FSL::ST::St_skill[FSL::ST::St_detailed[p][i]][4])
      end
    end
  end
end
#==============================================================================
# ■ Window_actor_Tree
#------------------------------------------------------------------------------
#  天赋
#==============================================================================
class Window_actor_Tree < Window_Base
  #--------------------------------------------------------------------------
  # ● 初始化对像
  #     actor : 角色
  #--------------------------------------------------------------------------
  def initialize(actor)
    super(0, 0, 272, 88)
    @actor = actor
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    draw_actor_name(@actor, 0, 0)
    draw_actor_class(@actor, 0, 32)
    draw_STface(@actor.face_name, @actor.face_index, 128, 0)
  end
  #--------------------------------------------------------------------------
  # ● 设置角色
  #     actor : 角色
  #--------------------------------------------------------------------------
  def actor=(actor)
    if @actor != actor
      @actor = actor
      refresh
    end
  end
  #--------------------------------------------------------------------------
  # ● 绘制头像部分图
  #     face_name  : 头像文件名
  #     face_index : 头像号码
  #     x     : 描画目标 X 坐标
  #     y     : 描画目标 Y 坐标
  #     size       : 显示大小
  #--------------------------------------------------------------------------
  def draw_STface(face_name, face_index, x, y, size = 96)
    bitmap = Cache.face(face_name)
    rect = Rect.new(0, 0, 0, 0)
    rect.x = face_index % 4 * 96 + (96 - size) / 2
    rect.y = face_index / 4 * 96 + (96 - size) / 2 + 16
    rect.width = size
    rect.height = 64
    self.contents.blt(x, y, bitmap, rect)
    bitmap.dispose
  end
end
#==============================================================================
# ■ Window_skill_status
#------------------------------------------------------------------------------
#  技能
#==============================================================================
class Window_skill_status < Window_Base
  #--------------------------------------------------------------------------
  # ● 初始化对像
  #--------------------------------------------------------------------------
  def initialize(skill = -1)
    super(0, 328, 544, 88)
    @skill = skill
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    if @skill != -1
      self.contents.clear
      self.contents.draw_text(24, 0, 544, WLH, $data_skills[@skill].name)
      draw_icon($data_skills[@skill].icon_index, 0, 0)
      self.contents.draw_text(0, 32, 544, WLH, $data_skills[@skill].description)
    end
  end
  #--------------------------------------------------------------------------
  # ● 设置技能
  #--------------------------------------------------------------------------
  def skill=(skill)
    if @skill != skill
      @skill = skill
      refresh
    end
  end
end
#==============================================================================
# ■ Window_skill_data
#------------------------------------------------------------------------------
#  数值
#==============================================================================
class Window_skill_data < Window_Base
  #--------------------------------------------------------------------------
  # ● 初始化对像
  #     actor : 角色id
  #--------------------------------------------------------------------------
  def initialize(actor)
    super(0, 144, 272, 184)
    @actor = actor
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @st_data = $game_actors[@actor].level * FSL::ST::St_up
    for i in 0..2
      p = 0
      if FSL::ST::St_actor[@actor][i] != nil
        for j in FSL::ST::St_actor[@actor][i]
          p += j
        end
      end
      self.contents.draw_text(i * (272/3), 0, 272, WLH, p)
      @st_data -= p
    end
    self.contents.draw_text(0, WLH, 272, WLH, @st_data)
  end
end
 我尝试队伍排列脚本 把2号人物排到第一个,但是执行$scene = Scene_Skill_Tree.new时 脚本就出错了。
 
 
   | 
 |