| 赞 | 0 |
| VIP | |
| 好人卡 | |
| 积分 | 1 |
| 经验 | |
| 最后登录 | 2020-2-22 |
| 在线时间 | 186 小时 |
- 梦石
- 0
- 星屑
- 90
- 在线时间
- 186 小时
- 注册时间
- 2010-6-24
- 回帖
- 85
|
楼主 |
发表于 2015-9-12 20:32:09
|
显示全部楼层
刚才自己试了一下,发现好像等级上线脚本本身没有问题,是因为加点脚本导致的,请问各位大该改哪里呀?谢谢
- #==============================================================================
- # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
- #==============================================================================
- # 脚本使用设定:
- LEVEL_UP_POINT = 3 # 每升一级所增加的点数
- LEVEL_UP_VARIABLE = 100 # 储存角色点数的变量编号与角色id编号的差值
- # 默认情况 = 100,
- # 则是数据库里1号角色的加点数存于101号变量
- # 3号角色的加点数存于103号变量。
- # 你可以直接操作变量赠与角色可分配点数
- # 每增加一次点数,各项能力值的变化:357-410行
-
- # 使用方法介绍:
- # 本脚本不会取代原猩豆δ埽皇且桓龈郊庸δ堋?BR># 也就是说,默认的升级还在,但可以用这个功能手动追加点数。
- # 如果你想纯粹使用手动加点(而升级不提升能力),只要把数据库中角色升级能力,
- # 1-99级全部等于一个相同数值就行了。
- # 呼唤加点场景的方法:$scene = Scene_Lvup.new(角色编号,返回菜单编号)。
- # 默认都是0号
- # 加点场景中,page up,page down换人,如果想加点完毕后返回地图,
- # 464行$scene = Scene_Menu.new(0)改为$scene = Scene_Map.new
- # 推荐脚本搭配:魔法商店脚本,两者结合,制作自由型RPG
- #==============================================================================
- # ■ Game_Actor
- #------------------------------------------------------------------------------
- # 处理角色的类。(再定义)
- #==============================================================================
- class Game_Actor < Game_Battler
- #--------------------------------------------------------------------------
- # ● 更改 EXP
- # exp : 新的 EXP
- #--------------------------------------------------------------------------
- def exp=(exp)
- @exp = [exp, 0].max
- # 升级
- while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
- @level += 1
- # 增加4点可自由分配的点数
- if self.id > 30
- $game_variables[self.id + LEVEL_UP_VARIABLE] += 5
- else
- ##修改
- # 打开开关1,id为3的角色额外获得2点,打开开关2,id为4的角色额外获得2点,以此类推
- extra_point = $game_switches[self.id + 1524] ? 2 : 0
- $game_variables[self.id + LEVEL_UP_VARIABLE] += (LEVEL_UP_POINT + extra_point)
- ($db_point[@actor_id])[5] += (LEVEL_UP_POINT + extra_point)#加的1行
- end
- # 学会特技
- for j in $data_classes[@class_id].learnings
-
- if j.level == @level
- if @level >= 99
- else
- learn_skill(j.skill_id)
- end
- end
- end
- end
- # 降级
- while @exp < @exp_list[@level]
- # 遗忘特技
- for j in $data_classes[@class_id].learnings
-
- if j.level == @level
- if @level >= 99
- else
- forget_skill(j.skill_id)
- end
- end
- end
- @level -= 1
- end
- # 修正当前的 HP 与 SP 超过最大值
- @hp = [@hp, self.maxhp].min
- @sp = [@sp, self.maxsp].min
- $game_temp.common_event_id = 178
- end
- end
- #==============================================================================
- # ■ Window_Base
- #------------------------------------------------------------------------------
- # 游戏中全部窗口的超级类(追加定义)
- #==============================================================================
- class Window_Base < Window
- #--------------------------------------------------------------------------
- # ● 描绘 HP
- # actor : 角色
- # x : 描画目标 X 坐标
- # y : 描画目标 Y 坐标
- # width : 描画目标的宽
- #--------------------------------------------------------------------------
- def draw_actor_hp_lvup(actor, x, y)
- self.contents.font.color = Color.new(79,39,0,255)
- if $temp_hp == 0
- self.contents.font.color = Color.new(79,39,0,255)
- self.contents.draw_text(x + 120 , y, 48, 32, actor.maxhp.to_s, 2)
- else
- maxhp = actor.maxhp + $temp_hp.to_i
- self.contents.font.color = Color.new(79,39,0,255)
- # self.contents.draw_text(x + 120 , y, 48, 32, maxhp.to_s ,2)
- self.contents.font.color = normal_color
- # self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
- if $temp_hp >=0
- self.contents.font.color = Color.new(0, 255, 0)
- self.contents.draw_text(x + 120 , y, 48, 32, maxhp.to_s ,2)
- # self.contents.draw_text(x + 155, y, 36, 32, " +",2)
- else
- self.contents.font.color = Color.new(0, 255, 0)
- self.contents.draw_text(x + 120 , y, 48, 32, maxhp.to_s ,2)
- # self.contents.draw_text(x + 155, y, 36, 32, " -",2)
- end
- # self.contents.draw_text(x + 200, y, 36, 32, $temp_hp.to_s, 2)
- self.contents.font.color = Color.new(79,39,0,255)
- # self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
- end
- end
- #--------------------------------------------------------------------------
- # ● 描绘 SP
- # actor : 角色
- # x : 描画目标 X 坐标
- # y : 描画目标 Y 坐标
- # width : 描画目标的宽
- #--------------------------------------------------------------------------
- def draw_actor_sp_lvup(actor, x, y)
- self.contents.font.color = Color.new(79,39,0,255)
- if $temp_sp == 0
- self.contents.font.color = Color.new(79,39,0,255)
- self.contents.draw_text(x + 120 , y, 48, 32, actor.maxsp.to_s, 2)
- else
- maxsp = actor.maxsp + $temp_sp.to_i
- self.contents.font.color = Color.new(79,39,0,255)
- # self.contents.draw_text(x + 120 , y, 48, 32, maxsp.to_s ,2)
- self.contents.font.color = normal_color
- # self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
- if $temp_sp >=0
- self.contents.font.color = Color.new(0, 255, 0)
- self.contents.draw_text(x + 120 , y, 48, 32, maxsp.to_s ,2)
- # self.contents.draw_text(x + 155, y, 36, 32, " +",2)
- else
- self.contents.font.color = Color.new(0, 255, 0)
- self.contents.draw_text(x + 120 , y, 48, 32, maxsp.to_s ,2)
- # self.contents.draw_text(x + 155, y, 36, 32, " -",2)
- end
- # self.contents.draw_text(x + 200, y, 36, 32, $temp_sp.to_s, 2)
- self.contents.font.color = Color.new(79,39,0,255)
- # self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
- end
- end
- #--------------------------------------------------------------------------
- # ● 描绘能力值
- # actor : 角色
- # x : 描画目标 X 坐标
- # y : 描画目标 Y 坐标
- # type : 能力值种类 (0~4)
- #--------------------------------------------------------------------------
- def draw_actor_lvup(actor, x, y, type)
- # 定义数字颜色
- lvup = Color.new(79,39,0,255)
- upcolor = Color.new(0, 255, 0)
- downcolor = Color.new(79,39,0,255)
- self.contents.font.color = normal_color
- case type
- when 0
- parameter_name = $data_system.words.str
- parameter_value = actor.str
- parameter_value_temp = parameter_value + $temp_str.to_i
- if $temp_str != 0
- # lvup = upcolor
- # self.contents.draw_text(x + 256, y, 16, 32, "(")
- if $temp_str >= 0
- lvup = upcolor
- self.contents.font.color = lvup
- parameter_name = $data_system.words.str
- parameter_value = actor.str
- # self.contents.draw_text(x + 272, y, 80, 32, "+",0)
- else
- lvup = downcolor
- self.contents.font.color = lvup#Color.new(255,255,0,255)
- parameter_name = $data_system.words.str
- parameter_value = actor.str
- # self.contents.draw_text(x + 272, y, 80, 32, "-",0)
- end
- # self.contents.draw_text(x + 272, y, 80, 32, $temp_str.abs.to_s,1)
- self.contents.font.color = Color.new(255, 0, 0)
- # self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
- end
- when 1
- parameter_name = $data_system.words.dex
- parameter_value = actor.dex
- parameter_value_temp = parameter_value + $temp_dex.to_i
- if $temp_dex != 0
- # lvup = upcolor
- # self.contents.draw_text(x + 256, y, 16, 32, "(")
- if $temp_dex >= 0
- lvup = upcolor
- self.contents.font.color = lvup
- parameter_name = $data_system.words.dex
- parameter_value = actor.dex
- # self.contents.draw_text(x + 272, y, 80, 32, "+",0)
- else
- lvup = downcolor
- self.contents.font.color = lvup#Color.new(255,255,0,255)
- parameter_name = $data_system.words.dex
- parameter_value = actor.dex
- # self.contents.draw_text(x + 272, y, 80, 32, "-",0)
- end
- # self.contents.draw_text(x + 272, y, 80, 32, $temp_dex.abs.to_s,1)
- self.contents.font.color = Color.new(255, 0, 0)
- # self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
- end
- when 2
- parameter_name = $data_system.words.agi
- parameter_value = actor.agi
- parameter_value_temp = parameter_value + $temp_agi.to_i
- if $temp_agi != 0
- # lvup = upcolor
- # self.contents.draw_text(x + 256, y, 16, 32, "(")
- if $temp_agi >= 0
- lvup = upcolor
- self.contents.font.color = lvup
- parameter_name = $data_system.words.agi
- parameter_value = actor.agi
- # self.contents.draw_text(x + 272, y, 80, 32, "+",0)
- else
- lvup = downcolor
- self.contents.font.color = lvup#Color.new(255,255,0,255)
- parameter_name = $data_system.words.agi
- parameter_value = actor.agi
- # self.contents.draw_text(x + 272, y, 80, 32, "-",0)
- end
- # self.contents.draw_text(x + 272, y, 80, 32, $temp_agi.abs.to_s,1)
- self.contents.font.color = Color.new(255, 0, 0)
- # self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
- end
- when 3
- parameter_name = $data_system.words.int
- parameter_value = actor.int
- parameter_value_temp = parameter_value + $temp_int.to_i
- if $temp_int != 0
- # lvup = upcolor
- # self.contents.draw_text(x + 256, y, 16, 32, "(")
- if $temp_int >= 0
- lvup = upcolor
- self.contents.font.color = lvup
- parameter_name = $data_system.words.int
- parameter_value = actor.int
- # self.contents.draw_text(x + 272, y, 80, 32, "+",0)
- else
- lvup = downcolor
- self.contents.font.color = lvup#Color.new(255,255,0,255)
- parameter_name = $data_system.words.int
- parameter_value = actor.int
- # self.contents.draw_text(x + 272, y, 80, 32, "-",0)
- end
- # self.contents.draw_text(x + 272, y, 80, 32, $temp_int.abs.to_s,1)
- self.contents.font.color = Color.new(255, 0, 0)
- # self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
- end
- when 4
- parameter_name = ""
- parameter_value = $point
- if $point != 0
- lvup = upcolor
- end
- end
- self.contents.font.color = Color.new(79,39,0,255)
- self.contents.draw_text(x, y, 120, 32, parameter_name)
- self.contents.font.color = Color.new(79,39,0,255)
- self.contents.draw_text(x + 450, y, 36, 32, parameter_value.to_s)
- if type != 4
- self.contents.draw_text(x + 480, y, 36, 32, " →")
- end
- self.contents.font.color = lvup
- self.contents.draw_text(x + 510, y, 60, 32, parameter_value_temp.to_s)
- self.contents.font.color = Color.new(79,39,0,255)
- end
- end
复制代码 |
|