The RPG Maker Resource Kit

RMRK RPG Maker Creation => Requests => Script Request => Topic started by: sonicfan1012 on January 05, 2008, 09:54:39 PM

Title: [RESOLVED]Need help editing a script
Post by: sonicfan1012 on January 05, 2008, 09:54:39 PM
i need help on a script that breaks the lvl, hp, sp, and stat limits. For some reason, if I set one of my heroes ( its ID is 1) for initially 750 HP, 600 SP, 67 str, 80 agi, 69 dex, and 47 int ( note that i set it up that str, agi, dex, and int stay at that same number only cause i have another stat growth system), when I test play a new game, my character is at lvl 1 but its hp is 1595, sp 1296, str 134, agi 160, dex 138, and int 94, and whats worse is that my stats that i set not to grow do grow. Here is the script (all credit goes to cybersam)
Code: [Select]
#==============================================================================
#  Unlimit Levels v1                                            by: cybersam
#                                                               date: 14.09.06
#------------------------------------------------------------------------------
#  here is a full working scripts for you to this... (i think there is
#  already one like this somewhere in the in the community...
#  i did one back then when i started in RPG Maker XP
#  some other guys did a few other script like this
#==============================================================================
# Must go ABOVE leveling with points to work
#----------------------------------------------------------------------------
# here you can set the max hp,sp,,str,dex,agi and int
#----------------------------------------------------------------------------
  $FINAL_LVL  = 9999
  $MAX_HP     = 999999999
  $MAX_SP     = 999999999
  $MAX_STR    = 9999
  $MAX_DEX    = 9999
  $MAX_AGI    = 9999
  $MAX_INT    = 9999

