Project1
标题:
装备附带技能
[打印本页]
作者:
失落的乐章
时间:
2013-4-30 23:20
标题:
装备附带技能
说明:
使装备附带技能,使用装备时习得技能,卸下装备后即遗忘该技能。
对于事件中的“变更装备”也一样有效。
=begin
装备附带技能V1.0
作者:失落的乐章
说明:使装备附带技能,使用装备时习得技能,卸下装备后即遗忘该技能。
对于事件中的“变更装备”也一样有效。
=end
module SGS_ES
#以下是对装备及其附属技能的设定。格式为“武器ID => 技能ID”,如下。
#
WPSKILL = { 4 => 60, #武器附带技能
3 => 59
}
A1SKILL = { } #防具1(默认为盾)附带技能
A2SKILL = { } #防具2(默认为头部防具)附带技能
A3SKILL = { } #防具3(默认为身体防具)附带技能
A4SKILL = { 29 => 7 } #防具4(默认为装饰品)附带技能
def self.forget_skill(actor)
WPSKILL.each { |wq,sk| actor.forget_skill(sk) if actor.weapon_id == wq }
A1SKILL.each { |wq,sk| actor.forget_skill(sk) if actor.armor1_id == wq }
A2SKILL.each { |wq,sk| actor.forget_skill(sk) if actor.armor2_id == wq }
A3SKILL.each { |wq,sk| actor.forget_skill(sk) if actor.armor3_id == wq }
A4SKILL.each { |wq,sk| actor.forget_skill(sk) if actor.armor4_id == wq }
end
def self.learn_skill(actor)
WPSKILL.each { |wq,sk| actor.learn_skill(sk) if actor.weapon_id == wq }
A1SKILL.each { |wq,sk| actor.learn_skill(sk) if actor.armor1_id == wq }
A2SKILL.each { |wq,sk| actor.learn_skill(sk) if actor.armor2_id == wq }
A3SKILL.each { |wq,sk| actor.learn_skill(sk) if actor.armor3_id == wq }
A4SKILL.each { |wq,sk| actor.learn_skill(sk) if actor.armor4_id == wq }
end
end
class Interpreter
#--------------------------------------------------------------------------
# ● 变更装备
#--------------------------------------------------------------------------
def command_319
# 获取角色
actor = $game_actors[@parameters[0]]
# 变更角色
if actor != nil
SGS_ES.forget_skill(actor)
actor.equip(@parameters[1], @parameters[2])
SGS_ES.learn_skill(actor)
end
# 继续
return true
end
end
class Scene_Equip
def update_item
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@right_window.active = true
@item_window.active = false
@item_window.index = -1
return
end
if Input.trigger?(Input::C)
$game_system.se_play($data_system.equip_se)
item = @item_window.item
actemp = $game_actors[@actor_index+1]
SGS_ES.forget_skill(actemp)
@actor.equip(@right_window.index, item == nil ? 0 : item.id)
SGS_ES.learn_skill(actemp)
@right_window.active = true
@item_window.active = false
@item_window.index = -1
@right_window.refresh
@item_window.refresh
return
end
end
end
复制代码
范例:
装备附带技能.rar
(189.72 KB, 下载次数: 181)
2013-4-30 23:20 上传
点击文件名下载附件
作者:
水终结者
时间:
2013-5-2 18:47
希望第二版能支持装备武器能习得多个技能。
作者:
chd114
时间:
2013-5-3 21:01
这个脚本为什么我会找到一个类似的···
#------------------------------------------------------------
# 脚本来自www.66rpg.com,作者柳柳,转载和使用请保留此信息
#------------------------------------------------------------
class Game_Actor < Game_Battler
C3_W_SKILL = []
C3_A1_SKILL = []
C3_A2_SKILL = []
C3_A3_SKILL = []
C3_A4_SKILL = []
C3_A5_SKILL = []
C3_A6_SKILL = []
C3_A7_SKILL = []
C3_A8_SKILL = []
C3_A9_SKILL = []
C3_A10_SKILL = []
C3_A11_SKILL = []
C3_A12_SKILL = []
C3_A13_SKILL = []
C3_W_SKILL.push [2,38,""] #武器编号,武器附带技能编号,战斗图前缀
#战斗图前缀后面会自动跟上角色的数据库编号。
#比如你使用上面的设定,你的1、2、3、4号角色可以用1号武器(铜剑)
#则你的battlers/下面应改有"剑_1.png","剑_2.png","剑_3.png","剑_4.png"
#一个武器可以重复设置多种技能,防具也是。
C3_A1_SKILL.push [1,0] #盾编号,附带技能编号
#--------------------------------------------------------------------------
# ● 变更装备
# equip_type : 装备类型
# id : 武器 or 防具 ID (0 为解除装备)
#--------------------------------------------------------------------------
def equip(equip_type, id)
case equip_type
when 0 # 武器
if id == 0 or $game_party.weapon_number(id) > 0
old_weapon_id = @weapon_id
weapon_i = 0
for weapon_i in C3_W_SKILL
if weapon_i[0] == old_weapon_id
if weapon_i[1] != 0
forget_skill(weapon_i[1])
end
end
end
for weapon_i in C3_W_SKILL
if weapon_i[0] == id
if weapon_i[1] != 0
learn_skill(weapon_i[1])
end
if weapon_i[2] != ""
@battler_name = weapon_i[2]+@actor_id.to_s
else
@battler_name = $data_actors[@actor_id].battler_name
end
end
end
$game_party.gain_weapon(@weapon_id, 1)
@weapon_id = id
$game_party.lose_weapon(id, 1)
end
when 1 # 盾
if id == 0 or $game_party.armor_number(id) > 0
old_am_id = @armor1_id
am_i = 0
for am_i in C3_A1_SKILL
if am_i[0] == old_am_id
if am_i[1] != 0
forget_skill(am_i[1])
end
end
end
for am_i in C3_A1_SKILL
if am_i[0] == id
if am_i[1] != 0
learn_skill(am_i[1])
end
end
end
update_auto_state($data_armors[@armor1_id], $data_armors[id])
$game_party.gain_armor(@armor1_id, 1)
@armor1_id = id
$game_party.lose_armor(id, 1)
end
when 2 # 头
if id == 0 or $game_party.armor_number(id) > 0
old_am_id = @armor2_id
am_i = 0
for am_i in C3_A2_SKILL
if am_i[0] == old_am_id
if am_i[1] != 0
forget_skill(am_i[1])
end
end
end
for am_i in C3_A2_SKILL
if am_i[0] == id
if am_i[1] != 0
learn_skill(am_i[1])
end
end
end
update_auto_state($data_armors[@armor2_id], $data_armors[id])
$game_party.gain_armor(@armor2_id, 1)
@armor2_id = id
$game_party.lose_armor(id, 1)
end
when 3 # 身体
if id == 0 or $game_party.armor_number(id) > 0
old_am_id = @armor3_id
am_i = 0
for am_i in C3_A3_SKILL
if am_i[0] == old_am_id
if am_i[1] != 0
forget_skill(am_i[1])
end
end
end
for am_i in C3_A3_SKILL
if am_i[0] == id
if am_i[1] != 0
learn_skill(am_i[1])
end
end
end
update_auto_state($data_armors[@armor3_id], $data_armors[id])
$game_party.gain_armor(@armor3_id, 1)
@armor3_id = id
$game_party.lose_armor(id, 1)
end
when 4 # 装饰品
if id == 0 or $game_party.armor_number(id) > 0
old_am_id = @armor4_id
am_i = 0
for am_i in C3_A4_SKILL
if am_i[0] == old_am_id
if am_i[1] != 0
forget_skill(am_i[1])
end
end
end
for am_i in C3_A4_SKILL
if am_i[0] == id
if am_i[1] != 0
learn_skill(am_i[1])
end
end
end
update_auto_state($data_armors[@armor4_id], $data_armors[id])
$game_party.gain_armor(@armor4_id, 1)
@armor4_id = id
$game_party.lose_armor(id, 1)
end
when 5 # 盾
if id == 0 or $game_party.armor_number(id) > 0
old_am_id = @armor5_id
am_i = 0
for am_i in C3_A5_SKILL
if am_i[0] == old_am_id
if am_i[1] != 0
forget_skill(am_i[1])
end
end
end
for am_i in C3_A5_SKILL
if am_i[0] == id
if am_i[1] != 0
learn_skill(am_i[1])
end
end
end
update_auto_state($data_armors[@armor5_id], $data_armors[id])
$game_party.gain_armor(@armor5_id, 1)
@armor5_id = id
$game_party.lose_armor(id, 1)
end
when 6 # 头
if id == 0 or $game_party.armor_number(id) > 0
old_am_id = @armor6_id
am_i = 0
for am_i in C3_A6_SKILL
if am_i[0] == old_am_id
if am_i[1] != 0
forget_skill(am_i[1])
end
end
end
for am_i in C3_A6_SKILL
if am_i[0] == id
if am_i[1] != 0
learn_skill(am_i[1])
end
end
end
update_auto_state($data_armors[@armor6_id], $data_armors[id])
$game_party.gain_armor(@armor6_id, 1)
@armor6_id = id
$game_party.lose_armor(id, 1)
end
when 7 # 身体
if id == 0 or $game_party.armor_number(id) > 0
old_am_id = @armor7_id
am_i = 0
for am_i in C3_A7_SKILL
if am_i[0] == old_am_id
if am_i[1] != 0
forget_skill(am_i[1])
end
end
end
for am_i in C3_A7_SKILL
if am_i[0] == id
if am_i[1] != 0
learn_skill(am_i[1])
end
end
end
update_auto_state($data_armors[@armor7_id], $data_armors[id])
$game_party.gain_armor(@armor7_id, 1)
@armor7_id = id
$game_party.lose_armor(id, 1)
end
when 8 # 盾
if id == 0 or $game_party.armor_number(id) > 0
old_am_id = @armor8_id
am_i = 0
for am_i in C3_A8_SKILL
if am_i[0] == old_am_id
if am_i[1] != 0
forget_skill(am_i[1])
end
end
end
for am_i in C3_A8_SKILL
if am_i[0] == id
if am_i[1] != 0
learn_skill(am_i[1])
end
end
end
update_auto_state($data_armors[@armor8_id], $data_armors[id])
$game_party.gain_armor(@armor8_id, 1)
@armor8_id = id
$game_party.lose_armor(id, 1)
end
when 9 # 头
if id == 0 or $game_party.armor_number(id) > 0
old_am_id = @armor9_id
am_i = 0
for am_i in C3_A9_SKILL
if am_i[0] == old_am_id
if am_i[1] != 0
forget_skill(am_i[1])
end
end
end
for am_i in C3_A9_SKILL
if am_i[0] == id
if am_i[1] != 0
learn_skill(am_i[1])
end
end
end
update_auto_state($data_armors[@armor9_id], $data_armors[id])
$game_party.gain_armor(@armor9_id, 1)
@armor9_id = id
$game_party.lose_armor(id, 1)
end
when 10 # 身体
if id == 0 or $game_party.armor_number(id) > 0
old_am_id = @armor10_id
am_i = 0
for am_i in C3_A10_SKILL
if am_i[0] == old_am_id
if am_i[1] != 0
forget_skill(am_i[1])
end
end
end
for am_i in C3_A10_SKILL
if am_i[0] == id
if am_i[1] != 0
learn_skill(am_i[1])
end
end
end
update_auto_state($data_armors[@armor10_id], $data_armors[id])
$game_party.gain_armor(@armor10_id, 1)
@armor10_id = id
$game_party.lose_armor(id, 1)
end
when 11 # 盾
if id == 0 or $game_party.armor_number(id) > 0
old_am_id = @armor11_id
am_i = 0
for am_i in C3_A11_SKILL
if am_i[0] == old_am_id
if am_i[1] != 0
forget_skill(am_i[1])
end
end
end
for am_i in C3_A11_SKILL
if am_i[0] == id
if am_i[1] != 0
learn_skill(am_i[1])
end
end
end
update_auto_state($data_armors[@armor11_id], $data_armors[id])
$game_party.gain_armor(@armor11_id, 1)
@armor11_id = id
$game_party.lose_armor(id, 1)
end
when 12 # 头
if id == 0 or $game_party.armor_number(id) > 0
old_am_id = @armor12_id
am_i = 0
for am_i in C3_A12_SKILL
if am_i[0] == old_am_id
if am_i[1] != 0
forget_skill(am_i[1])
end
end
end
for am_i in C3_A12_SKILL
if am_i[0] == id
if am_i[1] != 0
learn_skill(am_i[1])
end
end
end
update_auto_state($data_armors[@armor12_id], $data_armors[id])
$game_party.gain_armor(@armor12_id, 1)
@armor12_id = id
$game_party.lose_armor(id, 1)
end
when 13 # 身体
if id == 0 or $game_party.armor_number(id) > 0
old_am_id = @armor13_id
am_i = 0
for am_i in C3_A13_SKILL
if am_i[0] == old_am_id
if am_i[1] != 0
forget_skill(am_i[1])
end
end
end
for am_i in C3_A13_SKILL
if am_i[0] == id
if am_i[1] != 0
learn_skill(am_i[1])
end
end
end
update_auto_state($data_armors[@armor13_id], $data_armors[id])
$game_party.gain_armor(@armor13_id, 1)
@armor13_id = id
$game_party.lose_armor(id, 1)
end
end
end
end
#------------------------------------------------------------
# 脚本来自www.66rpg.com,作者柳柳,转载和使用请保留此信息
#------------------------------------------------------------
复制代码
这是我整合做的样板里面的东西···
作者:
skfwp
时间:
2013-5-6 15:25
提示:
作者被禁止或删除 内容自动屏蔽
作者:
hijl1990
时间:
2013-6-26 14:42
一个技能只能让一把武器学会吗?
作者:
韺戀
时间:
2013-6-28 22:35
如果想要一个装备多个技能或是一个技能多个装备呢??
例如:1号装备有1号与2号技能
然後2号装备则有1号与3号技能
能限制职业吗??
作者:
英顺的马甲
时间:
2013-6-29 00:28
为啥我能找到一个超短的==
http://rpg.blue/thread-314767-1-2.html
作者:
wutou
时间:
2013-8-2 17:14
好脚本收下了~
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1