Log Horizon Experience Pot System Script
#1
Log Horizon – Experience Pot System Script
Author: SoulPour777
Web URL: infinitytears.wordpress.com


Terms of Use:

- Preserve the Script Banner.
- Credit SoulPour777 for the script.
- You are allowed to share this script in a community, as long as SoulPour777
remains the author of the script.
- Don’t claim this script as your own.
- You are free to modify the script, but credits is necessary.

Description:

This script enables the party members lower than Level 30 to gain experience pots, an item that gives them boost on experience and fighting abilities. This is a script based on a system mentioned from the anime Log Horizon.

Instructions:
- Place the script below Materials above Main.

Usage:

On your Items in the database, place this note tag on the item:

<ExpPot: n>

n means the value of the experience you will give to your item user.

Example:

<ExpPot: 1000>

This means that when your item user uses that item, he or she will gain 1000 experience.

According to the Log Horizon anime, it says that not only would the player gain experience but also battle enhancements, so I added some HP, MP and TP regen as well for the item.


How to Set Up the Item Correctly:

- Make sure to remove the On Use Effect on the item. This is because the item won’t be used whenever you place anything on it.


Script:

Code:
=begin
#==============================================================================
# Log Horizon - Experience Pot System Script
# Author: SoulPour777
** Web URL: infinitytears.wordpress.com

#------------------------------------------------------------------------------
# Description: This script enables the party members lower than Level 30 to
# gain experience pots, an item that gives them boost on experience and
# fighting abilities. This is a script based on a system mentioned from the
# anime Log Horizon.

Instructions:
- Place the script below Materials above Main.

Usage:

On your Items in the database, place this note tag on the item:

<ExpPot: n>

n means the value of the experience you will give to your item user.

Example:

<ExpPot: 1000>

This means that when your item user uses that item, he or she will gain 1000
experience.

According to the Log Horizon anime, it says that not only would the player
gain experience but also battle enhancements, so I added some HP, MP and TP
regen as well for the item.

How to Set Up the Item Correctly:

- Make sure to remove the On Use Effect on the item. This is because the item
won't be used whenever you place anything on it.

Terms of Use:
- Preserve the Script Banner.
- Credit SoulPour777 for the script.
- You are allowed to share this script in a community, as long as SoulPour777
remains the author of the script.
- Don't claim this script as your own.
- You are free to modify the script, but credits is necessary.
#==============================================================================
=end

module LHExperiencePot
  # Experience Pot Variables
  # -------------------------------------
  EXP_POT_SE = "Item3"
  EXP_POT_SE_PITCH = 100
  EXP_POT_SE_VOL = 100
  EXP_POT_ITEM_ID = 1
  EXP_POT_ITEM_AMOUNT = 1
  # -------------------------------------

  def experience_pot_activate
    experience_pot
  end

  # -------------------------------------
  # This performs the action for the experience pot
  # -------------------------------------
  def experience_pot_action
    RPG::SE.new(EXP_POT_SE, EXP_POT_SE_VOL, EXP_POT_SE_PITCH).play
    $game_party.members.each do |actor|
      if actor.level <= 30
        $game_party.gain_item($data_items[EXP_POT_ITEM_ID], EXP_POT_ITEM_AMOUNT) # ID of the Exp. Item
      end
    end
  end

end

class Game_Actor < Game_Battler

  # we have to include the LHExperiencePot module to have our other methods
  # working in place.
  include LHExperiencePot
  #------------------------------------------------------------------------#
  # New Level Up Method
  # **this contains the experience pot. Everytime the level of an actor
  # is below level 30, an experience pot item comes.
  # -----------------------------------------------------------------------#

  alias experience_pot_and_level_up level_up
  def level_up
    experience_pot
    @level += 1
    self.class.learnings.each do |learning|
      learn_skill(learning.skill_id) if learning.level == @level
    end
  end

  def experience_pot
    experience_pot_action
  end

  alias exp_pot_game_actor_item_apply        item_apply
  alias exp_pot_game_actor_item_test        item_test

  #--------------------------------------------------------------------------
  # * Aliased Method: Apply Effect of Skill/Item
  #--------------------------------------------------------------------------
  def item_apply(*args)
    item = args[1]                                            # Get Item from arguments
    if item.is_a?(RPG::Item)                                  # Since this method is used for both Item & Skills, check to make sure the Item is actually an Item
      if $data_items[item.id].note =~ /<ExpPot:\s?(\d+)>/i   # Only the Data_Item contains the notetag, not the item itself. So  use the item id to get the database item and then check the notetag against the Regex. If matched, continue.
        new_exp = self.exp + $1.to_i                          # Get New Experience Points   
        self.change_exp(new_exp, false)                       # Gain Exp, simple as that.
        self.add_state(14) #HP Regen
        self.add_state(15) #MP Regen
        self.add_state(16) #TP Regen
      end
    end
    exp_pot_game_actor_item_apply(*args)                   # Call Original Method
  end
  #--------------------------------------------------------------------------
  # * Aliased Method: Test Skill/Item Application
  #--------------------------------------------------------------------------
  def item_test(*args)
    return true if $data_items[args[1].id].note =~ /<ExpPot:\s?(\d+)>/i  # Allow Item to be used no matter what if it contains this notetag
    return exp_pot_game_actor_item_test(*args)                        # Otherwise Call Original Method
  end

end
[Image: n6fvBXt.png]
Huhubugin, Bubuuin, Daranasin, Ating tuklasin, Diwa't isip bubuhayin
Mula sa wala, Mundo ay nilikha, Nililok na mukha, Sa siklab ay nagsimula,
Tinanglaw ang palad, Likhang binigyang malay, Sa init, Hugis ang binagay!
Apoy! Mula sa wala, Mundo ay nilikha
Tinanglaw ang palad, Sa apoy hugis ang binagay
[Image: UfhwrmV.png]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
   + [ Caterpillar System ] + woratana 2 9,388 11-11-2025, 10:12 PM
Last Post: DerVVulfman
   Longer Script Calls LiTTleDRAgo 0 2,416 05-14-2017, 06:40 PM
Last Post: LiTTleDRAgo
   ELSA (Event Layering Script Advance) JayRay 0 2,641 02-25-2015, 08:34 PM
Last Post: JayRay
   VX Weather Script ccoa 14 44,125 10-28-2014, 07:28 AM
Last Post: DerVVulfman
   Theolized Sideview Battle System TheoAllen 5 22,858 09-15-2014, 04:30 AM
Last Post: TheoAllen
   Soulpour – Reputation System Orpheus Mintyy 0 4,322 08-10-2014, 07:14 AM
Last Post: Mintyy
   Soul Engine Ace – Actor Banned Names Script Mintyy 0 4,082 02-27-2014, 12:01 PM
Last Post: Mintyy
   Hunger/Thirst/Sleep System Bravo2Kilo 0 9,238 11-19-2012, 05:56 AM
Last Post: Bravo2Kilo
   Legacy's 1-Man Custom Menu System Legacy 2 12,711 11-13-2012, 04:53 AM
Last Post: Legacy
   Checkpoint System Bravo2Kilo 0 8,827 11-06-2012, 06:07 PM
Last Post: Bravo2Kilo



Users browsing this thread: 1 Guest(s)