设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1377|回复: 3
打印 上一主题 下一主题

[已经过期] 为什么修改人物等级之后会出现问题

[复制链接]

Lv1.梦旅人

梦石
0
星屑
850
在线时间
9 小时
注册时间
2013-11-3
帖子
3
跳转到指定楼层
1
发表于 2013-11-9 20:49:54 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
本帖最后由 xiepeng 于 2013-11-10 06:49 编辑


如图,为什么会出现这种情况
我就是把人物上限的那张表放到了游戏物件里面,标题是无。
  1. #==============================================================================
  2. # 本脚本来自[url=www.66RPG.com]www.66RPG.com[/url],使用和转载请保留此信息
  3. #==============================================================================
  4. #以下可根据需要修改
  5.   BASE_FINAL_LEVEL = 9999   #等级上限
  6.   MAXHP_LIMIT = 99999999    #HP上限
  7.   MAXSP_LIMIT = 99999999    #SP上限
  8.   STR_LIMIT   = 999999      #力量上限
  9.   DEX_LIMIT   = 999999      #灵巧上限
  10.   AGI_LIMIT   = 999999      #敏捷上限
  11.   INT_LIMIT   = 999999      #智力上限
  12. #以上可根据需要修改
  13. class Game_Actor < Game_Battler
  14.   def new_final_level
  15.     lv = BASE_FINAL_LEVEL
  16.     #以下上限LV個別指定用
  17.     #case self.id
  18.     #when 1
  19.     #  lv = 255
  20.     #when 2
  21.     #  lv = 999
  22.     #when 8
  23.     #  lv = 15600
  24.     #end
  25.     return lv
  26.   end
  27.   #--------------------------------------------------------------------------
  28.   # ● EXP 計算
  29.   #--------------------------------------------------------------------------
  30.   def make_exp_list
  31.     actor = $data_actors[@actor_id]
  32.     @exp_list = Array.new(new_final_level + 2)
  33.     @exp_list[1] = 0
  34.     pow_i = 2.4 + actor.exp_inflation / 100.0
  35.     for i in 2..new_final_level + 1
  36.       if i > new_final_level
  37.         @exp_list[i] = 0
  38.       else
  39.         n = actor.exp_basis * ((i + 3) ** pow_i) / (5 ** pow_i)
  40.         @exp_list[i] = @exp_list[i-1] + Integer(n)
  41.       end
  42.     end
  43.   end
  44.   #--------------------------------------------------------------------------
  45.   # ● MaxHP の取得
  46.   #--------------------------------------------------------------------------
  47.   def maxhp
  48.     n = [[base_maxhp + @maxhp_plus, 1].max, MAXHP_LIMIT].min
  49.     for i in @states
  50.       n *= $data_states[i].maxhp_rate / 100.0
  51.     end
  52.     n = [[Integer(n), 1].max, MAXHP_LIMIT].min
  53.     return n
  54.   end
  55.   #--------------------------------------------------------------------------
  56.   # ● 基本 MaxHP の取得
  57.   #--------------------------------------------------------------------------
  58.   def base_maxhp
  59.     n = $data_actors[@actor_id].parameters[0, 1]
  60.     n += $data_actors[@actor_id].parameters[0, 2] * @level
  61.     return n
  62.   end
  63.   #--------------------------------------------------------------------------
  64.   # ● 基本 MaxSP の取得
  65.   #--------------------------------------------------------------------------
  66.   def base_maxsp
  67.     n = $data_actors[@actor_id].parameters[1, 1]
  68.     n += $data_actors[@actor_id].parameters[1, 2] * @level
  69.     return n
  70.   end
  71.   #--------------------------------------------------------------------------
  72.   # ● 基本腕力の取得
  73.   #--------------------------------------------------------------------------
  74.   def base_str
  75.     n = $data_actors[@actor_id].parameters[2, 1]
  76.     n += $data_actors[@actor_id].parameters[2, 2] * @level
  77.     weapon = $data_weapons[@weapon_id]
  78.     armor1 = $data_armors[@armor1_id]
  79.     armor2 = $data_armors[@armor2_id]
  80.     armor3 = $data_armors[@armor3_id]
  81.     armor4 = $data_armors[@armor4_id]
  82.     n += weapon != nil ? weapon.str_plus : 0
  83.     n += armor1 != nil ? armor1.str_plus : 0
  84.     n += armor2 != nil ? armor2.str_plus : 0
  85.     n += armor3 != nil ? armor3.str_plus : 0
  86.     n += armor4 != nil ? armor4.str_plus : 0
  87.     return [[n, 1].max, STR_LIMIT].min
  88.   end
  89.   #--------------------------------------------------------------------------
  90.   # ● 基本器用さの取得
  91.   #--------------------------------------------------------------------------
  92.   def base_dex
  93.     n = $data_actors[@actor_id].parameters[3, 1]
  94.     n += $data_actors[@actor_id].parameters[3, 2] * @level
  95.     weapon = $data_weapons[@weapon_id]
  96.     armor1 = $data_armors[@armor1_id]
  97.     armor2 = $data_armors[@armor2_id]
  98.     armor3 = $data_armors[@armor3_id]
  99.     armor4 = $data_armors[@armor4_id]
  100.     n += weapon != nil ? weapon.dex_plus : 0
  101.     n += armor1 != nil ? armor1.dex_plus : 0
  102.     n += armor2 != nil ? armor2.dex_plus : 0
  103.     n += armor3 != nil ? armor3.dex_plus : 0
  104.     n += armor4 != nil ? armor4.dex_plus : 0
  105.     return [[n, 1].max, DEX_LIMIT].min
  106.   end
  107.   #--------------------------------------------------------------------------
  108.   # ● 基本素早さの取得
  109.   #--------------------------------------------------------------------------
  110.   def base_agi
  111.     n = $data_actors[@actor_id].parameters[4, 1]
  112.     n += $data_actors[@actor_id].parameters[4, 2] * @level
  113.     weapon = $data_weapons[@weapon_id]
  114.     armor1 = $data_armors[@armor1_id]
  115.     armor2 = $data_armors[@armor2_id]
  116.     armor3 = $data_armors[@armor3_id]
  117.     armor4 = $data_armors[@armor4_id]
  118.     n += weapon != nil ? weapon.agi_plus : 0
  119.     n += armor1 != nil ? armor1.agi_plus : 0
  120.     n += armor2 != nil ? armor2.agi_plus : 0
  121.     n += armor3 != nil ? armor3.agi_plus : 0
  122.     n += armor4 != nil ? armor4.agi_plus : 0
  123.     return [[n, 1].max, AGI_LIMIT].min
  124.   end
  125.   #--------------------------------------------------------------------------
  126.   # ● 基本魔力の取得
  127.   #--------------------------------------------------------------------------
  128.   def base_int
  129.     n = $data_actors[@actor_id].parameters[5, 1]
  130.     n += $data_actors[@actor_id].parameters[5, 2] * @level
  131.     weapon = $data_weapons[@weapon_id]
  132.     armor1 = $data_armors[@armor1_id]
  133.     armor2 = $data_armors[@armor2_id]
  134.     armor3 = $data_armors[@armor3_id]
  135.     armor4 = $data_armors[@armor4_id]
  136.     n += weapon != nil ? weapon.int_plus : 0
  137.     n += armor1 != nil ? armor1.int_plus : 0
  138.     n += armor2 != nil ? armor2.int_plus : 0
  139.     n += armor3 != nil ? armor3.int_plus : 0
  140.     n += armor4 != nil ? armor4.int_plus : 0
  141.     return [[n, 1].max, INT_LIMIT].min
  142.   end
  143.   #--------------------------------------------------------------------------
  144.   # ● EXP の変更
  145.   #     exp : 新しい EXP
  146.   #--------------------------------------------------------------------------
  147.   def exp=(exp)
  148.     # ★EXPの上限チェックを解除
  149.     [url=home.php?mod=space&uid=13302]@exp[/url] = [exp, 0].max
  150.     # レベルアップ
  151.     while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
  152.       [url=home.php?mod=space&uid=22147]@level[/url] += 1
  153.       # スキル習得
  154.       for j in $data_classes[@class_id].learnings
  155.         if j.level == @level
  156.           learn_skill(j.skill_id)
  157.         end
  158.       end
  159.     end
  160.     # レベルダウン
  161.     while @exp < @exp_list[@level]
  162.       @level -= 1
  163.     end
  164.     # 現在の HP と SP が最大値を超えていたら修正
  165.     @hp = [@hp, self.maxhp].min
  166.     @sp = [@sp, self.maxsp].min
  167.   end
  168.   #--------------------------------------------------------------------------
  169.   # ● レベルの変更
  170.   #     level : 新しいレベル
  171.   #--------------------------------------------------------------------------
  172.   def level=(level)
  173.     # 上下限チェック
  174.     # ★LV上限をnew_final_levelでチェックするように変更
  175.     level = [[level, new_final_level].min, 1].max
  176.     # EXP を変更
  177.     self.exp = @exp_list[level]
  178.   end
  179. end
  180.   
  181.   
  182. class Game_Battler
  183.   #--------------------------------------------------------------------------
  184.   # ● MaxSP の取得
  185.   #--------------------------------------------------------------------------
  186.   def maxsp
  187.     n = [[base_maxsp + @maxsp_plus, 0].max, MAXSP_LIMIT].min
  188.     for i in @states
  189.       n *= $data_states[i].maxsp_rate / 100.0
  190.     end
  191.     n = [[Integer(n), 0].max, MAXSP_LIMIT].min
  192.     return n
  193.   end
  194.   #--------------------------------------------------------------------------
  195.   # ● 腕力の取得
  196.   #--------------------------------------------------------------------------
  197.   def str
  198.     n = [[base_str + @str_plus, 1].max, STR_LIMIT].min
  199.     for i in @states
  200.       n *= $data_states[i].str_rate / 100.0
  201.     end
  202.     n = [[Integer(n), 1].max, STR_LIMIT].min
  203.     return n
  204.   end
  205.   #--------------------------------------------------------------------------
  206.   # ● 器用さの取得
  207.   #--------------------------------------------------------------------------
  208.   def dex
  209.     n = [[base_dex + @dex_plus, 1].max, DEX_LIMIT].min
  210.     for i in @states
  211.       n *= $data_states[i].dex_rate / 100.0
  212.     end
  213.     n = [[Integer(n), 1].max, DEX_LIMIT].min
  214.     return n
  215.   end
  216.   #--------------------------------------------------------------------------
  217.   # ● 素早さの取得
  218.   #--------------------------------------------------------------------------
  219.   def agi
  220.     n = [[base_agi + @agi_plus, 1].max, AGI_LIMIT].min
  221.     for i in @states
  222.       n *= $data_states[i].agi_rate / 100.0
  223.     end
  224.     n = [[Integer(n), 1].max, AGI_LIMIT].min
  225.     return n
  226.   end
  227.   #--------------------------------------------------------------------------
  228.   # ● 魔力の取得
  229.   #--------------------------------------------------------------------------
  230.   def int
  231.     n = [[base_int + @int_plus, 1].max, INT_LIMIT].min
  232.     for i in @states
  233.       n *= $data_states[i].int_rate / 100.0
  234.     end
  235.     n = [[Integer(n), 1].max, INT_LIMIT].min
  236.     return n
  237.   end
  238.   #--------------------------------------------------------------------------
  239.   # ● MaxHP の設定
  240.   #     maxhp : 新しい MaxHP
  241.   #--------------------------------------------------------------------------
  242.   def maxhp=(maxhp)
  243.     @maxhp_plus += maxhp - self.maxhp
  244.     @maxhp_plus = [[@maxhp_plus, -MAXHP_LIMIT].max, MAXHP_LIMIT].min
  245.     @hp = [@hp, self.maxhp].min
  246.   end
  247.   #--------------------------------------------------------------------------
  248.   # ● MaxSP の設定
  249.   #     maxsp : 新しい MaxSP
  250.   #--------------------------------------------------------------------------
  251.   def maxsp=(maxsp)
  252.     @maxsp_plus += maxsp - self.maxsp
  253.     @maxsp_plus = [[@maxsp_plus, -MAXSP_LIMIT].max, MAXSP_LIMIT].min
  254.     @sp = [@sp, self.maxsp].min
  255.   end
  256.   #--------------------------------------------------------------------------
  257.   # ● 腕力の設定
  258.   #     str : 新しい腕力
  259.   #--------------------------------------------------------------------------
  260.   def str=(str)
  261.     @str_plus += str - self.str
  262.     @str_plus = [[@str_plus, -STR_LIMIT].max, STR_LIMIT].min
  263.   end
  264.   #--------------------------------------------------------------------------
  265.   # ● 器用さの設定
  266.   #     dex : 新しい器用さ
  267.   #--------------------------------------------------------------------------
  268.   def dex=(dex)
  269.     @dex_plus += dex - self.dex
  270.     @dex_plus = [[@dex_plus, -DEX_LIMIT].max, DEX_LIMIT].min
  271.   end
  272.   #--------------------------------------------------------------------------
  273.   # ● 素早さの設定
  274.   #     agi : 新しい素早さ
  275.   #--------------------------------------------------------------------------
  276.   def agi=(agi)
  277.     @agi_plus += agi - self.agi
  278.     @agi_plus = [[@agi_plus, -AGI_LIMIT].max, AGI_LIMIT].min
  279.   end
  280.   #--------------------------------------------------------------------------
  281.   # ● 魔力の設定
  282.   #     int : 新しい魔力
  283.   #--------------------------------------------------------------------------
  284.   def int=(int)
  285.     @int_plus += int - self.int
  286.     @int_plus = [[@int_plus, -INT_LIMIT].max, INT_LIMIT].min
  287.   end
  288. end
  289. #==============================================================================
  290. # 本脚本来自[url=www.66RPG.com]www.66RPG.com[/url],使用和转载请保留此信息
  291. #==============================================================================
