[XP] Gold and Exp Plus

Started by G_G, May 17, 2009, 01:56:46 pm

Previous topic - Next topic

G_G

May 17, 2009, 01:56:46 pm Last Edit: November 29, 2013, 02:13:22 pm by KK20
Gold and Exp Plus
Authors: game_guy
Version: 1.3
Type: Exp and Gold Add On
Key Term: Battle Add-on



Introduction

In some RPG's I'm sure you've seen some items or equipment that increases the
percent of Experience and Gold you recieve. This script gives weapons and
armors Exp and Gold % that increase the exp and gold you gain.



Features


  • Takes percent defined and adds it to exp gained
  • Takes percent defined and adds it to gold gained
  • works for weapons and armors



Screenshots

N/A


Demo
This is the demo for the Default Battle System not Blizz ABS
Demo


Script

This is for teh Default Battle System
Spoiler: ShowHide

#==============================================================================#
# Gold and Experience Percent Add On
#==============================================================================#
=begin
Intro:
In some RPG's I'm sure you've seen some items or equipment that increases the
percent of Experience and Gold you recieve. This script gives weapons and
armors Exp and Gold %.

What it does is take the percent you defined for the weapon or armor
and makes it a percent. Than it takes the expereince or gold and gets the percent
defined and adds it to it.

Instructions. Go to the BEGIN CONFIG and follow those instructions.

IT IS RECOMMENDED TO USE A NUMBER FROM 1-100 unless you want an item that doubles
the exp or gold you gain.


=end

module RPG
  class Weapon
    def gold_plus
      case id
      #========================================================#
      # BEGIN CONFIG
      #========================================================#
      #========================================================#
      # when weapon_id then return gold gain in percent
      #========================================================#
      when 1 then return 5
      end
      return 0
    end
    def exp_plus
      case id
      #========================================================#
      # when weapon_id then return exp gain in percent
      #========================================================#
      when 1 then return 100
      end
      return 0
    end
  end
  class Armor
    def gold_plus
      case id
      #========================================================#
      # when armor_id then return gold gain in percent
      #========================================================#
      when 1 then return 5
      end
      return 0
    end
    def exp_plus
      case id
      #========================================================#
      # when armor_id then return exp gain in percent
      #========================================================#
      when 1 then return 5
      end
      #========================================================#
      # END CONFIG
      #========================================================#
      return 0
    end
  end
end
class Game_Actor
  def gold_plus
    n = 0
    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.gold_plus if weapon != nil
    n += armor1.gold_plus if armor1 != nil
    n += armor2.gold_plus if armor2 != nil
    n += armor3.gold_plus if armor3 != nil
    n += armor4.gold_plus if armor4 != nil
    return n
  end
  def exp_plus
    n = 0
    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.exp_plus if weapon != nil
    n += armor1.exp_plus if armor1 != nil
    n += armor2.exp_plus if armor2 != nil
    n += armor3.exp_plus if armor3 != nil
    n += armor4.exp_plus if armor4 != nil
    return n
  end
end

class Scene_Battle
  def start_phase5
    @phase = 5
    goldpercent = 0
    $game_system.me_play($game_system.battle_end_me)
    $game_system.bgm_play($game_temp.map_bgm)
    goldpercent += $game_party.actors[0].gold_plus if $game_party.actors[0] != nil
    goldpercent += $game_party.actors[1].gold_plus if $game_party.actors[1] != nil
    goldpercent += $game_party.actors[2].gold_plus if $game_party.actors[2] != nil
    goldpercent += $game_party.actors[3].gold_plus if $game_party.actors[3] != nil
    exppercent = 0
    exppercent += $game_party.actors[0].exp_plus if $game_party.actors[0] != nil
    exppercent += $game_party.actors[1].exp_plus if $game_party.actors[1] != nil
    exppercent += $game_party.actors[2].exp_plus if $game_party.actors[2] != nil
    exppercent += $game_party.actors[3].exp_plus if $game_party.actors[3] != nil
    exp = 0
    gold = 0
    treasures = []
    for enemy in $game_troop.enemies
      unless enemy.hidden
        exp += enemy.exp
        gold += enemy.gold
        if rand(100) < enemy.treasure_prob
          if enemy.item_id > 0
            treasures.push($data_items[enemy.item_id])
          end
          if enemy.weapon_id > 0
            treasures.push($data_weapons[enemy.weapon_id])
          end
          if enemy.armor_id > 0
            treasures.push($data_armors[enemy.armor_id])
          end
        end
      end
    end
    val = gold
    val *= goldpercent
    val = val / 100
    gold += val
   
    val = exp
    val *= exppercent
    val = val / 100
    exp += val
   
    treasures = treasures[0..5]
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      if actor.cant_get_exp? == false
        last_level = actor.level
        actor.exp += exp
        if actor.level > last_level
          @status_window.level_up(i)
        end
      end
    end
    $game_party.gain_gold(gold)
    for item in treasures
      case item
      when RPG::Item
        $game_party.gain_item(item.id, 1)
      when RPG::Weapon
        $game_party.gain_weapon(item.id, 1)
      when RPG::Armor
        $game_party.gain_armor(item.id, 1)
      end
    end
    @result_window = Window_BattleResult.new(exp, gold, treasures)
    @phase5_wait_count = 100
  end
