查看: 1862|回复: 3

[已经过期] 请问怎么用事件调用此脚本(MOG_Saga_技能系统)窗口啊?

[复制链接]
梦石
0
星屑
4631
在线时间
818 小时
注册时间
2017-7-14
回帖
116

开拓者

发表于 2018-1-11 22:19:32 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
  1. #==============================================================================
  2. # +++ MOG - Saga 技能系统 (v1.0) +++
  3. #==============================================================================
  4. # By Moghunter
  5. # [url]https://atelierrgss.wordpress.com/[/url]
  6. #==============================================================================
  7. # 本脚本启用技能属性经验值和武器种类经验值系统,经验值满后会升级,等级越高的属性技
  8. # 能或武器种类可以造成越高的伤害。本脚本的灵感来源于游戏Romancing Saga.
  9. #==============================================================================
  10. # 注意 - 角色或该角色的职业需要添加升级后新技能的技能类型。
  11. #        例如 - 对于没有添加"魔法"技能类型的角色,是无法学会魔法类型的技能的。
  12. #==============================================================================

  13. #==============================================================================
  14. # ● 手动升级技能.
  15. #==============================================================================
  16. # 使用以下脚本来升级属性等级.
  17. #
  18. # element_lv_up(角色ID , 属性ID, 数值)
  19. #
  20. # 例如: element_lv_up(2,5,1)
  21. #==============================================================================
  22. # 使用以下脚本来升级武器种类等级.
  23. #
  24. # weapon_lv_up(角色ID , 武器类型ID, 数值)
  25. #
  26. # 例如: weapon_lv_up(2,5,1)
  27. #==============================================================================

  28. #==============================================================================
  29. # ● 手动添加属性经验.
  30. #==============================================================================
  31. # 手动添加属性经验的脚本:
  32. #
  33. # element_exp_up(角色ID , 属性ID, 数值)
  34. #
  35. # 例如: element_exp_up(2,5,20)
  36. #==============================================================================
  37. # 手动添加武器类型的脚本:
  38. #
  39. # weapon_exp_up(角色ID , 武器类型ID, 数值)
  40. #
  41. # weapon_exp_up(2,5,20)
  42. #==============================================================================

  43. module MOG_SAGA_SKILL
  44.   #----------------------------------------------------------------------------
  45.   # 是否启用升级时学会新技能功能.
  46.   #----------------------------------------------------------------------------
  47.   ENABLE_SKILL_LEARNING = true
  48.   #----------------------------------------------------------------------------
  49.   # 设定升级时学会新技能的几率,属性等级越高,学会新技能的几率越大。
  50.   #----------------------------------------------------------------------------
  51.   SUCCESS_RATE = 20
  52.   #----------------------------------------------------------------------------
  53.   # 学会新技能是播放的动画.
  54.   #----------------------------------------------------------------------------
  55.   LEARNING_ANIMATION_ID = 147
  56.   #----------------------------------------------------------------------------
  57.   # 战斗日志中显示学会技能的文本.
  58.   #----------------------------------------------------------------------------
  59.   BATTLE_LOG_TEXT = "已学会"
  60.   #----------------------------------------------------------------------------
  61.   # 设定学会的新技能(有关属性)
  62.   #
  63.   # ELEMENT_LEARN_SKILL[ A ] = {B => C, B => C, B=> C, ...}
  64.   #
  65.   # A - 属性ID.
  66.   # B - 新技能ID.
  67.   # C - 学会该技能需要的最小等级.
  68.   #----------------------------------------------------------------------------
  69.   ELEMENT_LEARN_SKILL = []
  70.   ELEMENT_LEARN_SKILL[1] = {100=>5, 105=>10, 106=>15}               #物理
  71.   ELEMENT_LEARN_SKILL[2] = {26=>4 ,27=>12 , 28=>20, 29=>8,          #吸收
  72.                             30=>24 ,31=>6, 32=>14, 33=>10, 34=>26}
  73.   ELEMENT_LEARN_SKILL[3] = {51=>4 ,52=>15 ,52=>8 ,53=>25 ,41=>6}    #火  
  74.   ELEMENT_LEARN_SKILL[4] = {55=>4 ,56=>15 ,57=>8 ,58=>25 ,26=>6}    #冰
  75.   ELEMENT_LEARN_SKILL[5] = {59=>4 ,60=>15 ,61=>8 ,62=>25 ,40=>6}    #雷
  76.   ELEMENT_LEARN_SKILL[6] = {63=>4, 64 =>20 , 44=>10}                #水
  77.   ELEMENT_LEARN_SKILL[7] = {65=>4, 66 =>20 , 39=>10}                #地
  78.   ELEMENT_LEARN_SKILL[8] = {67=>4, 68 =>20 , 35=>10}                #风
  79.   ELEMENT_LEARN_SKILL[9] = {69=>4, 70 =>20 , 49=>10}                #圣
  80.   ELEMENT_LEARN_SKILL[10] = {71=>4, 72 =>20 , 47=>10}               #暗
  81.   #----------------------------------------------------------------------------
  82.   # 设定学会的新技能(有关武器)
  83.   #
  84.   # WEAPON_LEARN_SKILL[ A ] = {B => C, B => C, B=> C, ...}
  85.   #
  86.   # A - 武器类型ID
  87.   # B - 新技能ID.
  88.   # C - 学会该技能需要的最小等级.
  89.   #----------------------------------------------------------------------------
  90.   WEAPON_LEARN_SKILL = []
  91.   WEAPON_LEARN_SKILL[1] = {84=>10 , 84=> 25}   #斧头
  92.   WEAPON_LEARN_SKILL[2] = {88=>10 , 89=> 25}   #爪
  93.   WEAPON_LEARN_SKILL[3] = {93=>10 , 94=> 25}   #长枪
  94.   WEAPON_LEARN_SKILL[4] = {95=>10 , 99=> 25}   #剑
  95.   WEAPON_LEARN_SKILL[5] = {100=>10 , 102=> 15, 103=> 25} #刀
  96.   WEAPON_LEARN_SKILL[6] = {108=>10 , 109=> 25} #弓
  97.   WEAPON_LEARN_SKILL[7] = {113=>10 , 114=> 25} #Dagger
  98.   WEAPON_LEARN_SKILL[8] = {80=>5 , 81=> 10}    #Gun
  99.   #----------------------------------------------------------------------------
  100.   #  设定角色无法学会的技能
  101.   #
  102.   # ACTOR_NOT_LEARN_SKILL_ID[角色ID] = [技能ID1,技能ID2,技能ID3 ...]
  103.   #----------------------------------------------------------------------------
  104.   ACTOR_NOT_LEARN_SKILL_ID = []
  105.   #ACTOR_NOT_LEARN_SKILL_ID[1] = [26,27,28,29,30]
  106.   #ACTOR_NOT_LEARN_SKILL_ID[2] = [100,110]
  107. end
  108. #==============================================================================
  109. # ● 属性等级
  110. #==============================================================================
  111. module MOG_ATTRIBUTE_LEVEL
  112.   #----------------------------------------------------------------------------
  113.   # 不在"属性/武器等级"窗口显示的属性ID
  114.   #----------------------------------------------------------------------------
  115.   DISABLE_ELEMENT_ID = []
  116.   #----------------------------------------------------------------------------
  117.   # 不在"属性/武器等级"窗口显示的武器类型ID
  118.   #----------------------------------------------------------------------------
  119.   DISABLE_WEAPON_ID = []
  120.   #----------------------------------------------------------------------------
  121.   # 角色空手攻击的属性
  122.   #----------------------------------------------------------------------------
  123.   BARE_HANDS_ELEMENT_ID = 1
  124.   #----------------------------------------------------------------------------
  125.   # 升级所需经验基础数值. (所需总经验值 = 等级数 x 基础数值)
  126.   #----------------------------------------------------------------------------
  127.   NEXT_EXP_LEVEL_BASE = 5
  128.   #----------------------------------------------------------------------------
  129.   # 最高等级.
  130.   #----------------------------------------------------------------------------
  131.   MAX_ATTRIBUTE_LEVEL = 100
  132.   #----------------------------------------------------------------------------
  133.   # 每升一级增加的伤害比率(%).
  134.   #----------------------------------------------------------------------------
  135.   DAMAGE_PERCENTAGE_PER_LEVEL = 5
  136.   #----------------------------------------------------------------------------
  137.   # 属性/武器等级窗口的名称
  138.   #----------------------------------------------------------------------------
  139.   ATTRIBUTE_LEVEL_NAME = "属性/武器等级"
  140.   #----------------------------------------------------------------------------
  141.   # 在窗口中显示的文字.
  142.   #----------------------------------------------------------------------------
  143.   PRESS_BUTTON_TEXT = "(Z键) 查看属性/武器等级"
  144. end

  145. $imported = {} if $imported.nil?
  146. $imported[:mog_saga_skill_system] = true

  147. #==============================================================================
  148. # ■ Game Interpreter
  149. #==============================================================================
  150. class Game_Interpreter

  151.   #--------------------------------------------------------------------------
  152.   # ● Element LV
  153.   #--------------------------------------------------------------------------
  154.   def element_lv_up(actor_id,atr_id,value)
  155.       return if atr_id < 0
  156.       return if MOG_ATTRIBUTE_LEVEL::DISABLE_ELEMENT_ID.include?(atr_id)
  157.       $game_party.members.each do |actor|
  158.       if actor.id == actor_id and ![nil,""].include?(actor.attribute_level[0][atr_id][5])
  159.          actor.attribute_level[0][atr_id][0] += value
  160.          actor.attribute_level[0][atr_id][0] = 1 if actor.attribute_level[0][atr_id][0] < 0
  161.          actor.attribute_level[0][atr_id][0] = MOG_ATTRIBUTE_LEVEL::MAX_ATTRIBUTE_LEVEL if actor.attribute_level[0][atr_id][0] > MOG_ATTRIBUTE_LEVEL::MAX_ATTRIBUTE_LEVEL
  162.          actor.attribute_level[0][atr_id][1] = 0
  163.       end
  164.       end   
  165.   end

  166.   #--------------------------------------------------------------------------
  167.   # ● Element EXP
  168.   #--------------------------------------------------------------------------
  169.   def element_exp_up(actor_id,atr_id,value)
  170.       return if atr_id < 0
  171.       return if MOG_ATTRIBUTE_LEVEL::DISABLE_ELEMENT_ID.include?(atr_id)
  172.       $game_party.members.each do |actor|
  173.       if actor.id == actor_id and ![nil,""].include?(actor.attribute_level[0][atr_id][5])
  174.          actor.attribute_level[0][atr_id][1] += value.abs
  175.          element_lv_up(actor_id,atr_id,1) if actor.atr_level_up?(atr_id,0)
  176.       end
  177.       end   
  178.   end  
  179.   
  180.   #--------------------------------------------------------------------------
  181.   # ● Weapon LV
  182.   #--------------------------------------------------------------------------
  183.   def weapon_lv_up(actor_id,atr_id,value)
  184.       return if atr_id < 0
  185.       return if MOG_ATTRIBUTE_LEVEL::DISABLE_WEAPON_ID.include?(atr_id)
  186.       $game_party.members.each do |actor|
  187.       if actor.id == actor_id and ![nil,""].include?(actor.attribute_level[1][atr_id][5])
  188.          actor.attribute_level[1][atr_id][0] += value
  189.          actor.attribute_level[1][atr_id][0] = 1 if actor.attribute_level[1][atr_id][0] < 0
  190.          actor.attribute_level[1][atr_id][0] = MOG_ATTRIBUTE_LEVEL::MAX_ATTRIBUTE_LEVEL if actor.attribute_level[1][atr_id][0] > MOG_ATTRIBUTE_LEVEL::MAX_ATTRIBUTE_LEVEL
  191.          actor.attribute_level[1][atr_id][1] = 0
  192.       end
  193.       end      
  194.   end
  195.   
  196.   #--------------------------------------------------------------------------
  197.   # ● Weapon LV
  198.   #--------------------------------------------------------------------------
  199.   def weapon_exp_up(actor_id,atr_id,value)
  200.       return if atr_id < 0
  201.       return if MOG_ATTRIBUTE_LEVEL::DISABLE_WEAPON_ID.include?(atr_id)
  202.       $game_party.members.each do |actor|
  203.       if actor.id == actor_id and ![nil,""].include?(actor.attribute_level[1][atr_id][5])
  204.          actor.attribute_level[1][atr_id][1] += value.abs
  205.          weapon_lv_up(actor_id,atr_id,1) if actor.atr_level_up?(atr_id,1)
  206.       end
  207.       end      
  208.   end  
  209.   
  210. end

  211. #==============================================================================
  212. # ■ Window_Status
  213. #==============================================================================
  214. class Window_Attribute_Level < Window_Selectable
  215.   
  216.   #--------------------------------------------------------------------------
  217.   # ● Object Initialization
  218.   #--------------------------------------------------------------------------
  219.   def initialize(actor)
  220.       super(0, 0, Graphics.width, Graphics.height)
  221.       self.visible = false
  222.       @actor = actor
  223.       refresh
  224.   end

  225.   #--------------------------------------------------------------------------
  226.   # ● Set Actor
  227.   #--------------------------------------------------------------------------
  228.   def actor=(actor)
  229.       return if @actor == actor
  230.       @actor = actor
  231.       refresh
  232.   end

  233.   #--------------------------------------------------------------------------
  234.   # ● Actor Elements
  235.   #--------------------------------------------------------------------------
  236.   def actor_attributes
  237.       atr = []
  238.       for i in @actor.attribute_level[0]
  239.           next if i == nil or i[5] == ""
  240.           next if i[4] == MOG_ATTRIBUTE_LEVEL::BARE_HANDS_ELEMENT_ID
  241.           next if MOG_ATTRIBUTE_LEVEL::DISABLE_ELEMENT_ID.include?(i[4])
  242.           atr.push(i)
  243.       end  
  244.       atr.push(@actor.attribute_level[0][MOG_ATTRIBUTE_LEVEL::BARE_HANDS_ELEMENT_ID])
  245.       for i in @actor.attribute_level[1]
  246.           next if i == nil or i[5] == ""
  247.           next if MOG_ATTRIBUTE_LEVEL::DISABLE_WEAPON_ID.include?(i[4])
  248.           atr.push(i)
  249.       end         
  250.       return atr
  251.    end
  252.   
  253.   #--------------------------------------------------------------------------
  254.   # ● Refresh
  255.   #--------------------------------------------------------------------------
  256.   def refresh
  257.     contents.clear
  258.     atrbutes = actor_attributes  
  259.     sw = Graphics.width - 16 ; sh = Graphics.height - 80
  260.     h_limit = sh / 32 ; x = 0 ; y = 48
  261.     sp = atrbutes.size > h_limit * 2 ? 3 : 2 ; x_space = sw / sp
  262.     change_color(normal_color)
  263.     draw_text(0,0,sw,32,MOG_ATTRIBUTE_LEVEL::ATTRIBUTE_LEVEL_NAME.to_s, 1)
  264.     draw_horz_line(line_height * 1)   
  265.     atrbutes.each_with_index do |i, index|
  266.         x2 = x_space * (index / h_limit)
  267.         y2 = -((h_limit * 32) * (index / h_limit))
  268.         change_color(normal_color)
  269.         draw_text(x + x2,y + y2 + 32 * index,x_space - 64,32,i[5].to_s, 0)
  270.         contents.font.color = Color.new(200,200,200,255)
  271.         draw_text(x + x2 + x_space - 64,y + y2 + 32 * index,64,32,"LV".to_s, 0)
  272.         draw_text(x + x2 + x_space - 74,y + y2 + 32 * index,64,32,i[0].to_s.to_s, 2)
  273.         draw_gauge(x + x2, line_height - 12 + y + y2 + 32 * index, x_space - 64, i, tp_gauge_color1, tp_gauge_color2)
  274.     end
  275.   end

  276.   #--------------------------------------------------------------------------
  277.   # ● Draw Gauge
  278.   #--------------------------------------------------------------------------
  279.   def draw_gauge(x, y, width, atr, color1, color2)
  280.       fill_w = width * atr[1] / @actor.atr_next_exp(atr[4],atr[6])
  281.       fill_w = width if @actor.atr_max_level?(atr[4],atr[6])
  282.       gauge_y = y + line_height - 8
  283.       contents.fill_rect(x, gauge_y, width, 6, gauge_back_color)
  284.       contents.gradient_fill_rect(x, gauge_y, fill_w, 6, color1, color2)
  285.   end  
  286.   
  287.   #--------------------------------------------------------------------------
  288.   # ● Draw Horizontal Line
  289.   #--------------------------------------------------------------------------
  290.   def draw_horz_line(y)
  291.       line_y = y + line_height / 2 - 1
  292.       contents.fill_rect(0, line_y, contents_width, 2, line_color)
  293.   end
  294.   
  295.   #--------------------------------------------------------------------------
  296.   # ● Line Color
  297.   #--------------------------------------------------------------------------
  298.   def line_color
  299.       color = normal_color ; color.alpha = 48 ; color
  300.   end
  301.   
  302.   #--------------------------------------------------------------------------
  303.   # ● Update
  304.   #--------------------------------------------------------------------------
  305.   def update
  306.       super
  307.       self.opacity = 255
  308.   end
  309.   
  310. end

  311. #==============================================================================
  312. # ■ Window_Status
  313. #==============================================================================
  314. class Window_Attribute_Button < Window_Selectable
  315.   attr_accessor :fade_time
  316.   #--------------------------------------------------------------------------
  317.   # ● Object Initialization
  318.   #--------------------------------------------------------------------------
  319.   def initialize
  320.       super(0, 0, Graphics.width, 64)
  321.       self.y = Graphics.height - self.height ; @fade_time = 60
  322.       self.opacity = 0 ; self.contents_opacity = 0
  323.       refresh
  324.   end

  325.   #--------------------------------------------------------------------------
  326.   # ● Refresh
  327.   #--------------------------------------------------------------------------
  328.   def refresh
  329.       contents.clear
  330.       draw_text(0,0,self.width - 32,32,MOG_ATTRIBUTE_LEVEL::PRESS_BUTTON_TEXT.to_s,1)
  331.   end

  332.   #--------------------------------------------------------------------------
  333.   # ● Update
  334.   #--------------------------------------------------------------------------
  335.   def update
  336.       super
  337.       if @fade_time > 0
  338.          @fade_time -= 1 ; self.opacity += 20 ; self.contents_opacity += 20
  339.       else   
  340.          if self.opacity > 0
  341.             self.y += 5 ; self.opacity -= 5 ; self.contents_opacity -= 5  
  342.          end
  343.       end   
  344.   end
  345.   
  346. end

  347. #==============================================================================
  348. # ■ Scene_Status
  349. #==============================================================================
  350. class Scene_Status < Scene_MenuBase
  351.   
  352.   #--------------------------------------------------------------------------
  353.   # ● Start
  354.   #--------------------------------------------------------------------------
  355.   alias mog_atr_start start
  356.   def start
  357.       mog_atr_start
  358.       @attribute_window = Window_Attribute_Level.new(@actor)
  359.       @attribute_window.z = @status_window.z + 50
  360.       @attribute_Button_window = Window_Attribute_Button.new
  361.       @attribute_Button_window.z = @attribute_window.z - 1
  362.   end
  363.   
  364.   #--------------------------------------------------------------------------
  365.   # ● On Actor Change
  366.   #--------------------------------------------------------------------------
  367.   alias mog_atr_on_actor_change on_actor_change
  368.   def on_actor_change
  369.       mog_atr_on_actor_change
  370.       @attribute_window.actor = @actor      
  371.   end
  372.   
  373.   #--------------------------------------------------------------------------
  374.   # ● Update
  375.   #--------------------------------------------------------------------------
  376.   alias mog_atr_update update
  377.   def update
  378.       mog_atr_update
  379.       if Input.trigger?(:C)
  380.          Sound.play_ok ; @attribute_Button_window.fade_time = 0
  381.          @attribute_window.visible = @attribute_window.visible ? false : true
  382.       end
  383.   end
  384.   
  385. end

  386. #==============================================================================
  387. # ■ Game_Battler
  388. #==============================================================================
  389. class Game_Battler < Game_BattlerBase
  390.   
  391.   attr_accessor :attribute_level
  392.   
  393.   #--------------------------------------------------------------------------
  394.   # ● Initialize
  395.   #--------------------------------------------------------------------------
  396.   alias mog_attribute_initialize initialize
  397.   def initialize
  398.       initial_attribute_level
  399.       mog_attribute_initialize
  400.   end
  401.   
  402.   #--------------------------------------------------------------------------
  403.   # ● Initial Attribute Level
  404.   #--------------------------------------------------------------------------
  405.   def initial_attribute_level
  406.       @attribute_level = [[],[]]
  407.       $data_system.elements.each_with_index do |i, index|
  408.          @attribute_level[0].push([1,0,0,false,index,i,0])
  409.       end
  410.       $data_system.weapon_types.each_with_index do |i, index|
  411.          @attribute_level[1].push([1,0,0,false,index,i,1])
  412.       end
  413.   end

  414.   #--------------------------------------------------------------------------
  415.   # ● Atr Clear EXP Phase
  416.   #--------------------------------------------------------------------------
  417.   def atr_clear_exp_phase
  418.       @attribute_level[0].each do |i| ; i[3] = false ; end
  419.       @attribute_level[1].each do |i| ; i[3] = false ; end
  420.   end  
  421.   
  422.   #--------------------------------------------------------------------------
  423.   # ● Atr Base EXP
  424.   #--------------------------------------------------------------------------
  425.   def atr_base_exp
  426.       return 1
  427.   end

  428.   #--------------------------------------------------------------------------
  429.   # ● Add Atr EXP
  430.   #--------------------------------------------------------------------------
  431.   def add_atr_exp(atr_id,type)
  432.        return if !atr_exp?(atr_id,type)
  433.        @attribute_level[type][atr_id][1] += atr_base_exp
  434.        @attribute_level[type][atr_id][2] += atr_base_exp
  435.        atr_level_up(atr_id,type) if atr_level_up?(atr_id,type)
  436.   end

  437.   #--------------------------------------------------------------------------
  438.   # ● Atr EXP ?
  439.   #--------------------------------------------------------------------------
  440.   def atr_exp?(atr_id,type)
  441.        return false if atr_id < 0
  442.        return false if atr_max_level?(atr_id,type)      
  443.        return false if @attribute_level[type][atr_id][3]
  444.        return false if [nil,""].include?(@attribute_level[type][atr_id][5])      
  445.        return false if type == 0 and MOG_ATTRIBUTE_LEVEL::DISABLE_ELEMENT_ID.include?(atr_id)
  446.        return false if type == 1 and MOG_ATTRIBUTE_LEVEL::DISABLE_WEAPON_ID.include?(atr_id)
  447.        return true
  448.   end
  449.   
  450.   #--------------------------------------------------------------------------
  451.   # ● Atr Level UP
  452.   #--------------------------------------------------------------------------
  453.   def atr_level_up?(atr_id,type)
  454.       return false if atr_max_level?(atr_id,type)
  455.       return true if @attribute_level[type][atr_id][1] >= atr_next_exp(atr_id,type)
  456.       return false
  457.   end

  458.   #--------------------------------------------------------------------------
  459.   # ● Atr Max Level
  460.   #--------------------------------------------------------------------------
  461.   def atr_max_level?(atr_id,type)
  462.       return true if @attribute_level[type][atr_id][0] >= MOG_ATTRIBUTE_LEVEL::MAX_ATTRIBUTE_LEVEL
  463.       return false
  464.   end
  465.   
  466.   #--------------------------------------------------------------------------
  467.   # ● Atr Level UP
  468.   #--------------------------------------------------------------------------
  469.   def atr_next_exp(atr_id,type)
  470.       return @attribute_level[type][atr_id][0] * MOG_ATTRIBUTE_LEVEL::NEXT_EXP_LEVEL_BASE
  471.   end

  472.   #--------------------------------------------------------------------------
  473.   # ● Atr Level UP
  474.   #--------------------------------------------------------------------------
  475.   def atr_level_up(atr_id,type)
  476.       @attribute_level[type][atr_id][0] += 1
  477.       @attribute_level[type][atr_id][1] = 0 unless atr_max_level?(atr_id,type)
  478.   end

  479.   #--------------------------------------------------------------------------
  480.   # ● Make Atr Damage Value
  481.   #--------------------------------------------------------------------------
  482.   alias mog_atr_make_damage_value make_damage_value
  483.   def make_damage_value(user, item)
  484.       mog_atr_make_damage_value(user, item)
  485.       if attribute_effect?(user, item)         
  486.          make_atr_damage_value(user, item)
  487.          excute_add_atr_exp(user, item)
  488.          if $imported[:mog_atb_system] and coop_make_damage_value?(user, item)
  489.             for actor in BattleManager.cskill_members(item.id)
  490.                 next if actor == user
  491.                 make_atr_damage_value(actor, item)
  492.                 excute_add_atr_exp(actor, item)
  493.             end
  494.          end
  495.       end   
  496.   end
  497.   
  498.   #--------------------------------------------------------------------------
  499.   # ● Attribute Effect
  500.   #--------------------------------------------------------------------------
  501.   def attribute_effect?(user, item)
  502.       return false if item == nil
  503.       return false if item.is_a?(RPG::Item)
  504.       return false if user.is_a?(Game_Enemy)
  505.       return true
  506.   end
  507.   
  508.   #--------------------------------------------------------------------------
  509.   # ● Execute Add Atr EXP
  510.   #--------------------------------------------------------------------------
  511.   def excute_add_atr_exp(user, item)
  512.       if item.id == user.attack_skill_id
  513.           if user.equips[0] != nil
  514.              atr_id_1 = user.equips[0].wtype_id
  515.              user.add_atr_exp(atr_id_1,1)
  516.           else   
  517.              user.add_atr_exp(MOG_ATTRIBUTE_LEVEL::BARE_HANDS_ELEMENT_ID,0)
  518.              user.attribute_level[1][0][3] = true
  519.           end
  520.           if user.dual_wield? and user.equips[1] != nil
  521.              atr_id_2 = user.equips[1].wtype_id
  522.              user.add_atr_exp(atr_id_2,1)
  523.           end
  524.           user.attribute_level[1][atr_id_1][3] = true if atr_id_1 != nil
  525.           user.attribute_level[1][atr_id_2][3] = true if atr_id_2 != nil
  526.       else  
  527.          user.add_atr_exp(item.damage.element_id,0)
  528.          if user.equips[0] != nil and
  529.             (item.required_wtype_id1 == user.equips[0].wtype_id or
  530.             item.required_wtype_id2 == user.equips[0].wtype_id)         
  531.             user.add_atr_exp(user.equips[0].wtype_id,1) ; wp_1 = true
  532.          end
  533.          if user.dual_wield? and user.equips[1] != nil and
  534.             (item.required_wtype_id1 == user.equips[1].wtype_id or
  535.             item.required_wtype_id2 == user.equips[1].wtype_id)
  536.             user.add_atr_exp(user.equips[1].wtype_id,1) ; wp_2 = true
  537.          end   
  538.          user.attribute_level[0][item.damage.element_id][3] = true
  539.          user.attribute_level[1][user.equips[0].wtype_id][3] = true if wp_1
  540.          user.attribute_level[1][user.equips[1].wtype_id][3] = true if wp_2
  541.       end
  542.   end
  543.   
  544.   #--------------------------------------------------------------------------
  545.   # ● Atr Dmg P
  546.   #--------------------------------------------------------------------------
  547.   def atr_dmg_p(user,atr_id,type)
  548.       ((user.attribute_level[type][atr_id][0] - 1)  * MOG_ATTRIBUTE_LEVEL::DAMAGE_PERCENTAGE_PER_LEVEL)
  549.   end  
  550.    
  551.   #--------------------------------------------------------------------------
  552.   # ● Make Atr Damage Value
  553.   #--------------------------------------------------------------------------
  554.   def make_atr_damage_value(user, item)
  555.       b_damage = @result.hp_damage if item.damage.to_hp?
  556.       b_damage = @result.mp_damage if item.damage.to_mp?
  557.       b_damage = 0 if b_damage.nil?
  558.       if item.id == user.attack_skill_id
  559.          if user.equips[0] != nil
  560.             atr_id = user.equips[0].wtype_id
  561.             dam = b_damage * atr_dmg_p(user,atr_id,1) / 100
  562.             execute_atr_damage(user,dam,item)
  563.          else   
  564.             dam = b_damage * atr_dmg_p(user,MOG_ATTRIBUTE_LEVEL::BARE_HANDS_ELEMENT_ID,0) / 100
  565.             execute_atr_damage(user,dam,item)         
  566.          end
  567.          if user.dual_wield? and user.equips[1] != nil
  568.             atr_id = user.equips[1].wtype_id
  569.             dam = b_damage * atr_dmg_p(user,atr_id,1) / 100
  570.             execute_atr_damage(user,dam,item)
  571.          end
  572.       else
  573.             dam = b_damage * atr_dmg_p(user,item.damage.element_id,0) / 100
  574.             execute_atr_damage(user,dam,item)
  575.             if user.equips[0] != nil and
  576.                (item.required_wtype_id1 == user.equips[0].wtype_id or
  577.                 item.required_wtype_id2 == user.equips[0].wtype_id)
  578.                 atr_id = user.equips[0].wtype_id
  579.                 dam = b_damage * atr_dmg_p(user,atr_id,1) / 100
  580.                 execute_atr_damage(user,dam,item)
  581.             end
  582.             if user.dual_wield? and user.equips[1] != nil and
  583.                (item.required_wtype_id1 == user.equips[1].wtype_id or
  584.                item.required_wtype_id2 == user.equips[1].wtype_id)
  585.                atr_id = user.equips[1].wtype_id
  586.                dam = b_damage * atr_dmg_p(user,atr_id,1) / 100               
  587.                execute_atr_damage(user,dam,item)
  588.             end
  589.       end
  590.   end
  591.   
  592.   #--------------------------------------------------------------------------
  593.   # ● Execute ATR Damage
  594.   #--------------------------------------------------------------------------
  595.   def execute_atr_damage(user,b_damage,item)
  596.       m_size = 1
  597.       if $imported[:mog_atb_system] and coop_make_damage_value?(user, item)
  598.           m_size = BattleManager.cskill_members(item.id).size if BattleManager.cskill_members(item.id).size > 0
  599.       end        
  600.       @result.hp_damage += (b_damage / m_size) if item.damage.to_hp?
  601.       @result.mp_damage += (b_damage / m_size) if item.damage.to_mp?   
  602.   end
  603.   
  604. end

  605. #==============================================================================
  606. # ■ Scene Battle
  607. #==============================================================================
  608. class Scene_Battle < Scene_Base
  609.   
  610.   #--------------------------------------------------------------------------
  611.   # ● Use Item
  612.   #--------------------------------------------------------------------------
  613.   alias mog_atr_level_use_item use_item
  614.   def use_item
  615.       mog_atr_level_use_item
  616.       @subject.atr_clear_exp_phase
  617.   end
  618.   
  619. end

  620. #==============================================================================
  621. # ■ Game Battler
  622. #==============================================================================
  623. class Game_Battler < Game_BattlerBase
  624.   
  625.   #--------------------------------------------------------------------------
  626.   # ● Make Action
  627.   #--------------------------------------------------------------------------
  628.   def make_action_r(skill_id, target_index)  
  629.       clear_actions
  630.       action = Game_Action.new(self, true)
  631.       action.set_skill(skill_id)
  632.       action.target_index = target_index
  633.       @actions.push(action)   
  634.   end
  635.   
  636. end

  637. #==============================================================================
  638. # ■ Game Actor
  639. #==============================================================================
  640. class Game_Actor < Game_Battler
  641.   attr_reader   :actor_id
  642. end

  643. #==============================================================================
  644. # ■ Scene Battle
  645. #==============================================================================
  646. class Scene_Battle < Scene_Base
  647.   
  648.   #--------------------------------------------------------------------------
  649.   # ● Use Item
  650.   #--------------------------------------------------------------------------
  651.   alias mog_atr_level_execute_action execute_action
  652.   def execute_action
  653.       execute_random_learning if execute_random_learning?
  654.       mog_atr_level_execute_action
  655.   end

  656.   #--------------------------------------------------------------------------
  657.   # ● Execute Random Learning?
  658.   #--------------------------------------------------------------------------
  659.   def execute_random_learning?
  660.       return false if !MOG_SAGA_SKILL::ENABLE_SKILL_LEARNING
  661.       return false if @subject.nil?
  662.       return false if @subject.is_a?(Game_Enemy)   
  663.       item = @subject.current_action.item rescue nil
  664.       return false if item == nil
  665.       return false if item.is_a?(RPG::Item)
  666.       return false if $imported[:mog_atb_system] and BattleManager.is_cskill?(item.id)
  667.       return true
  668.   end
  669.   
  670.   #--------------------------------------------------------------------------
  671.   # ● Execute Random Learning
  672.   #--------------------------------------------------------------------------
  673.   def execute_random_learning
  674.       item = @subject.current_action.item ; success = false ; skill_id = 0 ; skill = nil
  675.       if item.id ==  @subject.attack_skill_id
  676.          if @subject.equips[0] != nil
  677.             atr_id = @subject.equips[0].wtype_id ; type = 1
  678.          else   
  679.             atr_id = MOG_ATTRIBUTE_LEVEL::BARE_HANDS_ELEMENT_ID ; type = 0
  680.          end  
  681.          skill_list = MOG_SAGA_SKILL::ELEMENT_LEARN_SKILL[atr_id] if type == 0
  682.          skill_list = MOG_SAGA_SKILL::WEAPON_LEARN_SKILL[atr_id] if type == 1
  683.       else
  684.          atr_id = item.damage.element_id ; type = 0
  685.          skill_list = MOG_SAGA_SKILL::ELEMENT_LEARN_SKILL[atr_id]
  686.       end
  687.       if skill_list != nil ; skill_list.each do |i| ; skill_id = i[0]
  688.          skill = $data_skills[skill_id]
  689.          if atr_learn_skill?(skill,atr_id,i[1],type)
  690.             success = true ; @subject.learn_skill(skill_id) ; break
  691.          end
  692.       end
  693.       end
  694.       if success and skill_id != 0
  695.          target = @subject.current_action.target_index
  696.          @subject.make_action_r(skill_id, target)
  697.          @log_window.display_learned_skill(@subject.name,skill.name)
  698.          execute_learning_animation
  699.       end
  700.   end

  701.   #--------------------------------------------------------------------------
  702.   # ● Atr Learn Skill
  703.   #--------------------------------------------------------------------------
  704.   def atr_learn_skill?(skill,atr_id,lv_r,type)
  705.       return false if skill == nil
  706.       return false if $imported[:mog_atb_system] and BattleManager.is_cskill?(skill.id)
  707.       nskill = MOG_SAGA_SKILL::ACTOR_NOT_LEARN_SKILL_ID[@subject.actor_id]
  708.       return false if !nskill.nil? and nskill.include?(skill.id)
  709.       return false if !@subject.added_skill_types.include?(skill.stype_id)
  710.       return false if @subject.skill_learn?(skill)
  711.       return false if @subject.attribute_level[type][atr_id][0] < lv_r
  712.       success_rate = MOG_SAGA_SKILL::SUCCESS_RATE + (@subject.attribute_level[type][atr_id][0] - lv_r).abs
  713.       return false if success_rate < rand(100)
  714.       return true
  715.   end

  716.   #--------------------------------------------------------------------------
  717.   # ● Execute Learning Animation
  718.   #--------------------------------------------------------------------------
  719.   def execute_learning_animation
  720.       @subject.animation_id = MOG_SAGA_SKILL::LEARNING_ANIMATION_ID
  721.       return if @subject.animation_id.nil? or @subject.animation_id < 1
  722.       animation = $data_animations[@subject.animation_id] rescue nil
  723.       return if animation.nil?
  724.       anid = (animation.frame_max * 4) + 1 ; anid.times do ; update_basic ; end
  725.   end
  726.   
  727. end

  728. #==============================================================================
  729. # ■ Window BattleLog
  730. #==============================================================================
  731. class Window_BattleLog < Window_Selectable
  732.   
  733.   #--------------------------------------------------------------------------
  734.   # ● Display Learned Skill
  735.   #--------------------------------------------------------------------------
  736.   def display_learned_skill(battler_name,skill_name)
  737.       text = battler_name.to_s + " " + MOG_SAGA_SKILL::BATTLE_LOG_TEXT + " " + skill_name.to_s + "!"
  738.       replace_text(text) ; wait
  739.   end

  740. end