复制代码
这是怎么回事,我想把人物上限调到9999级,难道有上限什么的么?

PS:我的怪物经验很高,一下子就能升到100J,这样与这个有什么关联呢?
知道了不留Q...

评分

参与人数 2星屑 0 收起 理由
怪蜀黍 + 10 算啦,水区不能留Q,提问区方便交流可以的.
铃仙·优昙华院·因幡 -10 留Q是不行的,而且脚本请使用脚本框.

查看全部评分

Lv1.梦旅人

狂気の月兔

梦石
0
星屑
231
在线时间
1245 小时
注册时间
2009-4-7
帖子
879

贵宾

2
发表于 2013-11-9 21:20:15 | 只看该作者
我只能说你给的脚本里看不出啥问题. 而且错误提示的地方看起来是默认脚本.

也就是说脚本冲突的可能性较大.

评分

参与人数 1星屑 +30 收起 理由
怪蜀黍 + 30 塞糖

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
850
在线时间
9 小时
注册时间
2013-11-3
帖子
3
3
 楼主| 发表于 2013-11-9 21:30:32 | 只看该作者
详细一点好么

点评

你能上传最简工程吗?  发表于 2013-11-9 21:48
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
850
在线时间
9 小时
注册时间
2013-11-3
帖子
3
4
 楼主| 发表于 2013-11-9 22:07:19 | 只看该作者
这是什么,能加Q私聊吗。2464843470
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-29 13:22

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表