end


This is for Blizz ABS
Spoiler: ShowHide
#==============================================================================#
# Gold and Experience Percent Add On for BLizz ABS
#==============================================================================#
=begin
Intro:
In some RPG's I'm sure you've seen some items or equipment that increases the
percent of Experience and Gold you recieve. This script gives weapons and
armors Exp and Gold %.

What it does is take the percent you defined for the weapon or armor
and makes it a percent. Than it takes the expereince or gold and gets the percent
defined and adds it to it.

Instructions. Go to the BEGIN CONFIG and follow those instructions.

IT IS RECOMMENDED TO USE A NUMBER FROM 1-100 unless you want an item that doubles
the exp or gold you gain.


=end

module RPG
 class Weapon
   def gold_plus
     case id
     #========================================================#
     # BEGIN CONFIG
     #========================================================#
     #========================================================#
     # when weapon_id then return gold gain in percent
     #========================================================#
     when 1 then return 5
     end
     return 0
   end
   def exp_plus
     case id
     #========================================================#
     # when weapon_id then return exp gain in percent
     #========================================================#
     when 1 then return 100
     end
     return 0
   end
 end
 class Armor
   def gold_plus
     case id
     #========================================================#
     # when armor_id then return gold gain in percent
     #========================================================#
     when 1 then return 5
     end
     return 0
   end
   def exp_plus
     case id
     #========================================================#
     # when armor_id then return exp gain in percent
     #========================================================#
     when 1 then return 5
     end
     #========================================================#
     # END CONFIG
     #========================================================#
     return 0
   end
 end
end
class Game_Actor
 def gold_plus
   n = 0
   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.gold_plus if weapon != nil
   n += armor1.gold_plus if armor1 != nil
   n += armor2.gold_plus if armor2 != nil
   n += armor3.gold_plus if armor3 != nil
   n += armor4.gold_plus if armor4 != nil
   return n
 end
 def exp_plus
   n = 0
   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.exp_plus if weapon != nil
   n += armor1.exp_plus if armor1 != nil
   n += armor2.exp_plus if armor2 != nil
   n += armor3.exp_plus if armor3 != nil
   n += armor4.exp_plus if armor4 != nil
   return n
 end
end
if BlizzABS::VERSION < 2.51
 raise "Blizz ABS Version isnt high enough. Now Closing."
end

class BlizzABS::Processor
 def gold_result(enemy)
     if enemy.gold != 0
       gold = enemy.gold
       if $tons_version != nil
         if $tons_version >= 6.4 && TONS_OF_ADDONS::DIFFICULTY
           gold = gold * $game_system.gold_rate / 100
         end
         if $tons_version >= 6.5 && $game_system.PASSIVE_SKILLS
           $game_party.actors.each {|actor| gold *= actor.gold_rate}
           gold = gold.to_i
         end
       end
       goldpercent = 0
       goldpercent += $game_party.actors[0].gold_plus if $game_party.actors[0] != nil
       goldpercent += $game_party.actors[0].gold_plus if $game_party.actors[1] != nil
       goldpercent += $game_party.actors[0].gold_plus if $game_party.actors[2] != nil
       goldpercent += $game_party.actors[0].gold_plus if $game_party.actors[3] != nil
       val = gold
       val *= goldpercent
        val = val / 100
       gold += val
       return gold
     end
     return 0
   end
 def exp_result(enemy)
     if enemy.exp != 0
       exp = enemy.exp
       if $tons_version != nil
         if $tons_version >= 6.4 && TONS_OF_ADDONS::DIFFICULTY
           exp = exp * $game_system.exp_rate / 100
         end
         if $tons_version >= 6.5 && $game_system.PASSIVE_SKILLS
           $game_party.actors.each {|actor| exp *= actor.exp_rate}
           exp = exp.to_i
         end
       end
       exppercent = 0
       exppercent += $game_party.actors[0].exp_plus if $game_party.actors[0] != nil
       exppercent += $game_party.actors[0].exp_plus if $game_party.actors[1] != nil
       exppercent += $game_party.actors[0].exp_plus if $game_party.actors[2] != nil
       exppercent += $game_party.actors[0].exp_plus if $game_party.actors[3] != nil
       val = exp
        val *= exppercent
       val = val / 100
       exp += val
       ($BlizzABS.actors + $BlizzABS.pets).each {|b|
           b.battler.exp += exp if b.valid? && !b.battler.cant_get_exp?}
         end
     return exp
   end
 
