Project1
标题:
求个装备附加技能 脚本,
[打印本页]
作者:
j1747532399l
时间:
2013-9-18 23:42
标题:
求个装备附加技能 脚本,
在论坛能搜索到,可是一点击就进了主页,不知道怎么办
作者:
myownroc
时间:
2013-9-18 23:50
解决方案:右击超链接,单击属性。
复制属性里的url地址,粘贴在浏览器的地址栏里,把66rpg改为cgyouxi即可
作者:
RyanBern
时间:
2013-9-19 12:38
楼主可以试试这个脚本,大概能满足你的要求。
#============================================================================
# 武器技能系统
#----------------------------------------------------------------------------
# 作者:RyanBern
#============================================================================
# 功能:就是让角色装备某武器,就会拥有这个武器上的技能,如果卸下武器,就会失
# 去这个技能
#----------------------------------------------------------------------------
# 使用方法:
# 在下面的定义武器与技能的对应关系函数中,定义武器和技能的对应关系
# 例如,让ID为1号的武器具有ID为1的技能,就写上data[1] = [1]
# 让ID为2号的武器具有ID为1和2的仅能,就用data[2] = [1,2]
# 注意:你不能定义数据库中不存在的武器
#============================================================================
def get_weapon_skill
# 生成空的Hash
data = {}
#==========================================================================
# 在这条注释后面写上你所希望武器和技能的对应,可以逐条添加
# 例如 data[1] = [1]
#==========================================================================
data[1] = [1]
#==========================================================================
# 定义完毕
#==========================================================================
return data
end
class Game_Actor
#--------------------------------------------------------------------------
# ● 设置
# actor_id : 角色 ID
#--------------------------------------------------------------------------
def setup(actor_id)
actor = $data_actors[actor_id]
@actor_id = actor_id
@name = actor.name
@character_name = actor.character_name
@character_hue = actor.character_hue
@battler_name = actor.battler_name
@battler_hue = actor.battler_hue
@class_id = actor.class_id
@weapon_id = actor.weapon_id
@armor1_id = actor.armor1_id
@armor2_id = actor.armor2_id
@armor3_id = actor.armor3_id
@armor4_id = actor.armor4_id
[url=home.php?mod=space&uid=22147]@level[/url] = actor.initial_level
@exp_list = Array.new(101)
make_exp_list
[url=home.php?mod=space&uid=13302]@exp[/url] = @exp_list[@level]
@skills = []
@hp = maxhp
@sp = maxsp
@states = []
@states_turn = {}
@maxhp_plus = 0
@maxsp_plus = 0
@str_plus = 0
@dex_plus = 0
@agi_plus = 0
@int_plus = 0
# 学会特技
for i in 1..@level
for j in $data_classes[@class_id].learnings
if j.level == i
learn_skill(j.skill_id)
end
end
end
# 学会武器特技
skill_weapon(@weapon_id)
# 刷新自动状态
update_auto_state(nil, $data_armors[@armor1_id])
update_auto_state(nil, $data_armors[@armor2_id])
update_auto_state(nil, $data_armors[@armor3_id])
update_auto_state(nil, $data_armors[@armor4_id])
end
# 学会武器对应的技能
def skill_weapon(weapon_id)
# 取得武器与技能对应Hash
skill = get_weapon_skill
# 装备特定武器就学会对应技能
if skill.keys.include?(weapon_id)
for i in skill[weapon_id]
learn_skill(i)
end
# 删除其它对应技能
m = skill.keys
m.delete(weapon_id)
n = []
for i in m
n += skill[i]
end
for j in n
forget_skill(j)
end
else
# 卸下装备就删除对应技能
m = skill.keys
n = []
for i in m
n += skill[i]
end
for j in n
forget_skill(j)
end
end
end
#--------------------------------------------------------------------------
# ● 变更装备
# 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
$game_party.gain_weapon(@weapon_id, 1)
@weapon_id = id
$game_party.lose_weapon(id, 1)
skill_weapon(id)
end
when 1 # 盾
if id == 0 or $game_party.armor_number(id) > 0
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
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
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
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
end
end
end
复制代码
作者:
chd114
时间:
2013-9-19 12:59
#------------------------------------------------------------
# 脚本来自www.66rpg.com,作者柳柳,转载和使用请保留此信息
#------------------------------------------------------------
class Game_Actor < Game_Battler
C3_W_SKILL = []
C3_A1_SKILL = []
C3_A2_SKILL = []
C3_A3_SKILL = []
C3_A4_SKILL = []
C3_W_SKILL.push [1,0,"剑_"] #武器编号,武器附带技能编号,战斗图前缀
C3_W_SKILL.push [2,7,"剑_"]
C3_W_SKILL.push [3,7,"剑_"]
C3_W_SKILL.push [3,8,"剑_"]
C3_W_SKILL.push [3,9,"剑_"]
C3_W_SKILL.push [6,14,"枪_"]
C3_W_SKILL.push [7,15,"枪_"]
C3_W_SKILL.push [5,0,"枪_"]
C3_W_SKILL.push [9,0,"斧头_"]
C3_W_SKILL.push [10,0,"大剑_"]
#战斗图前缀后面会自动跟上角色的数据库编号。
#比如你使用上面的设定,你的1、2、3、4号角色可以用1号武器(铜剑)
#则你的battlers/下面应改有"剑_1.png","剑_2.png","剑_3.png","剑_4.png"
#一个武器可以重复设置多种技能,防具也是。
C3_A1_SKILL.push [1,15] #盾编号,附带技能编号
C3_A2_SKILL.push [6,15] #头盔编号,附带技能编号
C3_A3_SKILL.push [14,15] #甲编号,附带技能编号
C3_A4_SKILL.push [25,15] #装饰品编号,附带技能编号
#--------------------------------------------------------------------------
# ● 变更装备
# 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
end
end
end
#------------------------------------------------------------
# 脚本来自www.66rpg.com,作者柳柳,转载和使用请保留此信息
#------------------------------------------------------------
复制代码
推荐新手用这个,可以给防具和武器都设定技能,麻烦的事情就是当你需要给一件装备设置多个技能时要多写几句脚本···
作者:
chd114
时间:
2013-9-19 16:05
http://bbs.cgyouxi.com/thread-332805-1-1.html
你也可以考虑用这个,不过是要收费的哦= =至于这个和上面那个的区别···其实就是你可以在设定技能上更简便···而且多了使用说明等等···
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1