The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Tutorials and Eventing => Topic started by: Nexridia on March 26, 2007, 11:35:15 AM

Title: Forget skills if level down
Post by: Nexridia on March 26, 2007, 11:35:15 AM
is there anybody who knows how to do this? i want my heroes to forget skill if they level down just like they learn them when they level up. i use rpgxp
Title: Re: Forget skills if level down
Post by: Blizzard on March 26, 2007, 11:50:08 AM
This is simple. Open the scripts editor and open Game_Actor. Now find the method def exp=(exp) and replace it with this one:

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


This should work.
Title: Re: Forget skills if level down
Post by: Nexridia on March 26, 2007, 04:12:55 PM
ty, it works fine so far