Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[VX] SoS Variety (v1.0)

SoS Variety
Version: 1.0

Introduction

A script for VX that allows for random variations of enemy HP, MP, Gold, and EXP. Includes a setup section for turning specific parts on or off, changing the vary amount, and excluding certain enemies (by enemy id #).

Features
  • Can vary the HP, MP, Gold, and EXP from monsters
  • Turn off whichever parts you don't want
  • Exclude specific monsters
  • Easily change the percentage of vary for each stat

Screenshots

None unless they are needed.

Demo

None unless it is needed.

Script

Code:
#==============================================================================

# SoS Varieties

#------------------------------------------------------------------------------

# Description:

#               Allows for random HP/MP/EXP/Gold on enemies

#------------------------------------------------------------------------------

# By: Serpentofshadow

# 11/19/08

# Version 1.0

#

# Credit: Used several scripts by SandGolem as a base

#------------------------------------------------------------------------------

# VERSION HISTORY:

#   1.0 - Released

#------------------------------------------------------------------------------

# INSTRUCTIONS:

#   Paste this above main and in the Materials section

#   Customize the Serpent_Var module if needed (optional)

#==============================================================================

 

 

#==============================================================================

# SETUP

#   Modify the settings below to your liking

#==============================================================================

module Serpent_Var

  #Enemy Hit Points (HP) will vary randomly? true/false

  Varied_HP = true

  

  #The amount enemy HP varies by 0.01 through 0.99 (default 0.2)

  HP_Amount = 0.2

  

  #Enemies that will NOT have random HP - place enemy ID in []

  EXCLUDE_HP = []

  

  #Enemy Mana Points (MP) will vary randomly? true/false

  Varied_MP = true

  

  #The amount enemy MP varies by 0.01 through 0.99 (default 0.2)

  MP_Amount = 0.2

  

  #Enemies that will NOT have random MP - place enemy ID in []

  EXCLUDE_MP = []

  

  #Reward Gold (GP) from enemy will vary randomly? true/false

  Varied_Gold = true

  

  #The amount enemy Gold varies by 0.01 through 0.99 (default 0.4)

  Gold_Amount = 0.4

  

  #Enemies that will NOT have random Gold - place enemy ID in []

  EXCLUDE_Gold = []

  

  #Reward Experiance (EXP) from enemy will vary randomly? true/false

  Varied_Exp = true

  

  #The amount enemy Exp varies by 0.01 through 0.99 (default 0.2)

  Exp_Amount = 0.2

 

  #Enemies that will NOT have random Exp - place enemy ID in []

  EXCLUDE_Exp = []

end

#==============================================================================

# Setup is finished!

#==============================================================================

 

#==============================================================================

# Game_Enemy

#==============================================================================

class Game_Enemy < Game_Battler

  #aliases

  alias sos_enemyhp_orig base_maxhp

  alias sos_enemymp_orig base_maxmp

  alias sos_enemygold_orig gold

  alias sos_enemyexp_orig exp

 

  #Hit Points

  def base_maxhp

    if Serpent_Var::EXCLUDE_HP.include?(enemy_id)

      return sos_enemyhp_orig

    end

    if Serpent_Var::Varied_HP == true

      if @sos_enemy_basehp == nil

        sos_temp = sos_enemyhp_orig

        @sos_enemy_basehp = rand(sos_temp * Serpent_Var::HP_Amount)

        @sos_enemy_basehp += sos_temp * 0.9

        @sos_enemy_basehp = @sos_enemy_basehp.to_i

      end

    end

    return @sos_enemy_basehp

  end

  

  #Mana Points

  def base_maxmp

    if Serpent_Var::EXCLUDE_MP.include?(enemy_id)

      return sos_enemymp_orig

    end

    if Serpent_Var::Varied_MP == true

      if @sos_enemy_basemp == nil

        sos_temp = sos_enemymp_orig

        @sos_enemy_basemp = rand(sos_temp * Serpent_Var::MP_Amount)

        @sos_enemy_basemp += sos_temp * 0.9

        @sos_enemy_basemp = @sos_enemy_basemp.to_i

      end

    end

    return @sos_enemy_basemp

  end

  

  #Gold

  def gold

    if Serpent_Var::EXCLUDE_Gold.include?(enemy_id)

      return sos_enemygold_orig

    end

    if Serpent_Var::Varied_Gold == true

      if @sos_enemy_gold == nil

        sos_temp = sos_enemygold_orig

        @sos_enemy_gold = rand(sos_temp * Serpent_Var::Gold_Amount)

        @sos_enemy_gold += sos_temp * 0.9

        @sos_enemy_gold = @sos_enemy_gold.to_i

      end

    end

    return @sos_enemy_gold

  end

  

  #Experiance

  def exp

    if Serpent_Var::EXCLUDE_Exp.include?(enemy_id)

      return sos_enemyexp_orig

    end

    if Serpent_Var::Varied_Exp == true

      if @sos_enemy_exp == nil

        sos_temp = sos_enemyexp_orig

        @sos_enemy_exp = rand(sos_temp * Serpent_Var::Exp_Amount)

        @sos_enemy_exp += sos_temp * 0.9

        @sos_enemy_exp = @sos_enemy_exp.to_i

      end

    end

    return @sos_enemy_exp

  end

end

Instructions

Place in the Materials section just like any other script.

Under the module "Serpent_Var" (in the script) are the options. By default all varied stats are activated. To turn a part off, chance the respective option to "false". If you want a specific enemy to not have a stat varied, then put their ID# in the [] for the respective stat. Chance the amounts to the decimal number equivalent of the varying percent. Thus 10% would be 0.1.

FAQ

n/a

Compatibility

Conflicts with any script that modifies the functions "def basehp", "def basemp", "def gold", or "def exp" in Game_Enemy

Credits and Thanks

Sandgolem - I used his scripts for XP as a base

Author's Notes

Considering making an option for varying the other stats of enemies (ATK/DEF/SPI/AGI/Crit).

Terms and Conditions

Free for non-commercial use so long as I get credit. For commercial use, please e-mail me.
 
i'd like a demo to see how the variant effects gameplay, please XD
you dont really have to...

it looks great and ittle really save the troble of making HUNDREDS of the dame monster.
great job!
 
Whoa, this seriously helps a lot. Makes sense too, no way every slime in the world is in the same peak condition.

Is there a way to $callscript this thing to modify it in-game though? I've been thinking of having an accessory, when equipped, increases the variation in how much gold drops from a monster. Like a Lucky Charm or something.
 
KaiserGustaf":1dmg0pzt said:
Is there a way to $callscript this thing to modify it in-game though? I've been thinking of having an accessory, when equipped, increases the variation in how much gold drops from a monster. Like a Lucky Charm or something.

Hmm, that's certainly a good idea. I'll look into it, but I can't guarantee success.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top