class Game_Actor

  #--------------------------------------------------------------------------
  # setting the levels...
  #--------------------------------------------------------------------------
  def final_level
   
    # here you can set the max level for your characters based on their ID's...
    # i set it so that 3 characters have different levels and the rest
    # have max lvl of 9999
    #
    # this settings is only to show you how to change the max setting for your
    # characters... same thing is for the parameters -> hp,sp,str,dex.agi,int
   
    case self.id
    when 1
      level = 255
    when 2
      level = 999
    when 8
      level = 15600
    else
      level = $MAX_STR
    end
    return level
  end
 
 
  #--------------------------------------------------------------------------
  # setting max hp...
  #--------------------------------------------------------------------------
  def max_hp

    case self.id
    when 1
      hp = 999
    when 2
      hp = 9999
    when 8
      hp = 6540
    else
      hp = $MAX_HP
    end
    return hp
  end
  #--------------------------------------------------------------------------
  # setting max sp...
  #--------------------------------------------------------------------------
  def max_sp

    case self.id
    when 1
      sp = 999
    when 2
      sp = 9999
    when 8
      sp = 6540
    else
      sp = $MAX_SP
    end
    return sp
  end
  #--------------------------------------------------------------------------
  # setting max str...
  #--------------------------------------------------------------------------
  def max_str
    case self.id
    when 1
      str = 999
    when 2
      str = 2560
    when 8
      str = 1800
    else
      str = $MAX_STR
    end
    return str
  end
  #--------------------------------------------------------------------------
  # setting max dex...
  #--------------------------------------------------------------------------
  def max_dex
    case self.id
    when 1
      dex = 999
    when 2
      dex = 2560
    when 8
      dex = 1800
    else
      dex = $MAX_DEX
    end
    return dex
  end 
  #--------------------------------------------------------------------------
  # setting max agi...
  #--------------------------------------------------------------------------
  def max_agi
    case self.id
    when 1
      agi = 999
    when 2
      agi = 2560
    when 8
      agi = 1800
    else
      agi = $MAX_AGI
    end
    return agi
  end   
  #--------------------------------------------------------------------------
  # setting max int...
  #--------------------------------------------------------------------------
  def max_int
    case self.id
    when 1
      int = 999
    when 2
      int = 2560
    when 8
      int = 1800
    else
      int = $MAX_INT
    end
    return int
  end 
 
  #--------------------------------------------------------------------------
  # Creating the new EXP list
  # dont change anything from here on... (only if you know what you're doing)
  #--------------------------------------------------------------------------
  def make_exp_list
    actor = $data_actors[@actor_id]
    @exp_list = Array.new(final_level + 2)
    @exp_list[1] = 0
    pow_i = 2.4 + actor.exp_inflation / 1000.0
    for i in 2..final_level + 1
      if i > final_level
        @exp_list[i] = 0
      else
        n = actor.exp_basis * ((i + 3) ** pow_i) / (5 ** pow_i)
        @exp_list[i] = @exp_list[i-1] + Integer(n)
      end
    end
  end

  #--------------------------------------------------------------------------
  # setting parameters like hp, sp, str, dex, agi and int
  #--------------------------------------------------------------------------
  def maxhp
    n = [[base_maxhp + @maxhp_plus, 1].max, $MAX_HP].min
    for i in @states
      n *= $data_states[i].maxhp_rate / 100.0
    end
    n = [[Integer(n), 1].max, $MAX_HP].min
    return n
  end
 
  def base_maxhp
    maxhp = $data_actors[@actor_id].parameters[0, 1]
    maxhp += $data_actors[@actor_id].parameters[0, 2] * @level
    return maxhp
  end

  def base_maxsp
    maxsp = $data_actors[@actor_id].parameters[1, 1]
    maxsp += $data_actors[@actor_id].parameters[1, 2] * @level
    return maxsp
  end

  def base_str
    n = $data_actors[@actor_id].parameters[2, 1]
    n += $data_actors[@actor_id].parameters[2, 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
    return [[n, 1].max, $MAX_STR].min
  end

  def base_dex
    n = $data_actors[@actor_id].parameters[3, 1]
    n += $data_actors[@actor_id].parameters[3, 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.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
    return [[n, 1].max, $MAX_DEX].min
  end

  def base_agi
    n = $data_actors[@actor_id].parameters[4, 1]
    n += $data_actors[@actor_id].parameters[4, 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.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
    return [[n, 1].max, $MAX_AGI].min
  end

  def base_int
    n = $data_actors[@actor_id].parameters[5, 1]
    n += $data_actors[@actor_id].parameters[5, 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.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
    return [[n, 1].max, $MAX_INT].min
  end

  def exp=(exp)
    @exp = [exp, 0].max
    while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
      @level += 1
      for j in $data_classes[@class_id].learnings
        if j.level == @level
          learn_skill(j.skill_id)
        end
      end
    end
    while @exp < @exp_list[@level]
      @level -= 1
    end
    @hp = [@hp, self.maxhp].min
    @sp = [@sp, self.maxsp].min
  end

  def level=(level)
    level = [[level, final_level].min, 1].max
    self.exp = @exp_list[level]
  end
end



#==============================================================================
# ** Game_Battler
#==============================================================================

class Game_Battler

  def maxhp
    n = [[base_maxhp + @maxhp_plus, 1].max, $MAX_HP].min
    for i in @states
      n *= $data_states[i].maxhp_rate / 100.0
    end
    n = [[Integer(n), 1].max, $MAX_HP].min
    return n
  end

  def maxsp
    n = [[base_maxsp + @maxsp_plus, 0].max, $MAX_SP].min
    for i in @states
      n *= $data_states[i].maxsp_rate / 100.0
    end
    n = [[Integer(n), 0].max, $MAX_SP].min
    return n
  end

  def str
    n = [[base_str + @str_plus, 1].max, $MAX_STR].min
    for i in @states
      n *= $data_states[i].str_rate / 100.0
    end
    n = [[Integer(n), 1].max, $MAX_STR].min
    return n
  end

  def dex
    n = [[base_dex + @dex_plus, 1].max, $MAX_DEX].min
    for i in @states
      n *= $data_states[i].dex_rate / 100.0
    end
    n = [[Integer(n), 1].max, $MAX_DEX].min
    return n
  end

  def agi
    n = [[base_agi + @agi_plus, 1].max, $MAX_AGI].min
    for i in @states
      n *= $data_states[i].agi_rate / 100.0
    end
    n = [[Integer(n), 1].max, $MAX_AGI].min
    return n
  end

  def int
    n = [[base_int + @int_plus, 1].max, $MAX_INT].min
    for i in @states
      n *= $data_states[i].int_rate / 100.0
    end
    n = [[Integer(n), 1].max, $MAX_INT].min
    return n
  end

  def maxhp=(maxhp)
    @maxhp_plus += maxhp - self.maxhp
    @maxhp_plus = [[@maxhp_plus, -$MAX_HP].max, $MAX_HP].min
    @hp = [@hp, self.maxhp].min
  end

  def maxsp=(maxsp)
    @maxsp_plus += maxsp - self.maxsp
    @maxsp_plus = [[@maxsp_plus, -$MAX_SP].max, $MAX_SP].min
    @sp = [@sp, self.maxsp].min
  end

  def str=(str)
    @str_plus += str - self.str
    @str_plus = [[@str_plus, -$MAX_STR].max, $MAX_STR].min
  end

  def dex=(dex)
    @dex_plus += dex - self.dex
    @dex_plus = [[@dex_plus, -$MAX_DEX].max, $MAX_DEX].min
  end

  def agi=(agi)
    @agi_plus += agi - self.agi
    @agi_plus = [[@agi_plus, -$MAX_AGI].max, $MAX_AGI].min
  end

  def int=(int)
    @int_plus += int - self.int
    @int_plus = [[@int_plus, -$MAX_INT].max, $MAX_INT].min
  end
end
Title: Re: [REQUEST]Need help editing a script
Post by: ChaosSpartan28 on January 05, 2008, 10:22:19 PM
Sonicfan. I suggest you use the Script Request Template for posting this before you get a strike by Falcon.

http://rmrk.net/index.php/topic,22541.0.html

:)
Title: Re: [REQUEST]Need help editing a script
Post by: Falcon on January 05, 2008, 10:38:39 PM
Never made a rule requiring that, but I probably should....
Title: Re: [REQUEST]Need help editing a script
Post by: sonicfan1012 on January 05, 2008, 11:06:33 PM
Not to be a noob but what is the script request template?

EDIT: OOPs didn't see the link. Well, this problem is reserved, I guess. But wait, what am I supposed to do with the template?

EDIT (Again): I see now. I'm goin to keep this as reserved, though.
Title: Re: [REQUEST]Need help editing a script
Post by: sonicfan1012 on January 05, 2008, 11:56:36 PM
Level and Stat Limiter Breaking Script
Date Proposed: 1/5/07



Summary
Basically a script or an edit of an original script that lets you break the level 99 limit and the limits for all the stats, too, but keeps the stats selected in the database (cybersam's lvl 9999 script doesn't work only because it didn't keep the stats and stat growth I used in the database

Features Desired


Mockups
none

Games its been in



Did you search?
yes

Where did you search?

What did you search for?

Note to Moderators: Sorry bout bumping, but it would be just as bad to create a new topic for the template.
Title: Re: [RESERVED]Need help editing a script
Post by: Falcon on January 06, 2008, 12:17:17 AM
Strike 1, how the hell is this reserved, no one said they'd do your script.

Go search on hbgames.org
Title: Re: [REQUEST]Need help editing a script
Post by: sonicfan1012 on January 06, 2008, 06:09:21 PM
Strike 1, how the hell is this reserved, no one said they'd do your script.

Go search on hbgames.org
I couldn't find anything. Is there an actual scripter who can help me?

O yeah falcon, I made A MISTAKE. jeez, you don't have to strike me for it.
Title: Re: [REQUEST]Need help editing a script
Post by: Leon_Westbrooke on January 06, 2008, 06:17:24 PM
I have a strange feeling your other stat system is influencing this one. try to remove the other one, (and save it, of course, so you don't lose it), and see if that fixes your problem.
Title: Re: [REQUEST]Need help editing a script
Post by: sonicfan1012 on January 06, 2008, 06:35:03 PM
nope, its not any of the custom scripts I implemented that were causing the problem (I removed all of them, then tried the game, same problem). I saw on hbgames.org that someone had the same problem, and another person gave another lvl 999 script, but it was a waste of time only cause the demo link of the script didn't work. This is the link to the thread if you're curious. http://anonym.to/?http://www.hbgames.org/forums/index.php?topic=6599
Title: Re: [REQUEST]Need help editing a script
Post by: Falcon on January 06, 2008, 06:52:12 PM
O yeah falcon, I made A MISTAKE. jeez, you don't have to strike me for it.

If you'd rather not get a strike, then I'll just go straight to the damn punishment instead of giving warnings.

http://www.box.net/shared/hkn9ptqsj4 <- Some of Trickster's scripts, lucky for you I have a good memory.
Title: Re: [REQUEST]Need help editing a script
Post by: sonicfan1012 on January 06, 2008, 08:35:05 PM
the only problem, falcon, is that the game doesn't show any text, so i can't check if the script works. (The script was limit breaks, right?). Note: I just took the scripts file and replaced it with mine. I still have my scripts saved somewhere else, though. Do I need to put in the sdk scripts? Also, Just saying, for somereason, the sdk script needed to be on top of the limit script. Oh, and i'm not being sarcastic
Title: Re: [REQUEST]Need help editing a script
Post by: Falcon on January 07, 2008, 12:52:13 PM
You want Actor and Class Stats, limit break has nothing to do with that.

Although you should give up, it's easier to make all the stats smaller than having them go to numbers like 1 billion and whatnot.
Title: Re: [RESOLVED]Need help editing a script
Post by: sonicfan1012 on January 07, 2008, 09:24:43 PM
hmm, yea i should give up, cause nothin probably works. it's hard to script to get to lvl 999. I'll leave this topic as resolved. Besides, I don't need the script desperately  :lol: