作者letrivergo (河果)
看板RPGMaker
標題Re: [問題] RMVX如何製作技能書?
時間Sat Feb 13 00:24:27 2010
忘了從哪裡找到的腳本:
#==============================================================================
# ★ ExItem_LearnSkill
#--------------------------------------------------------
#==============================================================================
# 物品學習技能的指定用文字。
# 在學習技能的物品的「備註」中使用 指定用文字 + [技能 ID]
# 「效果範圍」 設為 「我方單體」、「使用場合」 設為 「選單中」
# 范例: 使用某物品後學會 30 号技能 => *LEARN_SKILL[30]
EXITM_LRNSKILL_SIGNATURE = "*LEARN_SKILL"
#------------------------------------------------------------------------------
class Game_Battler
alias _exilskl_item_test item_test
alias _exilskl_item_effect item_effect
#--------------------------------------------------------------------------
# ● 物品使用測試 (追加定義)
# user : 物品使用者
# item : 物品
#--------------------------------------------------------------------------
def item_test(user, item)
sig = EXITM_LRNSKILL_SIGNATURE
if item.note[/#{Regexp.quote sig}\[(\d+)\]/].to_a[0]
return (not user.skill_learn?($data_skills[$1.to_i]))
end
return _exilskl_item_test(user, item)
end
#--------------------------------------------------------------------------
# ● 判斷物品能否使用(追加定義)
# user : 物品使用者
# item : 物品
#--------------------------------------------------------------------------
def item_effect(user, item)
_exilskl_item_effect(user, item)
sig = EXITM_LRNSKILL_SIGNATURE
if item.note[/#{Regexp.quote sig}\[(\d+)\]/].to_a[0]
skill_id = $1.to_i
used = true unless user.skill_learn?($data_skills[skill_id])
user.learn_skill(skill_id)
end
end
end
--
修真小說: 亂綱誌 緩慢連載中......
http://www.nch.com.tw/writers.php?id=11506
RM遊戲開發: 風之缺 持續開發中QQ
http://www.wretch.cc/blog/rivergo&category_id=11873662
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.44.189.117
1F:推 stayrain:大感謝 有這個就省掉一堆公共事件 02/13 23:18
2F:→ stayrain:不過已經都設定完了 弄了52個囧 狀態+事件共104個.. 02/13 23:19
3F:→ letrivergo:不客氣^^ 02/14 21:29