end



Instructions

In the script.


Compatibility

Not tested with SDK. Should work with most things.

Compatible with Blizz ABS now I released teh plugin.

Not tested with Side View Animated Battle System


Credits and Thanks


  • game_guy ~ making it



Author's Notes

Enjoy!

G_G

Does anyone like this? Or is to useless. Oh and The plugin for babs is almost done.

*bumps*

Also database worthy?

Sally

i think its database worthy, but what does the gold % do?

G_G

The same as exp %

Whatever the weapons or armor gold % is defined to changes the amount of money earned from battles.

Example:
Sword has is defined with 5% extra gold

it'll take 5% of the gold already earned from the battle than adds it to it

It does exactly the same for exp.


So if the Sword has 5% extra gold and you earn 100 gold you'll get 105 gold because 5% of 100 is 5

Blizzard

Quote from: Sally on May 21, 2009, 06:36:08 pm
i think its database worthy, but what does the gold % do?


*slaps his mods* Why is this not in database yet?! >8U *moves*
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

G_G

Does anyone like this script at all? Or do you just not get what it does ;___;

Shadonking

this script is really cool, when the blizz abs plugin is out i will def use it. levelup (Powerup) G_G





Creator Of Music And Games
Spoiler: ShowHide
]

keywords: ShowHide
rmxp rmvx blizz-abs rpg maker xp vx abs cbs cms script tons of addons charsets autotiles HUD


come here if you have a ps3
http://forum.chaos-project.com/index.php?topic=1952.0

Calintz

Hey silly ...
This is DEF. NOT useless ...

very nice script actually. Good job as always Game_Guy.

G_G

May 23, 2009, 02:45:48 pm #8 Last Edit: May 23, 2009, 02:48:18 pm by game_guy
I finally got it done and made sure all bugs are fixed the script for Babs.

You will only need this script and not the other one.

Spoiler: ShowHide
#==============================================================================#
# Gold and Experience Percent Add On for BLizz ABS
#==============================================================================#
=begin
Intro:
In some RPG's I'm sure you've seen some items or equipment that increases the
percent of Experience and Gold you recieve. This script gives weapons and
armors Exp and Gold %.

What it does is take the percent you defined for the weapon or armor
and makes it a percent. Than it takes the expereince or gold and gets the percent
defined and adds it to it.

Instructions. Go to the BEGIN CONFIG and follow those instructions.

IT IS RECOMMENDED TO USE A NUMBER FROM 1-100 unless you want an item that doubles
the exp or gold you gain.


=end

module RPG
 class Weapon
   def gold_plus
     case id
     #========================================================#
     # BEGIN CONFIG
     #========================================================#
     #========================================================#
     # when weapon_id then return gold gain in percent
     #========================================================#
     when 1 then return 5
     end
     return 0
   end
   def exp_plus
     case id
     #========================================================#
     # when weapon_id then return exp gain in percent
     #========================================================#
     when 1 then return 100
     end
     return 0
   end
 end
 class Armor
   def gold_plus
     case id
     #========================================================#
     # when armor_id then return gold gain in percent
     #========================================================#
     when 1 then return 5
     end
     return 0
   end
   def exp_plus
     case id
     #========================================================#
     # when armor_id then return exp gain in percent
     #========================================================#
     when 1 then return 5
     end
     #========================================================#
     # END CONFIG
     #========================================================#
     return 0
   end
 end
