KLevelChange XP
#1
KLevelChange XP

by Kyonides Arkanthes


Introduction

This is a simple scriptlet that will let you call common events whenever the hero levels up or down via gaining or losing experience points, thus changing his or her current level, or by leveling up or down directly. Please read the instructions embedded in the script to learn how to set them up.

There is also the possibility to trigger it randomly by changing the LVLUP_ACTIVATION_RATE or LVLDOWN_ACTIVATION_RATE.
Set their value to 100 if you always need them to get triggered by the system. Winking

Code:
# * KLevelChange XP
#   Scripter : Kyonides Arkanthes
#   2021-09-30
# Free for use in any kind of game!

# The LVLUP_COMMON_EVENT_ID and LVLDOWN_COMMON_EVENT_ID Constants will let you
# call a common event whenever a hero levels up or down during gameplay. Even so
# that will depend on the corresponding value of the ACTIVATION_RATEs.
# Set them to 100 if you want them to be triggered automatically.

class Game_Actor
  LVLUP_COMMON_EVENT_ID = 1
  LVLDOWN_COMMON_EVENT_ID = 2
  LVLUP_ACTIVATION_RATE = 75
  LVLDOWN_ACTIVATION_RATE = 65
  alias :kyon_level_reaction_exp= :exp=
  def exp=(new_exp)
    level = @level
    kyon_level_reaction_exp = new_exp
    if @level > level and rand(100) < LVLUP_ACTIVATION_RATE
      $game_temp.common_event_id = $data_common_events[LVLUP_COMMON_EVENT_ID]
    elsif @level < level and rand(100) < LVLDOWN_ACTIVATION_RATE
      $game_temp.common_event_id = $data_common_events[LVLDOWN_COMMON_EVENT_ID]
    end
    @exp
  end
end

Terms & Conditions

Free for use in any kind of game.
Mention me in your game credits.
[End of list of conditions]
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply }


Messages In This Thread
KLevelChange XP - by kyonides - 10-01-2021, 06:04 AM



Users browsing this thread: 1 Guest(s)