Partagez
Aller en bas
tedrainbow
tedrainbow
Membre

Nombre de messages : 5
Age : 32
Localisation : Dessin
Distinction : aucune
Date d'inscription : 25/08/2012

VXACE  Script Gumps Class Based Level Bonus Script Empty VXACE Script Gumps Class Based Level Bonus Script

le Mer 18 Déc 2013 - 0:20
Salut.
J'ai un problème avec se script qui marche bien..
C'est que l'augmentation se fait a chaque fois que je change de class avec Yanfly Engine Ace.
Donc j'aimerais que sa augmente juste quand je fait un nouveaux niveaux, seulement.

Voila le code
Code:
module Class_params # le no touchie this line ok?
#===============================================================================
# * Gumps Class Based Level Bonus Script
# Version: 1.00
# Author: Matt_Sully(Gump)
# * This script was created as the result of a script request.
# * Special Thanks to "shrimpburgre" for this great & simple idea!
# * This script is only gauranteed to be compatible with Rpg Maker VX Ace.
#-------------------------------------------------------------
# > This easy to use script will add level bonuses to all your actors
# when they level up, and the bonuses they gain are based on their class.
# > To configure classes, simply modify the included sample data.
# > For sample data, I setup bonuses for all 10 default classes in VX ACE.
# > Copy/paste sample class data and configure it for new classes, thats
# the quickest way to setup data. <Enter> to a new line and paste.
# > Always paste new data on a new line, do not enter data beyond any
# boundaries (specified by 'do not edit beyond this line' comments)
# > class_id must always be set to the class id being configured
# > Class_id's are found on the "Classes" tab in your database (the numbers to
# the left of Class names)
# > Added an optional setting to break the max. limit value for parameters.
#-------------------------------------------------------------
# * LEGAL CRAP
# > You may freely use this script in any free or commercial game.
# > You may modify this script as you see fit, and release those modifications
# to others as you see fit.
# > If you use this script, you must provide proper credit to the Author.
#-------------------------------------------------------------
# * Modified Default Classes:
#  Game_Actor
#  > Aliased Methods: 1
#  > Overwritten Methods: 0
#  > New Methods: 2
#-------------------------------------------------------------
# * Suggestions + bug reports
# > if you have any ideas that you would like to see put into an official
# version of this script, PM me your suggestion or post it in one of my threads
# at rpgmakerweb or rpgmakervxace.net
# > If you have any bugs to report that need fixing please contact me with
# as many details (including how you caused the bug etc) as possible. Also include
# a copy of your class bonus params script (this script), so I may double check
# that your settings are not broken.
#===============================================================================
  #-------------------------------------------------------------
  # * System Settings
  #
  #-------------------------------------------------------------
  # * Print Results to Console
  # > true or false setting
  # > if true, prints the bonus parameters gained on each level up
  # to your games console
  # > Default: false
  #-------------------------------------------------------------
  Print_Results_To_Console = false
  #-------------------------------------------------------------
  # * Print Extra Debug Info to Console
  # > true or false setting
  # > if true, extra info will be printed to the console for debugging. Some
  # checking is also done to make sure bonus values are 'valid' and 'usable'.
  # > Default: false
  Print_Extra_Debug_To_Console = false
  #-------------------------------------------------------------
  # * Parameters Limit Breaker, Limit Breaker Values
  # > break the '999' max parameter value for actors with this setting.
  # > If the Limit Breaker is true, then the max parameter values are set to
  # the Limit Breaker Value settings.
  # > If the Limit Breaker is false, then the max parameter value is normal.
  # > Parameters = stats. Default max. for HP is 999,999, MP is 9,999. Default
  # max. for other stats such as strength and defense is 999.
  # > Default: false, values = default vx ace values
  Parameters_Limit_Breaker = false
  Parameters_Limit_Breaker_Value_HP = 999999
  Parameters_Limit_Breaker_Value_MP = 9999
  Parameters_Limit_Breaker_Value_STATS = 999
  #
  #
  #
  #-------------------------------------------------------------
  # * Default bonuses
 # (if the actors class is not configured for bonuses or the actors
  # class is not found etc, then the default bonuses are used
  # Default bonus: +3 Luck
  #-------------------------------------------------------------
  maxhp = 0
  maxmp = 0
  attack = 0
  defense = 0
  magatk = 0
  magdef = 0
  agility = 0
  luck = 3
 
  # DONT TOUCH THIS NEXT LINE!!!
  Classes = Hash.new([maxhp, maxmp, attack, defense, magatk, magdef, agility, luck])
 
  #-------------------------------------------------------------
  # * Class Bonuses
  # > The easiest way to setup new data is to copy/paste already defined
  # class data. Copy Soldier data for example (copy from the "Sample Class:
  # Soldier" comment down to and including "Classes[class_id] = values" code
  # line, then paste on a new line and edit accordingly for the new class.
  # > And of course you can modify or remove any of the included sample classes.
  # > You must get the 'class_id' correct for each class. if one is not
  # correct, it may overwrite the bonuses for another class.
  # > All parameter values must be added for each class even if their bonus is 0
  # as shown in the sample definitions.
  # > You should NEVER modify the "Classes[class_id] = values" code line, you
 # should only be copying and pasting it. Don't modify the array line above it
  # either.
  #-------------------------------------------------------------
 
  # Class: Soldier
  # +3 Attack and +1 Defense per level up
  class_id = 1
  maxhp = 20
  maxmp = 5
  attack = 8
  defense = 9
  magatk = 1
  magdef = 1
  agility = 3
  luck = 4
  array = [maxhp, maxmp, attack, defense, magatk, magdef, agility, luck]
  Classes[class_id] = array
 
  # Class: Monk
  # +1 MaxHP, +1 Attack and +2 Agility per level up
  class_id = 2
  maxhp = 28
  maxmp = 3
  attack = 11
  defense = 5
  magatk = 2
  magdef = 2
  agility = 7
  luck = 1
  array = [maxhp, maxmp, attack, defense, magatk, magdef, agility, luck]
  Classes[class_id] = array
 
  # Class: Paladin
  # +3 Defense, +1 Magic Defense
  class_id = 3
  maxhp = 0
  maxmp = 0
  attack = 0
  defense = 3
  magatk = 0
  magdef = 1
  agility = 0
  luck = 0
  array = [maxhp, maxmp, attack, defense, magatk, magdef, agility, luck]
  Classes[class_id] = array
 
  # Class: Spellblade
  # +1 MaxMP, +1 Attack, +1 Agility, +2 Magic Attack
  class_id = 4
  maxhp = 0
  maxmp = 1
  attack = 1
  defense = 0
  magatk = 2
  magdef = 0
  agility = 1
  luck = 0
  array = [maxhp, maxmp, attack, defense, magatk, magdef, agility, luck]
  Classes[class_id] = array
 
  # Class: Samurai
  # +4 Attack, +1 Agility
  class_id = 5
  maxhp = 0
  maxmp = 0
  attack = 4
  defense = 0
  magatk = 0
  magdef = 0
  agility = 1
  luck = 0
  array = [maxhp, maxmp, attack, defense, magatk, magdef, agility, luck]
  Classes[class_id] = array
 
  # Class: Archer
  # +5 Agility
  class_id = 6
  maxhp = 0
  maxmp = 0
  attack = 0
  defense = 0
  magatk = 0
  magdef = 0
  agility = 5
  luck = 0
  array = [maxhp, maxmp, attack, defense, magatk, magdef, agility, luck]
  Classes[class_id] = array
 
  # Class: Thief
  # +3 Agility, +3 Luck
  class_id = 7
  maxhp = 0
  maxmp = 0
  attack = 0
  defense = 0
  magatk = 0
  magdef = 0
  agility = 3
  luck = 3
  array = [maxhp, maxmp, attack, defense, magatk, magdef, agility, luck]
  Classes[class_id] = array
 
  # Class: Priestess
  # +2 MaxMP, +2 Magic Attack, +2 Magic Defense
  class_id = 8
  maxhp = 0
  maxmp = 2
  attack = 0
  defense = 0
  magatk = 2
  magdef = 2
  agility = 0
  luck = 0
  array = [maxhp, maxmp, attack, defense, magatk, magdef, agility, luck]
  Classes[class_id] = array
 
  # Class: Witch
  # +3 MaxMP, +3 Magic Attack
  class_id = 9
  maxhp = 0
  maxmp = 3
  attack = 0
  defense = 0
  magatk = 3
  magdef = 0
  agility = 0
  luck = 0
  array = [maxhp, maxmp, attack, defense, magatk, magdef, agility, luck]
  Classes[class_id] = array
 
  # Class: Sage
  # +1 MaxMP, +3 Magic Defense, +1 Agility
  class_id = 10
  maxhp = 0
  maxmp = 1
  attack = 0
  defense = 0
  magatk = 0
  magdef = 3
  agility = 1
  luck = 0
  array = [maxhp, maxmp, attack, defense, magatk, magdef, agility, luck]
  Classes[class_id] = array
 
 
 
 
 
 
