赞 | 1 |
VIP | 10 |
好人卡 | 2 |
积分 | 1 |
经验 | 132388 |
最后登录 | 2016-5-9 |
在线时间 | 34 小时 |
Lv1.梦旅人 冰王子
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 34 小时
- 注册时间
- 2008-1-27
- 帖子
- 1875
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
我看到主站上的套装系统有些问题,就写了这个脚本,虽然我自己的也不是很完善,但是会不断更新的(unless这张帖子被54,{/dk}那我自己留着好了)
貌似我的脚本都太过花哨(包括此脚本),不实用,所以管理员一直没把我的脚本顶到主站,虽然很伤心{/ll},但是我还是冒着被54的风险含泪写了这个脚本。
具体用法我在脚本里说的很清楚了,就不废话了。
至于冲突,主要是装备扩展,假如你重定义了Game_Actor里的相关项,也有可能产生冲突。以上两种情况整合起来并不麻烦,对高手就不用说了,新手的话自己整合一下也有助于技术提高,如果有问题可以去提问区提问,我长期在那儿蹲点(因为是提问区的斑竹{/gg})。其他冲突,不明。
- #-------------------------------------------------------------------------------
- #冰冰套装系统 version 1.00(修正) By 凌冰
- #(附带加MAXHP、加MAXSP装备、加回避的武器和加攻击的防具功能)
- #(修正信息:支持多防具套装)
- #================================套装的设置================================
- #如范例数据库
- #凌冰套装包含:凌冰之铜剑、凌冰之铜盾、凌冰之铜盔、凌冰之铜铠
- #或: 凌冰之铜枪、凌冰之铜盾、凌冰之铜盔、凌冰之铜铠
- #只要全部在武器、防具前面加上套装名"凌冰"和"之"
- #接着设置套装附加属性
- #在防具里新建防具,无所谓是盾还是头盔什么的,只要名字是套装名"凌冰"
- #设置附加属性
- #直接在物防、魔防、回避、力量、敏捷、速度、魔力里设置相应的附加值
- #至于攻击、MAXHP、MAXSP的附加值,则需要用到附加功能
- #在说明里添加精+数值、灵+数值、攻+数值(要有+号)设置相应附加值
- #具体设置参考范例
- #当然设置的这个防具在游戏中也是可用的,但是不算在套装里
- #然后说明一下☆附加功能☆
- #同上文关于套装附加属性的设置
- #武器在说明里添加精+数值、灵+数值、避+数值(要有+号)设置相应值
- #防具在说明里添加精+数值、灵+数值、攻+数值(要有+号)设置相应值
- #================================脚本的缺陷================================
- #我不说你们早晚也会发现的,所以还不如事先承认了
- #第一、不能设置套装不全的部分附加,暗黑破坏神里,如果套装不全,而装备的套装数量
- # 大于一,就会实现套装属性的部分附加。但是本脚本暂时不具备此功能,也就是说
- # 想附加套装属性缺一不可
- #第二、其他属性附加,例如:套装特技、自动状态、属性、属性防御、状态变化、状态防
- # 御……暂时还不能实现
- #其他缺陷和BUG望大家及时反馈给我,发站内短信给我就行
- #-------------------------------------------------------------------------------
- module RPG
- class Weapon
- def tao
- return nil if @name.split(/之/)[1] == nil
- return @name.split(/之/)[0]
- end
- def maxhp_plus
- return 0 if @description.split(/精+/)[1] == nil
- return @description.split(/精+/)[1].to_i
- end
- def maxsp_plus
- return 0 if @description.split(/灵+/)[1] == nil
- return @description.split(/灵+/)[1].to_i
- end
- def eva_plus
- return 0 if @description.split(/避+/)[1] == nil
- return @description.split(/避+/)[1].to_i
- end
- end
- class Armor
- def tao
- return nil if @name.split(/之/)[1] == nil
- return @name.split(/之/)[0]
- end
- def maxhp_plus
- return 0 if @description.split(/精+/)[1] == nil
- return @description.split(/精+/)[1].to_i
- end
- def maxsp_plus
- return 0 if @description.split(/灵+/)[1] == nil
- return @description.split(/灵+/)[1].to_i
- end
- def atk_plus
- return 0 if @description.split(/攻+/)[1] == nil
- return @description.split(/攻+/)[1].to_i
- end
- end
- end
- class Game_Actor < Game_Battler
- def get_tao_num(tao)
- tao_num = 0
- @tao = tao
- armors = []
- for i in 0...4
- armors[i] = []
- end
- for i in 1...$data_armors.size
- case $data_armors[i].kind
- when 0
- armors[0].push(i)
- when 1
- armors[1].push(i)
- when 2
- armors[2].push(i)
- when 3
- armors[3].push(i)
- end
- end
- for i in 0...4
- for id in armors[i]
- armor = $data_armors[id]
- if @tao == armor.tao
- tao_num += 1
- break
- end
- end
- end
- for i in 1...$data_weapons.size
- weapon = $data_weapons[i]
- if weapon.tao == @tao
- tao_num += 1
- break
- end
- end
- return tao_num
- end
- def get_plus(parameter)
- @now_tao_num = 0
- weapon = $data_weapons[@weapon_id]
- if weapon != nil and weapon.tao != nil
- tao = weapon.tao
- @tao_num = get_tao_num(tao)
- else
- for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id]
- armor = $data_armors[i]
- if armor != nil and armor.tao != nil
- tao = armor.tao
- @tao_num = get_tao_num(tao)
- break
- end
- end
- end
- if weapon != nil and weapon.tao != nil and weapon.tao == tao
- @now_tao_num += 1
- end
- for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id]
- armor = $data_armors[i]
- unless armor == nil
- if armor != nil and armor.tao != nil and armor.tao == tao
- @now_tao_num += 1
- end
- end
- end
- if @now_tao_num == @tao_num
- return get_tao_plus(tao,parameter)
- end
- return 0
- end
- def get_tao_plus(tao,parameter)
- for i in 1...$data_armors.size
- armor = $data_armors[i]
- if armor.name == tao
- case parameter
- when 0
- return armor.maxhp_plus
- when 1
- return armor.maxsp_plus
- when 2
- return armor.str_plus
- when 3
- return armor.dex_plus
- when 4
- return armor.agi_plus
- when 5
- return armor.int_plus
- when 6
- return armor.atk_plus
- when 7
- return armor.pdef
- when 8
- return armor.mdef
- when 9
- return armor.eva
- else
- return 0
- end
- end
- end
- return 0
- end
- def base_maxhp
- n = $data_actors[@actor_id].parameters[0, @level]
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- n += weapon != nil ? weapon.maxhp_plus : 0
- n += armor1 != nil ? armor1.maxhp_plus : 0
- n += armor2 != nil ? armor2.maxhp_plus : 0
- n += armor3 != nil ? armor3.maxhp_plus : 0
- n += armor4 != nil ? armor4.maxhp_plus : 0
- n += get_plus(0)
- return n
- end
- def base_maxsp
- n = $data_actors[@actor_id].parameters[1, @level]
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- n += weapon != nil ? weapon.maxsp_plus : 0
- n += armor1 != nil ? armor1.maxsp_plus : 0
- n += armor2 != nil ? armor2.maxsp_plus : 0
- n += armor3 != nil ? armor3.maxsp_plus : 0
- n += armor4 != nil ? armor4.maxsp_plus : 0
- n += get_plus(1)
- return n
- end
- def base_str
- n = $data_actors[@actor_id].parameters[2, @level]
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- n += weapon != nil ? weapon.str_plus : 0
- n += armor1 != nil ? armor1.str_plus : 0
- n += armor2 != nil ? armor2.str_plus : 0
- n += armor3 != nil ? armor3.str_plus : 0
- n += armor4 != nil ? armor4.str_plus : 0
- n += get_plus(2)
- return [[n, 1].max, 999].min
- end
- def base_dex
- n = $data_actors[@actor_id].parameters[3, @level]
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- n += weapon != nil ? weapon.dex_plus : 0
- n += armor1 != nil ? armor1.dex_plus : 0
- n += armor2 != nil ? armor2.dex_plus : 0
- n += armor3 != nil ? armor3.dex_plus : 0
- n += armor4 != nil ? armor4.dex_plus : 0
- n += get_plus(3)
- return [[n, 1].max, 999].min
- end
- def base_agi
- n = $data_actors[@actor_id].parameters[4, @level]
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- n += weapon != nil ? weapon.agi_plus : 0
- n += armor1 != nil ? armor1.agi_plus : 0
- n += armor2 != nil ? armor2.agi_plus : 0
- n += armor3 != nil ? armor3.agi_plus : 0
- n += armor4 != nil ? armor4.agi_plus : 0
- n += get_plus(4)
- return [[n, 1].max, 999].min
- end
- def base_int
- n = $data_actors[@actor_id].parameters[5, @level]
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- n += weapon != nil ? weapon.int_plus : 0
- n += armor1 != nil ? armor1.int_plus : 0
- n += armor2 != nil ? armor2.int_plus : 0
- n += armor3 != nil ? armor3.int_plus : 0
- n += armor4 != nil ? armor4.int_plus : 0
- n += get_plus(5)
- return [[n, 1].max, 999].min
- end
- def base_atk
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- n = 0
- n += weapon != nil ? weapon.atk : 0
- n += armor1 != nil ? armor1.atk_plus : 0
- n += armor2 != nil ? armor2.atk_plus : 0
- n += armor3 != nil ? armor3.atk_plus : 0
- n += armor4 != nil ? armor4.atk_plus : 0
- n += get_plus(6)
- end
- def base_pdef
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- pdef1 = weapon != nil ? weapon.pdef : 0
- pdef2 = armor1 != nil ? armor1.pdef : 0
- pdef3 = armor2 != nil ? armor2.pdef : 0
- pdef4 = armor3 != nil ? armor3.pdef : 0
- pdef5 = armor4 != nil ? armor4.pdef : 0
- return pdef1 + pdef2 + pdef3 + pdef4 + pdef5 + get_plus(7)
- end
- def base_mdef
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- mdef1 = weapon != nil ? weapon.mdef : 0
- mdef2 = armor1 != nil ? armor1.mdef : 0
- mdef3 = armor2 != nil ? armor2.mdef : 0
- mdef4 = armor3 != nil ? armor3.mdef : 0
- mdef5 = armor4 != nil ? armor4.mdef : 0
- return mdef1 + mdef2 + mdef3 + mdef4 + mdef5 + get_plus(8)
- end
- def base_eva
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- eva0 = weapon != nil ? weapon.eva_plus : 0
- eva1 = armor1 != nil ? armor1.eva : 0
- eva2 = armor2 != nil ? armor2.eva : 0
- eva3 = armor3 != nil ? armor3.eva : 0
- eva4 = armor4 != nil ? armor4.eva : 0
- return eva1 + eva2 + eva3 + eva4 + eva0 + get_plus(9)
- end
- end
复制代码
http://rpg.blue/upload_program/f ... 修正_83829712.rar
截图:
套装的设置,如图只要设置装备名称就行了,人性化吧{/cy}
附加值的设置,这是关键,参考下图与脚本注释中的那些“废话”
---------------------------version1.04----------------------------------------
之所以保留v1.00,是因为随着脚本功能的增加,貌似冲突也越来越多,整合也变得越来越难,建议新手还是使用v1.00,稍后我会发布v1.00的修正版本。
更新信息
1.增加套装特技
2.支持每套套装中可以有N多武器N多同类防具
3.完善套装附加属性
- #-------------------------------------------------------------------------------
- #冰冰套装系统 version 1.04 By 凌冰
- #(附带加MAXHP、加MAXSP装备、加回避的武器和加攻击的防具功能)
- #(更新信息v1.01:1、增加套装特技。2、增加双防具套装。3、增加套装属性设置)
- #(更新信息v1.02:1、支持双套装)
- #(更新信息v1.03:1、增加隐藏套装功能)
- #(更新信息v1.04:1、增加套装多种附加属性功能)
- #================================套装的设置================================
- #如范例数据库
- #只要全部在武器、防具前面加上套装名"凌冰"和"之"
- #设置☆套装特技☆
- #在特技名称前加套装名"凌冰"和"之",支持多个技能
- #接着设置套装附加属性
- #在防具里新建防具,无所谓是盾还是头盔什么的,只要名字是套装名"凌冰"
- #设置附加属性
- #直接在物防、魔防、回避、力量、敏捷、速度、魔力、自动状态、状态防御、属性防御里
- #设置相应的附加值。至于攻击、MAXHP、MAXSP的附加值,则需要用到附加功能
- #在说明里添加精+数值、灵+数值、攻+数值(要有+号)设置相应附加值
- #在武器里新建武器,名字是套装名"凌冰"
- #这个只用于描述物理攻击属性、物理攻击附加状态、物理攻击清楚状态(感觉有些浪费)
- #,只要设置相应值就行了
- #(如果不需要可以不新建这个武器,orz不需要的话不新建那个防具都可以)
- #具体设置参考范例
- #当然设置的这个防具在游戏中也是可用的,但是不算在套装里
- #然后说明一下☆附加功能☆
- #同上文关于套装附加属性的设置
- #武器在说明里添加精+数值、灵+数值、避+数值(要有+号)设置相应值
- #防具在说明里添加精+数值、灵+数值、攻+数值(要有+号)设置相应值
- #☆双武器双防具套装功能说明☆
- #凌冰套装包含:凌冰之铜剑、凌冰之铜盾、凌冰之铜盔、凌冰之铜铠
- #或: 凌冰之铜枪、凌冰之铜盾、凌冰之铜盔、凌冰之铜铠
- #上面是version 1.00的范例的设置,你现在可以打开范例工程看,除了密斯利尔和塞因特
- #(对比用)全被我改成了凌冰套装,也就是说实现了vesion 1.00不能实现的双防具套装
- #功能,其实是N防具N武器套装,只要穿上凌冰套装中任意5件(你也只能穿5件),就能附
- #加套装属性。这样,同时也暴露了本脚本的另一个缺陷,见下文第二。当然并没有限制套
- #装一定包含5类装备。例如:某套装:武器、头盔1、头盔2、身体、盾。只要装备其中四
- #项就行
- #☆双套装功能☆说明
- #如工程中的范例,除凌冰套装外,还有夏桀凌和魔敬轩套装,夏桀凌套装只包括头和身体
- #两类,而魔敬轩套装只包括盾和装饰两类。夏桀凌套装的套装属性是精+100,魔敬轩套装
- #套装属性是灵+100,同时装备着两个套装后,可以同时附加maxhp+100和maxsp+100。如果
- #可以整合装备扩展的话,可以实现三套装、四套装甚至更多(orz)(其实,现在就可以
- #实现五套装,但显然没什么太大意义)
- #隐藏套装☆New!
- #按照禾西的建议我做了隐藏套装功能,在数据库系统里新加一个属性,名称为隐藏套装,
- #所需要隐藏的套装的每一个武器、防具、技能都要勾上这个属性。
- #套装多种附加属性功能☆New!
- #根据套装成分不同变化附加属性。例如上文的凌冰套装,同时装备其他装备,再装备凌冰
- #之铜剑和凌冰之铜枪效果是不一样的(在有的游戏中这种情况效果是不一样的)。设置方
- #法:在武器、防具的说明里添加“类型:***”***为类型名,再在数据库里设置描述防具
- #和描述武器,名称为***,设置方法与套装的描述防具和描述武器设置方法相同。而所要
- #增加的技能名称为套装的名称+“之”+???,另外要在技能说明里增加“类型:***”
- #如范例,凌冰之铜剑的剑类型附加属性为物防+100,也就是说在原来的套装属性上再叠加
- #物防100,如果装备了凌冰之铁枪,则在叠加魔防100,并且学会凌冰之淫荡,换成其他装
- #备凌冰之淫荡则被遗忘。
- #如果想更灵活的改变套装属性,那就多设置几个类型就OK了,这也就是为什么我没有用防
- #具在数据库里设置的类别进行类别判定的原因。
- #================================脚本的缺陷================================
- #我不说你们早晚也会发现的,所以还不如事先承认了
- #第一、不能设置套装不全的部分附加,暗黑破坏神里,如果套装不全,而装备的套装数量
- # 大于一,就会实现套装属性的部分附加。但是本脚本暂时不具备此功能,也就是说
- # 想附加套装属性缺一不可。
- #解释:不是我做不到,只是实现这个功能会增加使用这个脚本的人的工作量,而且增加的
- # 不是一般的多。
- #其他缺陷和BUG望大家及时反馈给我,发站内短信给我就行
- #-------------------------------------------------------------------------------
- module RPG
- class Weapon
- def tao
- return nil if @name.split(/之/)[1] == nil
- return @name.split(/之/)[0]
- end
- def maxhp_plus
- return 0 if @description.split(/精+/)[1] == nil
- return @description.split(/精+/)[1].to_i
- end
- def maxsp_plus
- return 0 if @description.split(/灵+/)[1] == nil
- return @description.split(/灵+/)[1].to_i
- end
- def eva_plus
- return 0 if @description.split(/避+/)[1] == nil
- return @description.split(/避+/)[1].to_i
- end
- def name
- a = @name
- if tao != nil and tao_hide?
- return a.split(/之/)[1]
- end
- return a
- end
- def get_hide_id
- if @hide_id == nil
- result = nil
- for i in 1 ... $data_system.elements.size
- if $data_system.elements[i] == "隐藏套装"
- result = i
- break
- end
- end
- @hide_id = result == nil ? 0 : result
- end
- return @hide_id
- end
- def tao_hide?
- id = get_hide_id
- if element_set.include?(id)
- return true
- end
- return false
- end
- def plus_kind
- return nil if @description.split(/类型:/)[1] == nil
- return @description.split(/类型:/)[1].to_s
- end
- end
- class Armor
- def tao
- return nil if @name.split(/之/)[1] == nil
- return @name.split(/之/)[0]
- end
- def maxhp_plus
- return 0 if @description.split(/精+/)[1] == nil
- return @description.split(/精+/)[1].to_i
- end
- def maxsp_plus
- return 0 if @description.split(/灵+/)[1] == nil
- return @description.split(/灵+/)[1].to_i
- end
- def atk_plus
- return 0 if @description.split(/攻+/)[1] == nil
- return @description.split(/攻+/)[1].to_i
- end
- def name
- a = @name
- if tao != nil and tao_hide?
- return a.split(/之/)[1]
- end
- return a
- end
- def get_hide_id
- if @hide_id == nil
- result = nil
- for i in 1 ... $data_system.elements.size
- if $data_system.elements[i] == "隐藏套装"
- result = i
- break
- end
- end
- @hide_id = result == nil ? 0 : result
- end
- return @hide_id
- end
- def tao_hide?
- id = get_hide_id
- if guard_element_set.include?(id)
- return true
- end
- return false
- end
- def plus_kind
- return nil if @description.split(/类型:/)[1] == nil
- return @description.split(/类型:/)[1].to_s
- end
- end
- class Skill
- def tao
- return nil if @name.split(/之/)[1] == nil
- return @name.split(/之/)[0]
- end
- def name
- a = @name
- if tao != nil and tao_hide?
- return a.split(/之/)[1]
- end
- return a
- end
- def get_hide_id
- if @hide_id == nil
- result = nil
- for i in 1 ... $data_system.elements.size
- if $data_system.elements[i] == "隐藏套装"
- result = i
- break
- end
- end
- @hide_id = result == nil ? 0 : result
- end
- return @hide_id
- end
- def tao_hide?
- id = get_hide_id
- if element_set.include?(id)
- return true
- end
- return false
- end
- def plus_kind
- return nil if @description.split(/类型:/)[1] == nil
- return @description.split(/类型:/)[1].to_s
- end
- end
- end
- class Game_Actor < Game_Battler
- def get_tao_num(tao)
- tao_num = 0
- @tao = tao
- armors = []
- for i in 0...4
- armors[i] = []
- end
- for i in 1...$data_armors.size
- case $data_armors[i].kind
- when 0
- armors[0].push(i)
- when 1
- armors[1].push(i)
- when 2
- armors[2].push(i)
- when 3
- armors[3].push(i)
- end
- end
- for i in 0...4
- for id in armors[i]
- armor = $data_armors[id]
- if @tao == armor.tao
- tao_num += 1
- break
- end
- end
- end
- for i in 1...$data_weapons.size
- weapon = $data_weapons[i]
- if weapon.tao == @tao
- tao_num += 1
- break
- end
- end
- return tao_num
- end
- def get_tao
- tao = []
- weapon = $data_weapons[@weapon_id]
- tao.push(weapon.tao) if weapon != nil and weapon.tao != nil
- for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id]
- armor = $data_armors[i]
- unless armor == nil or tao.include?(armor.tao)
- tao.push(armor.tao) if armor.tao != nil
- end
- end
- return tao
- end
- def tao_whole?(tao)
- @now_tao_num = 0
- @tao_num = get_tao_num(tao)
- weapon = $data_weapons[@weapon_id]
- if weapon != nil and weapon.tao != nil and weapon.tao == tao
- @now_tao_num += 1
- end
- for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id]
- armor = $data_armors[i]
- unless armor == nil
- if armor != nil and armor.tao != nil and armor.tao == tao
- @now_tao_num += 1
- end
- end
- end
- if @now_tao_num == @tao_num
- return true
- end
- return false
- end
- def get_tao_plus(tao,parameter)
- for i in 1...$data_armors.size
- armor = $data_armors[i]
- if armor.name == tao
- case parameter
- when 0
- return armor.maxhp_plus
- when 1
- return armor.maxsp_plus
- when 2
- return armor.str_plus
- when 3
- return armor.dex_plus
- when 4
- return armor.agi_plus
- when 5
- return armor.int_plus
- when 6
- return armor.atk_plus
- when 7
- return armor.pdef
- when 8
- return armor.mdef
- when 9
- return armor.eva
- when 10
- return [armor.auto_state_id]
- when 11
- return armor.guard_element_set
- when 12
- return armor.guard_state_set
- end
- end
- end
- for i in 1...$data_weapons.size
- weapon = $data_weapons[i]
- if weapon.name == tao
- case parameter
- when 13
- return weapon.element_set
- when 14
- return weapon.plus_state_set
- when 15
- return weapon.minus_state_set
- end
- end
- end
- if parameter < 10
- return 0
- else
- return []
- end
- end
- def get_tao_skill(tao)
- tao_skill_list = []
- for i in 1...$data_skills.size
- skill = $data_skills[i]
- if skill.tao == tao
- tao_skill_list.push(i)
- end
- end
- return tao_skill_list
- end
- def base_maxhp
- n = $data_actors[@actor_id].parameters[0, @level]
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- n += weapon != nil ? weapon.maxhp_plus : 0
- n += armor1 != nil ? armor1.maxhp_plus : 0
- n += armor2 != nil ? armor2.maxhp_plus : 0
- n += armor3 != nil ? armor3.maxhp_plus : 0
- n += armor4 != nil ? armor4.maxhp_plus : 0
- tao_list = get_tao
- for tao in tao_list
- if tao_whole?(tao)
- n += tao_kind_plus(tao,0)
- #n += get_tao_plus(tao,0)
- end
- end
- return n
- end
- def base_maxsp
- n = $data_actors[@actor_id].parameters[1, @level]
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- n += weapon != nil ? weapon.maxsp_plus : 0
- n += armor1 != nil ? armor1.maxsp_plus : 0
- n += armor2 != nil ? armor2.maxsp_plus : 0
- n += armor3 != nil ? armor3.maxsp_plus : 0
- n += armor4 != nil ? armor4.maxsp_plus : 0
- tao_list = get_tao
- for tao in tao_list
- if tao_whole?(tao)
- n += tao_kind_plus(tao,1)
- #n += get_tao_plus(tao,1)
- end
- end
- return n
- end
- def base_str
- n = $data_actors[@actor_id].parameters[2, @level]
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- n += weapon != nil ? weapon.str_plus : 0
- n += armor1 != nil ? armor1.str_plus : 0
- n += armor2 != nil ? armor2.str_plus : 0
- n += armor3 != nil ? armor3.str_plus : 0
- n += armor4 != nil ? armor4.str_plus : 0
- tao_list = get_tao
- for tao in tao_list
- if tao_whole?(tao)
- n += tao_kind_plus(tao,2)
- #n += get_tao_plus(tao,2)
- end
- end
- return [[n, 1].max, 999].min
- end
- def base_dex
- n = $data_actors[@actor_id].parameters[3, @level]
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- n += weapon != nil ? weapon.dex_plus : 0
- n += armor1 != nil ? armor1.dex_plus : 0
- n += armor2 != nil ? armor2.dex_plus : 0
- n += armor3 != nil ? armor3.dex_plus : 0
- n += armor4 != nil ? armor4.dex_plus : 0
- tao_list = get_tao
- for tao in tao_list
- if tao_whole?(tao)
- n += tao_kind_plus(tao,3)
- #n += get_tao_plus(tao,3)
- end
- end
- return [[n, 1].max, 999].min
- end
- def base_agi
- n = $data_actors[@actor_id].parameters[4, @level]
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- n += weapon != nil ? weapon.agi_plus : 0
- n += armor1 != nil ? armor1.agi_plus : 0
- n += armor2 != nil ? armor2.agi_plus : 0
- n += armor3 != nil ? armor3.agi_plus : 0
- n += armor4 != nil ? armor4.agi_plus : 0
- tao_list = get_tao
- for tao in tao_list
- if tao_whole?(tao)
- n += tao_kind_plus(tao,4)
- #n += get_tao_plus(tao,4)
- end
- end
- return [[n, 1].max, 999].min
- end
- def base_int
- n = $data_actors[@actor_id].parameters[5, @level]
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- n += weapon != nil ? weapon.int_plus : 0
- n += armor1 != nil ? armor1.int_plus : 0
- n += armor2 != nil ? armor2.int_plus : 0
- n += armor3 != nil ? armor3.int_plus : 0
- n += armor4 != nil ? armor4.int_plus : 0
- tao_list = get_tao
- for tao in tao_list
- if tao_whole?(tao)
- n += tao_kind_plus(tao,5)
- #n += get_tao_plus(tao,5)
- end
- end
- return [[n, 1].max, 999].min
- end
- def base_atk
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- n = 0
- n += weapon != nil ? weapon.atk : 0
- n += armor1 != nil ? armor1.atk_plus : 0
- n += armor2 != nil ? armor2.atk_plus : 0
- n += armor3 != nil ? armor3.atk_plus : 0
- n += armor4 != nil ? armor4.atk_plus : 0
- tao_list = get_tao
- for tao in tao_list
- if tao_whole?(tao)
- n += tao_kind_plus(tao,6)
- #n += get_tao_plus(tao,6)
- end
- end
- return n
- end
- def base_pdef
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- pdef1 = weapon != nil ? weapon.pdef : 0
- pdef2 = armor1 != nil ? armor1.pdef : 0
- pdef3 = armor2 != nil ? armor2.pdef : 0
- pdef4 = armor3 != nil ? armor3.pdef : 0
- pdef5 = armor4 != nil ? armor4.pdef : 0
- n = pdef1 + pdef2 + pdef3 + pdef4 + pdef5
- tao_list = get_tao
- for tao in tao_list
- n += tao_whole?(tao) ? tao_kind_plus(tao,7): 0
- #n += tao_whole?(tao) ? get_tao_plus(tao,7): 0
- end
- return n
- end
- def base_mdef
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- mdef1 = weapon != nil ? weapon.mdef : 0
- mdef2 = armor1 != nil ? armor1.mdef : 0
- mdef3 = armor2 != nil ? armor2.mdef : 0
- mdef4 = armor3 != nil ? armor3.mdef : 0
- mdef5 = armor4 != nil ? armor4.mdef : 0
- n = mdef1 + mdef2 + mdef3 + mdef4 + mdef5
- tao_list = get_tao
- for tao in tao_list
- n += tao_whole?(tao) ? tao_kind_plus(tao,8): 0
- #n += tao_whole?(tao) ? get_tao_plus(tao,8): 0
- end
- return n
- end
- def base_eva
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- eva0 = weapon != nil ? weapon.eva_plus : 0
- eva1 = armor1 != nil ? armor1.eva : 0
- eva2 = armor2 != nil ? armor2.eva : 0
- eva3 = armor3 != nil ? armor3.eva : 0
- eva4 = armor4 != nil ? armor4.eva : 0
- n = eva1 + eva2 + eva3 + eva4 + eva0
- tao_list = get_tao
- for tao in tao_list
- n += tao_whole?(tao) ? tao_kind_plus(tao,9): 0
- #n += tao_whole?(tao) ? get_tao_plus(tao,9): 0
- end
- return n
- end
- alias tao_element_rate element_rate
- def element_rate(element_id)
- result = tao_element_rate(element_id)
- tao_list = get_tao
- for tao in tao_list
- if tao_whole?(tao)
- tao_element_guard = tao_kind_plus(tao,11)
- result/= 2 if tao_element_guard.include?(element_id)
- end
- end
- return result
- end
- alias tao_state_guard? state_guard?
- def state_guard?(state_id)
- tao_list = get_tao
- result = tao_state_guard?(state_id)
- for tao in tao_list
- if !result and tao_whole?(tao)
- tao_state_guard = tao_kind_plus(tao,12)
- result = true if tao_state_guard.include?(state_id)
- end
- end
- return result
- end
- alias tao_element_set element_set
- def element_set
- tao_list = get_tao
- result = tao_element_set
- for tao in tao_list
- if tao_whole?(tao)
- tao_element = tao_kind_plus(tao,13)
- for i in tao_element
- result.push(i) if !result.include?(i)
- end
- end
- end
- return result
- end
- alias tao_plus_state_set plus_state_set
- def plus_state_set
- tao_list = get_tao
- result = tao_plus_state_set
- for tao in tao_list
- if tao_whole?(tao)
- tao_plus_state = tao_kind_plus(tao,14)
- for i in tao_plus_state
- result.push(i) if !result.include?(i)
- end
- end
- end
- return result
- end
- alias tao_minus_state_set minus_state_set
- def minus_state_set
- tao_list = get_tao
- result = tao_minus_state_set
- for tao in tao_list
- if tao_whole?(tao)
- tao_minus_state = tao_kind_plus(tao,15)
- for i in tao_minus_state
- result.push(i) if !result.include?(i)
- end
- end
- end
- return result
- end
- def tao_kind_plus(tao,parameter)
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- n = get_tao_plus(tao,parameter)
- if weapon != nil and tao == weapon.tao
- n += get_tao_plus(weapon.plus_kind,parameter)
- end
- if armor1 != nil and tao == armor1.tao
- n += get_tao_plus(armor1.plus_kind,parameter)
- end
- if armor2 != nil and tao == armor2.tao
- n += get_tao_plus(armor2.plus_kind,parameter)
- end
- if armor3 != nil and tao == armor3.tao
- n += get_tao_plus(armor3.plus_kind,parameter)
- end
- if armor4 != nil and tao == armor4.tao
- n += get_tao_plus(armor4.plus_kind,parameter)
- end
- return n
- end
- alias tao_equip equip
- def equip(equip_type, id)
- tao_equip(equip_type, id)
- tao_list = get_tao
- for tao in tao_list
- tao_skill_list = get_tao_skill(tao)
- for i in tao_skill_list
- learn_skill(i) if tao_whole?(tao)
- forget_skill(i) if skill_learn?(i) and !tao_whole?(tao)
- if $data_weapons[@weapon_id] != nil and
- $data_weapons[@armor1_id] != nil and
- $data_weapons[@armor2_id] != nil and
- $data_weapons[@armor3_id] != nil and
- $data_weapons[@armor4_id] != nil
- if $data_skills[i].plus_kind != $data_weapons[@weapon_id].plus_kind and
- $data_skills[i].plus_kind != $data_weapons[@armor1_id].plus_kind and
- $data_skills[i].plus_kind != $data_weapons[@armor2_id].plus_kind and
- $data_skills[i].plus_kind != $data_weapons[@armor3_id].plus_kind and
- $data_skills[i].plus_kind != $data_weapons[@armor4_id].plus_kind and
- $data_skills[i].plus_kind != nil
- forget_skill(i)
- end
- end
- end
- state_id = get_tao_plus(tao,10)
- for id in state_id
- add_state(id, true) if tao_whole?(tao)
- remove_state(id, true) if state?(id) and !tao_whole?(tao)
- end
- end
- end
- alias tao_setup setup
- def setup(actor_id)
- tao_setup(actor_id)
- tao_list = get_tao
- for tao in tao_list
- tao_skill_list = get_tao_skill(tao)
- for i in tao_skill_list
- if tao_whole?(tao) and
- ($data_skills[i].plus_kind == $data_weapons[@weapon_id].plus_kind or
- $data_skills[i].plus_kind == $data_weapons[@armor1_id].plus_kind or
- $data_skills[i].plus_kind == $data_weapons[@armor2_id].plus_kind or
- $data_skills[i].plus_kind == $data_weapons[@armor3_id].plus_kind or
- $data_skills[i].plus_kind == $data_weapons[@armor4_id].plus_kind)
- learn_skill(i)
- end
- end
- state_id = get_tao_plus(tao,10)
- for id in state_id
- add_state(id, true) if tao_whole?(tao)
- end
- end
- end
- end
复制代码
范例工程:
http://rpg.blue/upload_program/f ... �v1.04_85864596.rar
套装成分的设置
武器设置:一个套装可以有N多武器
防具设置:一个套装可以有N多防具
套装附加属性的设置
描述用防具:可以全填满
描述用武器:只填这两项(其实是三项)和名称(还是为套装名)
套装特技的设置
还是只要设置名称就行,人性化吧{/cy}
|
|