查看: 1784|回复: 5

如何限制某角色只能使用技能?

  [复制链接]

万兽

梦石
0
星屑
602
在线时间
2271 小时
注册时间
2006-11-4
回帖
4701

贵宾

发表于 2008-1-16 03:04:26 | 显示全部楼层 |阅读模式

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

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

×
行走图战斗脚本要把某角色的普通攻击变成远距离攻击真得是太难了.
试过很多种办法,比如:
if @active_battler.is_a?(Game_Actor)
    if $active_battler_id = 01
      end
    if rand(100) <= 100 #判断概率
    # 获取特技
    @skill = $data_skills[13]
    # 消耗 SP
    @active_battler.sp -= @skill.sp_cost
    # 刷新状态窗口
    @status_window.refresh
    # 在帮助窗口显示特技名
    @help_window.set_text(@skill.name, 1)
    # 设置动画 ID
    @animation1_id = @skill.animation1_id
    @animation2_id = @skill.animation2_id
    # 设置公共事件 ID
    @common_event_id = @skill.common_event_id
    # 设置对像侧战斗者
    set_target_battlers(@skill.scope)
    # 应用特技效果
    for target in @target_battlers
      target.skill_effect(@active_battler, @skill)
    end
    return
    else
      # 应用通常攻击效果
      for target in @target_battlers
        target.attack_effect(@active_battler)
      end
      return
    end
  end
end

或者:
if @active_battler.is_a?(Game_Actor)
if $data_weapons[@active_battler.weapon_id].element_set.include?(17)
end
    if rand(100) <= 60 #判断概率
    # 获取特技
    @skill = $data_skills[13]
    # 消耗 SP
    @active_battler.sp -= @skill.sp_cost
    # 刷新状态窗口
    @status_window.refresh
    # 在帮助窗口显示特技名
    @help_window.set_text(@skill.name, 1)
    # 设置动画 ID
    @animation1_id = @skill.animation1_id
    @animation2_id = @skill.animation2_id
    # 设置公共事件 ID
    @common_event_id = @skill.common_event_id
    # 设置对像侧战斗者
    set_target_battlers(@skill.scope)
    # 应用特技效果
    for target in @target_battlers
      target.skill_effect(@active_battler, @skill)
    end
    return
    else
      # 应用通常攻击效果
      for target in @target_battlers
        target.attack_effect(@active_battler)
      end
      return
    end
  end
end
但都有同样的问题,那就是怪物的攻击没有伤害了,现在就希望来个脚本,让特定的角色不能使用普通攻击只能使用特定的技能,脚本高手救命啊!!

万兽

梦石
0
星屑
602
在线时间
2271 小时
注册时间
2006-11-4
回帖
4701

贵宾

发表于 2008-1-16 03:04:26 | 显示全部楼层 |阅读模式

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

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

×
行走图战斗脚本要把某角色的普通攻击变成远距离攻击真得是太难了.
试过很多种办法,比如:
if @active_battler.is_a?(Game_Actor)
    if $active_battler_id = 01
      end
    if rand(100) <= 100 #判断概率
    # 获取特技
    @skill = $data_skills[13]
    # 消耗 SP
    @active_battler.sp -= @skill.sp_cost
    # 刷新状态窗口
    @status_window.refresh
    # 在帮助窗口显示特技名
    @help_window.set_text(@skill.name, 1)
    # 设置动画 ID
    @animation1_id = @skill.animation1_id
    @animation2_id = @skill.animation2_id
    # 设置公共事件 ID
    @common_event_id = @skill.common_event_id
    # 设置对像侧战斗者
    set_target_battlers(@skill.scope)
    # 应用特技效果
    for target in @target_battlers
      target.skill_effect(@active_battler, @skill)
    end
    return
    else
      # 应用通常攻击效果
      for target in @target_battlers
        target.attack_effect(@active_battler)
      end
      return
    end
  end
end

或者:
if @active_battler.is_a?(Game_Actor)
if $data_weapons[@active_battler.weapon_id].element_set.include?(17)
end
    if rand(100) <= 60 #判断概率
    # 获取特技
    @skill = $data_skills[13]
    # 消耗 SP
    @active_battler.sp -= @skill.sp_cost
    # 刷新状态窗口
    @status_window.refresh
    # 在帮助窗口显示特技名
    @help_window.set_text(@skill.name, 1)
    # 设置动画 ID
    @animation1_id = @skill.animation1_id
    @animation2_id = @skill.animation2_id
    # 设置公共事件 ID
    @common_event_id = @skill.common_event_id
    # 设置对像侧战斗者
    set_target_battlers(@skill.scope)
    # 应用特技效果
    for target in @target_battlers
      target.skill_effect(@active_battler, @skill)
    end
    return
    else
      # 应用通常攻击效果
      for target in @target_battlers
        target.attack_effect(@active_battler)
      end
      return
    end
  end
end
但都有同样的问题,那就是怪物的攻击没有伤害了,现在就希望来个脚本,让特定的角色不能使用普通攻击只能使用特定的技能,脚本高手救命啊!!

万兽

梦石
0
星屑
602
在线时间
2271 小时
注册时间
2006-11-4
回帖
4701

贵宾

 楼主| 发表于 2008-1-16 19:33:30 | 显示全部楼层
……没人回答。。。
回复

使用道具 举报

万兽

梦石
0
星屑
602
在线时间
2271 小时
注册时间
2006-11-4
回帖
4701

贵宾

 楼主| 发表于 2008-1-17 16:16:18 | 显示全部楼层
等了好久都没有人来帮忙
回复

使用道具 举报

头像被屏蔽
梦石
0
星屑
50
在线时间
0 小时
注册时间
2007-12-15
回帖
132
发表于 2008-1-18 22:52:19 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复

使用道具 举报

万兽

梦石
0
星屑
602
在线时间
2271 小时
注册时间
2006-11-4
回帖
4701

贵宾

 楼主| 发表于 2008-1-19 20:17:28 | 显示全部楼层
测试后没效果……
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部