赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 470 |
最后登录 | 2012-4-8 |
在线时间 | 12 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 12 小时
- 注册时间
- 2012-2-15
- 帖子
- 9
|
用的是这个:http://rpg.blue/thread-135748-1-1.html
新建人物,然后执行事件
人物id在10以内没问题,可是人物id在十以上的时候
就会出现这个情况
不知道是怎么回事。。。
在下是个新手,脚本神马的一窍不通,所以也不会弄。。。
只好在这里发帖求助了。。。
因为权限太低没办法把工程传上来。。。所以麻烦各位前辈去下载原帖的附件再自己新建角色了。。。
拜托求解。。。
附上脚本:- #==============================================================================
- # ■ Game_Actor 追加
- #------------------------------------------------------------------------------
- # 角色结晶槽的升级接口函数为:
- # <Game_Actor实例>.cs_levelup(结晶槽ID, 升级幅度) 升级幅度省略则为1
- #==============================================================================
- class Game_Actor < Game_Battler
- #--------------------------------------------------------------------------
- # ● 定义实例变量
- #--------------------------------------------------------------------------
- attr_reader :crystal_element # 结晶槽的属性
- attr_reader :crystal_total # 结晶槽的能量
- attr_reader :crystal_level # 结晶槽等级 crystal_slot
- attr_reader :slot # 结晶槽装备位
- attr_reader :skill # 通过结晶装备所掌握的技能≠skills
- attr_reader :state # 通过结晶装备所附加的状态≠states
- attr_accessor :cp_store # 添加怒气槽
- attr_accessor :skill_S # 添加爆发技能
- attr_reader :crystal_types # 添加同种回路不可多个装备记录用数组
- attr_reader :battle_formation # 角色的战斗队列
- #--------------------------------------------------------------------------
- # ● 设置
- # actor_id : 角色 ID
- #--------------------------------------------------------------------------
- alias xpold_setup setup
- def setup(actor_id)
- xpold_setup(actor_id)
- @skill_S = nil
- @cp_store = 0
- @crystal_element = CRYSTAL::SLOT_ELEMENT[actor_id].clone
- @crystal_total = []
- @crystal_types = [0]
- for i in 0...CRYSTAL::SLOT_LINE[actor_id].size
- @crystal_total[i] = Array.new(CRYSTAL::ELE_NUMBER,0)
- end
- @crystal_level = CRYSTAL::SLOT_LEVEL[actor_id].clone
-
- @slot = Array.new(8,0)
- @skill = []
- for i in 0...CRYSTAL::SLOT_LINE[actor_id].size
- @skill[i] = []
- end
- @state = []
- if actor_id < 35
- @battle_formation = actor_id
- else
- @battle_formation = actor_id%35
- end
- end
- def gain_cp(val=0)
- @cp_store += val
- if @cp_store > 200
- @cp_store = 200
- end
- if @cp_store <0
- @cp_store = 0
- end
- end
- def battle_formation=(battle_formation)
- @battle_formation = battle_formation
- end
-
- #--------------------------------------------------------------------------
- # ● 获取所有回路中某种结晶能量的最大值
- # type : 某种结晶能量
- #--------------------------------------------------------------------------
- def ce_total(type)
- return -1 if id > CRYSTAL::ELE_NUMBER or id < 1
- result = 0
- for crystal_line in @crystal_total
- result = crystal_line[type - 1] if crystal_line[type - 1] > result
- end
- return result
- end
- #--------------------------------------------------------------------------
- # ● 装备结晶石
- # type : 结晶槽ID
- # id : 结晶石ID
- #--------------------------------------------------------------------------
- def ce_equip(type, id)
- return false unless ce_can_equip(type, id)
-
- if id == 0 or $game_party.armor_number(id) > 0
- #取下当前回路-------
- update_auto_state_($data_armors[@slot[type]], $data_armors[id])
- $game_party.gain_armor(@slot[type], 1)
- #取消当前回路的种类的限制
- @crystal_types.delete($data_armors[@slot[type]].cry_type) if $data_armors[@slot[type]] != nil
-
- unless @slot[type] == 0
- for j in 0...CRYSTAL::ELE_NUMBER
- for i in self.which_line?(type)
- @crystal_total[i][j] -= $data_armors[@slot[type]].crystal_element[j]
- end
- end
- end
- #-------------------
- #装备上新的回路-----
- @slot[type] = id
- $game_party.lose_armor(id, 1)
- unless @slot[type] == 0
- for j in 0...CRYSTAL::ELE_NUMBER
- for i in self.which_line?(type)
- @crystal_total[i][j] += $data_armors[@slot[type]].crystal_element[j]
- end
- end
- end
- for i in self.which_line?(type)
- new_total = @crystal_total[i].clone
- self.learn_new(new_total,i)
- end
-
- for i in @skills
- if $data_skills[i] != nil
- if not $data_skills[i].element_set.include?(20)# 金光华
- @skills.delete(i) # 金光华
- end
- end
- end
-
- for i in @skill
- @skills |= i
- end
- #-------------------
- #增加新的回路的种类限制
- if id != 0 and $data_armors[id].cry_type >= 0
- @crystal_types.push($data_armors[id].cry_type)
- end
- end
- return true
- end
- #--------------------------------------------------------------------------
- # ● 学习新技能
- # new : 当前所在回路的结晶槽属性值
- # line : 当前所在的回路编号
- #--------------------------------------------------------------------------
- def learn_new(new,line)
- for i in RPG::SKILL_BEGIN...$data_skills.size
- next if $data_skills[i].name.nil?
- flag = true
- for j in 0...CRYSTAL::ELE_NUMBER
- flag &= $data_skills[i].require_element[j] <= new[j]
- end
- if flag
- @skill[line] |= [i]
- else
- @skill[line].delete(i)
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 检测某结晶槽是否可装备某结晶石
- # type : 结晶槽ID
- # id : 结晶石ID
- #--------------------------------------------------------------------------
- def ce_can_equip(type, id)
- return true if id == 0
- return false if $data_armors[id] != nil and @crystal_types.include?($data_armors[id].cry_type) and (slot[type] == 0 or $data_armors[slot[type]].cry_type != $data_armors[id].cry_type)
-
- if @crystal_element[type - 1] == 0
- return $data_armors[id].level <= @crystal_level[type - 1]
- else
- return (($data_armors[id].element == @crystal_element[type - 1]) and ($data_armors[id].level <= @crystal_level[type - 1]))
- end
- end
- #--------------------------------------------------------------------------
- # ● 结晶槽升级
- # id : 结晶槽ID
- # up : 升级幅度,默认为1
- # PS:最高3级
- #--------------------------------------------------------------------------
- def cs_levelup(id, up = 1)
- @crystal_level[id] += up
- end
- #--------------------------------------------------------------------------
- # ● 检测技能是否可用,与默认方法略微不同
- # skill_id : 技能ID
- #--------------------------------------------------------------------------
- def skill_can_use?(skill_id)
- return super
- end
- #--------------------------------------------------------------------------
- # ● 检测指定结晶槽所在的回路编号
- # id : 结晶槽ID
- #--------------------------------------------------------------------------
- def which_line?(id)
- result = []
- for i in 0...CRYSTAL::SLOT_LINE[@actor_id].size
- result.push(i) if CRYSTAL::SLOT_LINE[@actor_id][i].include?(id)
- end
- return result
- end
- #--------------------------------------------------------------------------
- # ● skills 追加方法
- #--------------------------------------------------------------------------
- def skills=(skills)
- @skills = skills
- end
- #--------------------------------------------------------------------------
- # ● 更新自动状态
- # old_armor : 卸下防具
- # new_armor : 装备防具
- #--------------------------------------------------------------------------
- def update_auto_state_(old_armor, new_armor)
- # 强制解除卸下防具的自动状态
- if old_armor != nil and old_armor.auto_state_id != 0
- remove_state_(old_armor.auto_state_id, true)
- end
- # 强制附加装备防具的自动状态
- if new_armor != nil and new_armor.auto_state_id != 0
- add_state_(new_armor.auto_state_id, true)
- end
- end
- #--------------------------------------------------------------------------
- # ● 附加状态
- # state_id : 状态 ID
- # force : 强制附加标志 (处理自动状态时使用)
- #--------------------------------------------------------------------------
- def add_state_(state_id, force = false)
- # 无效状态的情况下
- if $data_states[state_id] == nil
- # 过程结束
- return
- end
- @states.push(state_id)
- # 检查 HP 及 SP 的最大值
- @hp = [@hp, self.maxhp].min
- @sp = [@sp, self.maxsp].min
- end
- #--------------------------------------------------------------------------
- # ● 解除状态
- # state_id : 状态 ID
- # force : 强制解除标志 (处理自动状态时使用)
- #--------------------------------------------------------------------------
- def remove_state_(state_id, force = false)
- @states.delete_at(@states.index(state_id))
- # 检查 HP 及 SP 的最大值
- @hp = [@hp, self.maxhp].min
- @sp = [@sp, self.maxsp].min
- end
- alias old_str base_str
- #--------------------------------------------------------------------------
- # ● 获取基本力量
- #--------------------------------------------------------------------------
- def base_str
- n = old_str
- for i in 1..7
- n += $data_armors[@slot[i]] != nil ? $data_armors[@slot[i]].str_plus : 0
- end
- return [[n, 1].max, 999].min
- end
- alias old_dex base_dex
- #--------------------------------------------------------------------------
- # ● 获取基本灵巧
- #--------------------------------------------------------------------------
- def base_dex
- n = old_dex
- for i in 1..7
- n += $data_armors[@slot[i]] != nil ? $data_armors[@slot[i]].dex_plus : 0
- end
- return [[n, 1].max, 999].min
- end
- alias old_agi base_agi
- #--------------------------------------------------------------------------
- # ● 获取基本速度
- #--------------------------------------------------------------------------
- def base_agi
- n = old_agi
- for i in 1..7
- n += $data_armors[@slot[i]] != nil ? $data_armors[@slot[i]].agi_plus : 0
- end
- return [[n, 1].max, 999].min
- end
- alias old_int base_int
- #--------------------------------------------------------------------------
- # ● 获取基本魔力
- #--------------------------------------------------------------------------
- def base_int
- n = old_int
- for i in 1..7
- n += $data_armors[@slot[i]] != nil ? $data_armors[@slot[i]].int_plus : 0
- end
- return [[n, 1].max, 999].min
- end
- alias old_pdef base_pdef
- #--------------------------------------------------------------------------
- # ● 获取基本物理防御
- #--------------------------------------------------------------------------
- def base_pdef
- pdef = old_pdef
- for i in 1..7
- pdef += $data_armors[@slot[i]] != nil ? $data_armors[@slot[i]].pdef : 0
- end
- return pdef
- end
- alias old_mdef base_mdef
- #--------------------------------------------------------------------------
- # ● 获取基本魔法防御
- #--------------------------------------------------------------------------
- def base_mdef
- mdef = old_mdef
- for i in 1..7
- mdef += $data_armors[@slot[i]] != nil ? $data_armors[@slot[i]].mdef : 0
- end
- return mdef
- end
- alias old_eva base_eva
- #--------------------------------------------------------------------------
- # ● 获取基本回避修正
- #--------------------------------------------------------------------------
- def base_eva
- eva = old_eva
- for i in 1..7
- eva += $data_armors[@slot[i]] != nil ? $data_armors[@slot[i]].eva : 0
- end
- return eva
- end
- end
复制代码
‘‘──529708851于2012-2-21 19:49补充以下内容
没人么。。。求解啊。。。
’’ |
|