end #DO NOT INSERT SETTINGS OR DATA BELOW THIS LINE!!! CREATE NEW LINES AND
# ENTER DATA THERE.






# DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YER DOIN!

#-------------------------------------------------------
# * Game_Actor modifications
#-------------------------------------------------------
class Game_Actor < Game_Battler
  # * aliased method
  alias :level_up_add_class_params :level_up
  def level_up
    level_up_add_class_params
    add_bonus_params_for_class
  end
  # * new Method
  def add_bonus_params_for_class
    cl = self.class_id
    bonus_params = Class_params::Classes[cl].dup
    index = 0
    for i in 0...bonus_params.size
      par = bonus_params.shift
      if par > 0
        add_param(index, par)
      end
      index += 1
    end
    print_results(cl) if Class_params::Print_Results_To_Console == true
  end
  # * new Method
  def print_results(classid)
    return if classid == nil || classid == 0
    bonusvals = Class_params::Classes[classid]
    included = Class_params::Classes.include?(classid)
    included = false if included != true
    hp = bonusvals[0]; mp = bonusvals[1]
    attack = bonusvals[2]; defense = bonusvals[3]
    magatk = bonusvals[4]; magdef = bonusvals[5]
    agility = bonusvals[6]; luck = bonusvals[7]
    p "Actor: '#{self.name}'", "Class ID: '#{self.class_id}'", "Level up Bonus Values for Class:"
    p "Is this class properly configured for bonuses? (true/false): '#{included}'"
    p "MaxHP +#{hp}", "MaxMP +#{mp}", "Attack +#{attack}", "Defense +#{defense}", "Magic Attack +#{magatk}", "Magic Defense +#{magdef}", "Agility +#{agility}", "Luck +#{luck}"
    return unless Class_params::Print_Extra_Debug_To_Console == true; p ""; p ""
    p "Printing Extra Debug info (class params bonus on level up script)"; p ""
    p "[RAW]Bonus values for undefined classes: #{Class_params::Classes["undefined"]}"; p ""
    p "Defined Class IDs: #{Class_params::Classes.keys}"; p ""
    p "Total Amount of Defined Classes: #{Class_params::Classes.size}"; p ""
    p "Full 'Classes' Hash: #{Class_params::Classes}"
    p "Checking for invalid Definitions by size..."
    p "Valid definition size: 8"
    index = 0
    keychain = Class_params::Classes.keys
    for i in 0...keychain.size
      key = keychain[index]
      data = Class_params::Classes[key]
      size = data.size
      p "      Class ID '#{key}' definition Validation Check: PASS!" if size == 8
      if size != 8
        p "      Class ID '#{key}' definition Validation Check: FAIL!!!"
        p "      Class ID '#{key}' size: #{size}"
        p "      Class ID #{key} data (bonus params): #{data}"
      end; subind = 0; p "Checking Class ID '#{key}' are Integer values?"
      for i in 0...data.size
        chk = data[subind]
        crc = chk.is_a? Integer
        p "Bonus Param #{subind+1} Check: PASS!" if crc == true
        p "Bonus Param #{subind+1} Check: FAIL!" if crc == false
        p "Bonus Param #{subind+1} Value: #{chk}" if crc == false
        subind += 1
      end
      index += 1
    end
   
  end
