查看: 1788|回复: 2

[已经过期] 如何实现某个技能杀死目标,则获得某物品?

[复制链接]
梦石
0
星屑
710
在线时间
663 小时
注册时间
2012-10-21
回帖
251
发表于 2014-8-10 23:07:12 | 显示全部楼层 |阅读模式

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

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

×
就是说,如果目标死于这个技能,那么就触发某个公共事件,获得的物品咱在公共事件里面编辑就好。
请问下如何实现?

无限の剣制

梦石
0
星屑
10450
在线时间
5019 小时
注册时间
2013-2-28
回帖
4942

开拓者贵宾

发表于 2014-8-11 00:19:53 | 显示全部楼层
  1. class Game_Battler < Game_BattlerBase

  2.   #--------------------------------------------------------------------------
  3.   # ● 计算伤害
  4.   #--------------------------------------------------------------------------
  5.   def make_damage_value(user, item)
  6.     value = item.damage.eval(user, self, $game_variables)
  7.     value *= item_element_rate(user, item)
  8.     value *= pdr if item.physical?
  9.     value *= mdr if item.magical?
  10.     value *= rec if item.damage.recover?
  11.     value = apply_critical(value) if @result.critical
  12.     value = apply_variance(value, item.damage.variance)
  13.     value = apply_guard(value)
  14.     @result.make_damage(value.to_i, item)
  15.     if item.is_a?(RPG::Skill) && item.id == 2  #3号技能
  16.       if self.hp - value <= 0
  17.         $game_party.gain_item($data_items[3], 3)   #获得3号物品 3个
  18.       end
  19.     end
  20.   end
  21. end
复制代码
随手在VA原始脚本里直接添加修改的未测试

点评

看出来未测试了。make_damage 并没有实际造成伤害啊233  发表于 2014-8-11 06:49
回复

使用道具 举报

梦石
0
星屑
710
在线时间
663 小时
注册时间
2012-10-21
回帖
251
 楼主| 发表于 2014-8-11 07:00:54 | 显示全部楼层
是这样的,这个技能有自己的伤害公式,也有30%即死效果(boss免疫即死),无论哪种方法,只要目标死于这技能,都会得到物品,并显示文字,获得了xxx,显示文字是事件里面那种显示文字,而不是battle log(被我隐藏了)

点评

或者 Game_Battler#apply_item_effects 也可  发表于 2014-8-11 07:08
在 Scene_Battle 里面改 apply_item_effects 方法  发表于 2014-8-11 07:07
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部