end
class Game_Actor
 def gold_plus
   n = 0
   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.gold_plus if weapon != nil
   n += armor1.gold_plus if armor1 != nil
   n += armor2.gold_plus if armor2 != nil
   n += armor3.gold_plus if armor3 != nil
   n += armor4.gold_plus if armor4 != nil
   return n
 end
 def exp_plus
   n = 0
   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.exp_plus if weapon != nil
   n += armor1.exp_plus if armor1 != nil
   n += armor2.exp_plus if armor2 != nil
   n += armor3.exp_plus if armor3 != nil
   n += armor4.exp_plus if armor4 != nil
   return n
 end
end
if BlizzABS::VERSION < 2.51
 raise "Blizz ABS Version isnt high enough. Now Closing."
end

class BlizzABS::Processor
 def gold_result(enemy)
     if enemy.gold != 0
       gold = enemy.gold
       if $tons_version != nil
         if $tons_version >= 6.4 && TONS_OF_ADDONS::DIFFICULTY
           gold = gold * $game_system.gold_rate / 100
         end
         if $tons_version >= 6.5 && $game_system.PASSIVE_SKILLS
           $game_party.actors.each {|actor| gold *= actor.gold_rate}
           gold = gold.to_i
         end
       end
       goldpercent = 0
       goldpercent += $game_party.actors[0].gold_plus if $game_party.actors[0] != nil
       goldpercent += $game_party.actors[0].gold_plus if $game_party.actors[1] != nil
       goldpercent += $game_party.actors[0].gold_plus if $game_party.actors[2] != nil
       goldpercent += $game_party.actors[0].gold_plus if $game_party.actors[3] != nil
       val = gold
       val = val / 100
       val = val * goldpercent
       if val < 1
         val = 1
       end
       gold = gold + val
       return gold
     end
     return 0
   end
 def exp_result(enemy)
     if enemy.exp != 0
       exp = enemy.exp
       if $tons_version != nil
         if $tons_version >= 6.4 && TONS_OF_ADDONS::DIFFICULTY
           exp = exp * $game_system.exp_rate / 100
         end
         if $tons_version >= 6.5 && $game_system.PASSIVE_SKILLS
           $game_party.actors.each {|actor| exp *= actor.exp_rate}
           exp = exp.to_i
         end
       end
       exppercent = 0
       exppercent += $game_party.actors[0].exp_plus if $game_party.actors[0] != nil
       exppercent += $game_party.actors[0].exp_plus if $game_party.actors[1] != nil
       exppercent += $game_party.actors[0].exp_plus if $game_party.actors[2] != nil
       exppercent += $game_party.actors[0].exp_plus if $game_party.actors[3] != nil
       val = exp
       val = val / 100
       val = val * exppercent  
       if val < 1
         val = 1
       end
       exp = exp + val
       ($BlizzABS.actors + $BlizzABS.pets).each {|b|
           b.battler.exp += exp if b.valid? && !b.battler.cant_get_exp?}
         end
     return exp
   end
 
end


Quote from: Calintz16438 on May 23, 2009, 02:29:42 pm
Hey silly ...
This is DEF. NOT useless ...

very nice script actually. Good job as always Game_Guy.


What do you mean? Lol.

Blizzard

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Calintz

Lmao, thanks for clearing that up Blizzard.

**Note
In your 1st post you asked the forum members if this was a useless script G_G. I am simply throwing out my personal input.

G_G

Yea I understand now. I really didnt know what DEF meant other than Defense....
thats where my confusion was :^_^':

Xuroth

Great idea for a script. it reminds me of XP scrolls in Guild Wars

feandrad


Holyrapid

This is such a great script. I´ll use this in my game. Leves up.

TheGreyFox

Can someone edit this to instead use a player's money to say....power up a certain weapon's attack? Or in my case i need it for a whole set o.o (weapon, armor, helm, gloves and boots)

G_G

That would go in a script request topic. And instead of editing this script someone would need to make a new one because what you asked for is to power up weapons and armors attacks. Which really doesnt fit this script

Holyrapid

Hey, G_G, i was wondering if i can give it negative amounts so it instead decreaeses them.
To create "cursed" equipment or something like that.

G_G

yea you can
when configuring it just use a negative number
when 1 then return -5

Holyrapid

Ok, that´s great :) Thanks G_G
I´ll probaly use this.