end

#-------------------------------------------------------
# * Game_BattlerBase modifications
#-------------------------------------------------------
class Game_BattlerBase
  # Aliased Method
  alias :param_max_override :param_max
  def param_max(param_id)
    if Class_params::Parameters_Limit_Breaker == true
      return Class_params::Parameters_Limit_Breaker_Value_HP if param_id == 0  # MHP
      return Class_params::Parameters_Limit_Breaker_Value_MP if param_id == 1  # MMP
      return Class_params::Parameters_Limit_Breaker_Value_STATS                # Other Stats
    else
      param_max_override(param_id)
    end
  end
end


Sinon quel script je peux utiliser dans le même genre que celui la..
Mais compatible avec Yanfly Engine Ace class system..
Spytje
Spytje
Administrateur

Nombre de messages : 5933
Localisation : La terre
Distinction : Spiraliste [Korn']
Forestia : Projet du mois juillet 2014
Papy Pulkigrat [Yama']
Date d'inscription : 16/03/2008

VXACE  Script Gumps Class Based Level Bonus Script Empty Re: VXACE Script Gumps Class Based Level Bonus Script

le Mer 18 Déc 2013 - 1:13
Je pense que tu ferais mieux de demander au créateur (Yanfly) du script en lui même, il pourra te répondre beaucoup plus vite et trouver la solution.

http://yanflychannel.wordpress.com/rmvxa/battle-scripts/ace-battle-engine/

_________________
VXACE  Script Gumps Class Based Level Bonus Script 911

LE PROJET SUR FACEBOOK

N'hésitez pas à suivre la page  VXACE  Script Gumps Class Based Level Bonus Script 344805
Chaos17
Chaos17
Membre

Nombre de messages : 222
Localisation : France
Distinction : aucune
Date d'inscription : 11/04/2012
http://blogofchaos17.wordpress.com/

VXACE  Script Gumps Class Based Level Bonus Script Empty Re: VXACE Script Gumps Class Based Level Bonus Script

le Mer 18 Déc 2013 - 13:07
Yanfly est en pause de manière indéfini XD
Spytje
Spytje
Administrateur

Nombre de messages : 5933
Localisation : La terre
Distinction : Spiraliste [Korn']
Forestia : Projet du mois juillet 2014
Papy Pulkigrat [Yama']
Date d'inscription : 16/03/2008

VXACE  Script Gumps Class Based Level Bonus Script Empty Re: VXACE Script Gumps Class Based Level Bonus Script

le Mer 18 Déc 2013 - 18:26
Aie ça c'est un problème, faut donc contacter un codeur du forum et demander si il sait t'aider, Lightnox ou Biwy.

_________________
VXACE  Script Gumps Class Based Level Bonus Script 911

LE PROJET SUR FACEBOOK

N'hésitez pas à suivre la page  VXACE  Script Gumps Class Based Level Bonus Script 344805
Revenir en haut
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum