查看: 2304|回复: 3

[已经解决] XP怎么让普通攻击改成执行公共事件

[复制链接]
梦石
0
星屑
1285
在线时间
7 小时
注册时间
2015-7-24
回帖
2
发表于 2015-8-10 10:36:03 | 显示全部楼层 |阅读模式

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

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

×
XP怎么让普通攻击改成执行公共事件?就是执行普通攻击时不是攻击敌人,而是执行一个公共事件?有这种脚本吗

评分

参与人数 1星屑 +35 收起 理由
RyanBern + 35 手动认可奖励

查看全部评分

梦石
0
星屑
1285
在线时间
7 小时
注册时间
2015-7-24
回帖
2
 楼主| 发表于 2015-8-10 10:58:53 | 显示全部楼层
这个脚本是攻击后执行公共事件,但它是攻击完才执行的,并不是直接执行公共事件
#==============================================================================
# 本脚本来自www.66rpg.com,转载和使用请保留此信息  
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# ● 刷新画面 (主回合) ★
#--------------------------------------------------------------------------
def update_phase4
   case @phase4_step
   when 1
     update_phase4_step1
   when 2
     update_phase4_step2
   when 3
     update_phase4_step3
   when 4
     update_phase4_step4
   when 5
     update_phase4_step5
   when 6
     update_phase4_step6
   when 7
     update_phase4_step7
   end
end
#--------------------------------------------------------------------------
# ● 刷新画面 (主回合步骤 6 : 刷新) ★
#--------------------------------------------------------------------------
def update_phase4_step6
   # 清除强制行动对像的战斗者
   $game_temp.forcing_battler = nil
   # 公共事件 ID 有效的情况下
   if @common_event_id > 0
     # 设置事件
     common_event = $data_common_events[@common_event_id]
     $game_system.battle_interpreter.setup(common_event.list, 0)
   end
   # 移至步骤 1
   @phase4_step = 7
end
#--------------------------------------------------------------------------
# ● 刷新画面 (主回合步骤 7 : 刷新) ★
#--------------------------------------------------------------------------
def update_phase4_step7
   common_event = $data_common_events[1]
   $game_system.battle_interpreter.setup(common_event.list, 0)
   @phase4_step = 1
end
end
#==============================================================================
# 本脚本来自www.66rpg.com,转载和使用请保留此信息  
#==============================================================================
回复

使用道具 举报

梦石
0
星屑
1044
在线时间
750 小时
注册时间
2013-2-15
回帖
82

开拓者

发表于 2015-8-10 15:51:51 | 显示全部楼层
在Scene_Battle 3里有这几句
  1.     # 按下 C 键的情况下
  2.     if Input.trigger?(Input::C)
  3.       # 角色指令窗口光标位置分之
  4.       case @actor_command_window.index
  5.       when 0  # 攻击
  6.         # 演奏确定 SE
  7.         $game_system.se_play($data_system.decision_se)
  8.         # 设置行动
  9.         @active_battler.current_action.kind = 0
  10.         @active_battler.current_action.basic = 0
  11.         # 开始选择敌人
  12.         start_enemy_select
  13.       when 1  # 特技
  14.         # 演奏确定 SE
  15.         $game_system.se_play($data_system.decision_se)
  16.         # 设置行动
  17.         @active_battler.current_action.kind = 1
  18.         # 开始选择特技
  19.         start_skill_select
  20.       when 2  # 防御
  21.         # 演奏确定 SE
  22.         $game_system.se_play($data_system.decision_se)
  23.         # 设置行动
  24.         @active_battler.current_action.kind = 0
  25.         @active_battler.current_action.basic = 1
  26.         # 转向下一位角色的指令输入
  27.         phase3_next_actor
  28.       when 3  # 物品
  29.         # 演奏确定 SE
  30.         $game_system.se_play($data_system.decision_se)
  31.         # 设置行动
  32.         @active_battler.current_action.kind = 2
  33.         # 开始选择物品
  34.         start_item_select
  35.       end
  36.       return
  37.     end
  38.   end
复制代码
在里面  攻击 的那一块的代码是
  1.         # 演奏确定 SE
  2.         $game_system.se_play($data_system.decision_se)
  3.         # 设置行动
  4.         @active_battler.current_action.kind = 0
  5.         @active_battler.current_action.basic = 0
  6.         # 开始选择敌人
  7.         start_enemy_select
复制代码
你替换成执行公共事件的代码就行
公共事件的脚本代码是 $game_temp.common_event_id = 1   #1是公共事件的id

评分

参与人数 1梦石 +1 收起 理由
RyanBern + 1 认可答案

查看全部评分

回复

使用道具 举报

梦石
0
星屑
1285
在线时间
7 小时
注册时间
2015-7-24
回帖
2
 楼主| 发表于 2015-8-13 08:50:29 | 显示全部楼层
这样是执行公共事件了,可敌人也执行公共事件了,有没有什么可以只有角色执行公共事件?
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部