复制代码

请问怎么用事件调用这个脚本》?并且去掉状态面板中的显示。
梦石
0
星屑
1345
在线时间
378 小时
注册时间
2015-6-16
回帖
526
发表于 2018-1-12 19:56:25 | 显示全部楼层
element_lv_up(角色ID , 属性ID, 数值)   这这这………………他不是说了吗(不必要问了啊)
element_lv_up(1 , 2, 3) 提升一号角色2号属性3点经验值(好像那边value就是类似于经验这种东西)
72行还有下面还可以设置技能呢!还有学习条件只要看下格式就行

点评

先谢谢你我,但是我想用事件调用这个脚本的窗口,不是去升级属性的呀,就是不要让他在状态里消失,换到菜单里面  发表于 2018-1-12 20:09
P1不太上了,有问题加个Q1286124843,不管是脚本还是游戏问题都可以来找我
回复

使用道具 举报

梦石
1
星屑
14389
在线时间
2110 小时
注册时间
2017-9-28
回帖
607
发表于 2018-1-13 11:27:26 | 显示全部楼层
同求.....


顺便发现了一些翻译错误和漏洞我回去改改
VA外站脚本汉化群:226308173   |    部分远古文件备份:https://wwzv.lanzoue.com/b02rac5pc  密码:acgm
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部