Sujet: probleme avec JobChanger for VX, by Blackmorning Mer 25 Juil 2012 - 12:17
Bonjour, je me suis remis sur mon projet et je tombe sur un problème dont je n'arive pas à le résoudre
Je veux ajouter le perso n°8 avec le job n°11 au niveau 10 en apellant plussieur fois la commande de script $game_actors[008] .class_level_up (11) et lors du test cela me met "SyntaxError occured while running script"
J'ai essayé de monter ce job pour les persos 1 à 7 cela fonctionne J'ai essayé de monter un autre job pour ce perso cela ne marche pas et j'ai le message "SyntaxError occured while running script" J'ai essayé de monter ce job avec le perso 9 et j'ai le même problème J'ai essayé de monter ce job avec les perso 10 à 12 et je n'ai plus le message d'erreur mais le niveau de classe ne change pas.
J'espère avoir été clair pour expliqué mon problème
Titou
Illusionniste Lv.12
Inscrit le : 22/05/2012 Messages : 773
Sujet: Re: probleme avec JobChanger for VX, by Blackmorning Mer 25 Juil 2012 - 13:06
Si j'ai bien compris, tu veux faire changé de classe ton perso quand il arrive au niveau 10 c'est sa?
tontonjif
Poulet trizo Lv.3
Age : 42 Inscrit le : 20/10/2011 Messages : 30
Sujet: Re: probleme avec JobChanger for VX, by Blackmorning Mer 25 Juil 2012 - 13:53
non, je veux qu'il rentre dans l'équipe avec un job de niveau 10. sachant que le niveau du perso et celui du job sont tout les deux différents
Titou
Illusionniste Lv.12
Inscrit le : 22/05/2012 Messages : 773
Sujet: Re: probleme avec JobChanger for VX, by Blackmorning Mer 25 Juil 2012 - 13:56
Mais y a pas de niveau pour le job non?
Ice Monkey
Templier Lv.15
Age : 26 Inscrit le : 30/01/2011 Messages : 1273
Sujet: Re: probleme avec JobChanger for VX, by Blackmorning Mer 25 Juil 2012 - 13:59
Vérifier qu'il y a tous les end bien placés dans le script ou donne le nous. Souvent ça vient de la.
tontonjif
Poulet trizo Lv.3
Age : 42 Inscrit le : 20/10/2011 Messages : 30
Sujet: Re: probleme avec JobChanger for VX, by Blackmorning Mer 25 Juil 2012 - 14:22
donc voila les script en question
Citation :
#============================================================================== # ** JobChanger for VX, by Blackmorning # last updated 31/07/10 # Some features taken from tkblackknight, Prexus & Yanfly Job Changers # and from Enelvon #============================================================================== =begin ******************************************************************************** Updates ******************************************************************************** 31/07/10 - cleaned up a few points, some bugs fixed (higher class levels) 12/07/10 - compatible with YEM Battler Stat: RES and Battler Stat: DEX (requested by Kaimi) 23/06/10 - change in how skills are forgotten when changing classes 16/02/10 - compatible with YEZ Battler Stat: RES and Battler Stat: DEX (requested by sol003) 18/11/09 - fixed jp earned during fight (noticed by Slajmboll) 23/08/09 - minor visual improvements when no jp is used 04/08/09 - when not gaining jp by any means, skills are learnt by actor level (original way) 28/07/09 - can make items to add/remove classes - fixed class adding and removing from list (now works when reloading) - fixed when class level up bonus based on actor's level 22/07/09 - bug fix # requests by Andrelvis - can modify jp needed to go up a level - icons can appear next to class in job changer window 20/07/09 - level up bonuses can be by either class level or actor level - skills fix when initialized actor is higher level 16/07/09 - fixed minor issue with custom menus 14/07/09 - added check actor class list size 13/07/09 - customizable description of class on help window 30/06/09 - level up stat bonuses now based on class level. ( ie. stats increase as class level increases ) 29/06/09 - compability fix with special classes (ie. OriginalWij sequence skills) - issue fixed when regular level up 28/06/09 - minor formatting errors cleared up - check any actor class level and assign it to a variable ( good for creating events to add classes ) - fixed issue with character change 26/06/09 - skill window help opacity 255 - item (jp gain) fixed - can show class level in status & menu status screen #=============================================================================== CE QU'IL FAIT : * Ce script vous donne essentiellement une interface pour permettre au joueur de choisir la Classe pour chaque personnage. * Les acteurs Se basent les Stats peuvent être changées basées sur la classe * Bonus de Personne à charge de Classe BigEd781's Supplémentaires Stat * Options d'acteur (c'est-à-dire. La garde Super, à 2 épées, l'autobataille, la pharmacologie) peut être basée sur la Classe choisie * Le personnage d'acteur graphique peut être basé sur la Classe choisie ******************************************************************************* Ajouté = de Prexus - Changeur de Travail (v1.0) et Yanfly * L'expérience est représentée pour des personnages et leurs Classes, individuellement. * Des niveaux de gain de classes, les Emplois déterminent quels compétences vous apprenez. * La classe Levels/Exp est rappelée en changeant des emplois. ******************************************************************************* SCript appels (événements) : Assigner la taille de liste nominative des élèves d'un acteur à une variable actor_class_list_size (l'acteur, variable_id) Par exemple : Actor_class_list_size (1, 5) assigne l'acteur 1 taille de liste nominative des élèves à la variable 5
Assigner la classe d'un acteur se nivellent à une variable check_class_level (l'acteur, class_id, variable_id) Par exemple : Check_class_level (1, 1, 5) assigne l'acteur 1 classe 1 niveau à la variable 5
Augmenter le niveau d'un travail spécifique pour un acteur : <*Game_Actor> .class_level_up (ID de Classe) Par exemple : $game_party.members [0] .class_level_up (2)
* Vous permet de permettre ou mettre hors de service l'écran de JobChange sur le menu de commande principal. Ceci aussi actives ou désactive CLASSES_SWITCH. Permit_jobchange (vrai/faux)
Nouvelles commandes de script : Utilisé dans script dans Commandes d'Événement
Character_Class.new_class(actor,class_id):
*Ajoute une classe à l'acteur choisi : Character_Class.new_class(1,6) Ralph learns Dark Knight or: Character_Class.new_class($game_party.actors[2].id,6) party actor 2 learns Dark Knight
*Classe de Proximités du personnage Character_Class.remove_class(actor_id,class_id) Ne marche pas si le personnage est actuellement à cette classe
******************************************************************************** Added from Yanfly ******************** *SKILL TAGS - notebox. ******************** Si un perso utilise cette compétence, cet acteur gagnera la quantité de jeu de x de JP.
Si un perso utilise cette compétence, cet acteur gagnera la quantité aléatoire x de JP. ******************** *ITEM TAGS - notebox. ******************** L'article donnera à l'allié cible JP de quantité de x. JP donne à ce que la classe actuelle de l'allié est.
L'article ouvrira la classe x pour l'allié cible. L'utilisation multiple de ces étiquettes si vous voulez qu'un article ouvre plus qu'une classe.
L'article fermera la classe x pour l'allié cible. L'utilisation multiple de ces étiquettes si vous voulez qu'un article ferme plus qu'une classe. ******************** *ENEMY TAGS - notebox. ******************** Ceci détermine la quantité de JP donné par cet ennemi. Si rien n'est déterminé par cette valeur de jeu et vous permettez à vos ennemis de donner JP, donc le JP livré égalera à la quantité d'ENEMIES_DEFAULT.
JP le taux de gain est le % x. Si x est 200, donc le tauxde gain de JP est 200 %.
X est ajouté au gain de JP. Cela signifie si le gain de JP est 20 et x est 10, le total est 30.
******************************************************************************** * Not 100% tested, please report any bugs ******************************************************************************** =end #=============================================================================== # * Customize * #=============================================================================== module S_B module CLASS #----------------------------------------------------------------------------- # Nom pour l'expérience gagnée pour classe de Travail #----------------------------------------------------------------------------- CLASS_EXP = "PC" CLASS_EXP_A = "PC" #----------------------------------------------------------------------------- # Ce qui semble dans le menu appeler le script #----------------------------------------------------------------------------- MENU_CLASS_CHANGE_TITLE = "Classes" #----------------------------------------------------------------------------- # Montre le niveau de classe des acteurs dans le menu principal et des écrans de statut #----------------------------------------------------------------------------- SHOW_CLASS_LVL_MAIN = true SHOW_CLASS_LVL_STATUS = true #----------------------------------------------------------------------------- # Si vraiment on permet le changement de classe au début du jeu #----------------------------------------------------------------------------- MENU_CLASS_CHANGE_OPTION = true #----------------------------------------------------------------------------- # Commutez(Changez) d'ID pour permettre la classe changeant dans le menu #----------------------------------------------------------------------------- DISABLE_CLASS = 1 HIDE_CLASS = 2 #----------------------------------------------------------------------------- # JP gagné par options de bataille diverses *Yanfly #----------------------------------------------------------------------------- USE_BONUS_JP = true # Cela couche si vraiment vous voudriez que vos acteurs montrent(affichent) le JP ils ont #gagné dans la bataille (puisque chaque action ajoute JP) DISPLAY_BONUS_JP = true DISPLAY_ACTOR_MSG = "%s gagne %d #{S_B::CLASS::CLASS_EXP_A} durant ce combat." #JP est gagné au cours de la bataille d'effets différents. Vous pouvez déterminer #ce qui gagnera JP ici et par combien. Les quantités de jeu sont les augmentations qui # arriveront toujours tant que l'on permet l'action. Des quantités aléatoires feront #augmenter le JP gagné de 0 à cette quantité.
EARN_JP_VIA_ATTACK_ENABLE = true # Des attaques normales gagneront JP. EARN_JP_VIA_ATTACK_AMOUNT = 2 # Gagne au moins cette quantité de JP. EARN_JP_VIA_ATTACK_RANDOM = 0 # Gagne jusqu'à cette quantité aléatoire.
EARN_JP_VIA_SKILL_ENABLE = true # Les compétences gagneront JP. EARN_JP_VIA_SKILL_AMOUNT = 5 # Gagne au moins cette quantité(somme) de JP. EARN_JP_VIA_SKILL_RANDOM = 0 # Earns up to this random amount.
EARN_JP_VIA_GUARD_ENABLE = false # La garde gagnera JP. EARN_JP_VIA_GUARD_AMOUNT = 0 # Earns at least this amount of JP. EARN_JP_VIA_GUARD_RANDOM = 0 # Earns up to this random amount.
EARN_JP_VIA_ITEMS_ENABLE = true # Using items will earn JP. EARN_JP_VIA_ITEMS_AMOUNT = 1 # Earns at least this amount of JP. EARN_JP_VIA_ITEMS_RANDOM = 0 # Earns up to this random amount. #----------------------------------------------------------------------------- # JP d'ennemis *Yanfly #Ceci détermine si vraiment les ennemis donneront JP si tué et le #la quantité par défaut si pas le jeu avec. #----------------------------------------------------------------------------- ENEMIES_GIVE_JP = true ENEMIES_JP_DEFAULT = 2 #----------------------------------------------------------------------------- # Vocab for end of combat *Prexus #----------------------------------------------------------------------------- ObtainClassExp = "%s #{S_B::CLASS::CLASS_EXP_A} est apris!" # first %s is # of JP earned ClassLevelUp = "%s est %s %s %s!" # first %s is actor, second %s is class, third & fourth %s is level #----------------------------------------------------------------------------- # Maximum level per job *Blackmorning and Mithran # DO NOT go above 99 #----------------------------------------------------------------------------- MAX_CLASS_LEVEL_DEFAULT = 30 CLASS_MAX_LEVELS = {} # Ne changez pas cette ligne! # Ci-dessous ici, fondez les niveaux max individiual pour chaque classe. # CLASS_MAX_LEVELS[class_id] = maxlevel CLASS_MAX_LEVELS[1] = 30 # C'est-à-dire le Paladin est étonné au niveau 30 CLASS_MAX_LEVELS[2] = 30 # ie Warrior is capped at level 99 CLASS_MAX_LEVELS[3] = 30 # ie Priest is capped at level 99 CLASS_MAX_LEVELS[4] = 30 # ie Magician is capped at level 50 #----------------------------------------------------------------------------- # Icon used to show MAX level *Blackmorning #----------------------------------------------------------------------------- MASTERED_ICON = 102 #----------------------------------------------------------------------------- # Icon beside skills in class menu #----------------------------------------------------------------------------- Skills_Icon = 129 #----------------------------------------------------------------------------- # Button to show skills window in job change #----------------------------------------------------------------------------- SHOW_SKILLS_WINDOW = Input::A #----------------------------------------------------------------------------- # CLASS SPECIFIC CHARACTER GFX - *Enelvon # file format: # $"actor_ID"_"class_ID" # ie. $1_5 for actor 1, class 5 #----------------------------------------------------------------------------- CHANGE_GRAPHIC = true #----------------------------------------------------------------------------- # Des classes disponibles sont les classes par lesquelles chaque acteur commence de. AVAILABLE_CLASSES = { # don't remove # format: actor_id => [class_id, class_id...], #----------------------------------------------------------------------------- 1 => [1,4,5,9], 2 => [1,4,5,9], 3 => [1,4,5,9], 4 => [1,4,5,9], 5 => [1,3,4,5,9], 6 => [1,3,4,5,6,9], 7 => [1,2,3,4,5,9], 8 => [1,2,3,4,5,6,9,11], } # don't remove #----------------------------------------------------------------------------- # Si vrai, l'acteur garde des compétences appris en changeant des classes #si faux, perd TOUS les compétences appris par la classe précédente (ceux spécifiques à la classe) #----------------------------------------------------------------------------- KEEP_SKILLS = true #----------------------------------------------------------------------------- # Entrez dans l'ID'S des personnages qui gardent toujours leurs compétences # characters that ignore KEEP_SKILLS = false #----------------------------------------------------------------------------- SPECIAL_CLASS_ACTORS = [20] #----------------------------------------------------------------------------- # Définissez que Class_ID's utilise ces options spéciales. *TBK #----------------------------------------------------------------------------- CHANGE_ACTOR_OPTIONS = true CRITICAL_CLASSES = [7] TWOSWORDS_CLASSES = [20] # L'acteur attaquera automatiquement . AUTOBATTLE_CLASSES = [20] # L'acteur prendra même moins de dégâts en gardant. SUPERGUARD_CLASSES = [1,8] #Les articles auront l'effet double quand utilisé par l'acteur. PHARMACOLOGY_CLASSES = [5] #----------------------------------------------------------------------------- HALP_MP_CLASSES = [1,7] HP_RECOVER = [5] FAST_ATTACK = [3,7,9,11] #----------------------------------------------------------------------------- # Yanfly Engine RD - Battler Stat: Barehand # Last Date Updated: 2009.05.14 #----------------------------------------------------------------------------- #Pour ceux qui voudraient donner à leurs acteurs la force plus forte quand aucun arme n'est équipée, #il y a un barehand stat maintenant. Vous pouvez vous adapter comment fort #le multiplicateur à mains nues d'un acteur cultivera chaque niveau pour que la voie, vous ne fassiez pas #ont vos acteurs allant au sommet fort depuis le début. #----------------------------------------------------------------------------- # Ceci est le tableau de classes qui peuvent se battre à mains nues. BAREHANDED_CLASSES = [20] # Ceci est le multiplicateur donné pour baser l'attaque quand aucune arme n'est équipée. BAREHAND_BASE_MULTIPLIER = 150 BAREHAND_PER_LEVEL_BOOST = 5 # based on class level BAREHAND_MAX_MULTIPLIER = 400 #----------------------------------------------------------------------------- # CLASS "BASED STAT MULTIPLIER" - *Enelv-on - specifically for the JobChanger # Redesigned by Blackmorning #----------------------------------------------------------------------------- # Ci-dessous sont les Multiplicateurs pour chaque Classe ID/Stat # Class ID => Stat Multipliers # example: if you want Class_ID #1 to have normal MAXHP (ie 100%) # you would set the multiplier to 1.0 #----------------------------------------------------------------------------- # Ceci détermine si vraiment les stats d'acteur sont affectées par leur quel * #la classe ils ont équipé. CHANGE_BASE_STATS = true # Cela affecte le type d'affichage(de présentation) pour de nouvelles stats. # Si vrai, Montre l'augmenté/diminué dans le stat. #Si faux, Montre nouveau stat lui-même. SHOW_DIFFERENCE = true #----------------------------------------------------------------------------- BASE_STAT_CHANGE = { # <--- Do not remove # res and dex only active with YEZ Battler stats res and dex # Class HP MP ATK DEF INT AGI RES DEX 0 => [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1, 1], #default 1 => [ 1.0, 0.5, 1.2, 1.0, 0.5, 0.8, 0.5, 0.8], #Guerrier 2 => [ 0.75, 1, 0.5, 0.8, 1, 1.2, 0.9, 1], #Chanteuse 3 => [ 0.9, 0.8, 1, 0.8, 0.7, 1.2, 0.8, 1.2], #archer 4 => [ 0.75, 1.2, 0.5, 0.8, 1.2, 0.7, 1.2, 0.8], #Mage noir 5 => [ 0.75, 1.2, 0.5, 0.8, 1.2, 0.7, 1.2, 0.8], #Mage blanc 6 => [ 1.0, 1, 1.2, 0.6, 1.2, 0.8, 1.2, 0.8], #Dark Knight 7 => [ 1.2, 0.5, 1.2, 0.8, 0.5, 1.2, 0.5, 1.2], #Berserk 8 => [ 0.85, 0.7, 1.2, 0.9, 0.6, 1.2, 0.7, 1.2], #Samourai 9 => [ 1, 0.8, 1, 0.8, 0.8, 1.2, 0.8, 1.2], #Animiste 10 => [ 1.2, 0.5, 1.2, 0.8, 0.5, 0.8, 0.5, 0.8], #Ch. Dragon 11 => [ 0.9, 0.8, 1, 0.8, 0.7, 1.2, 0.8, 1.2], #Ninja } # Do not remove this. #========================================================================== # BigEd781's Class Dependant Stat Bonuses #-------------------------------------------------------------------------- # Le but de ceci est de permettre à celui de mettre stat # des bonus sur le niveau de classe en haut selon la classe du joueur. #========================================================================== # *Quand l'au-dessous de la valeur est mis "à vrai", la table de valeurs constantes #au-dessous de cela est utilisée pour déterminer quels le niveau de classe en haut les bonus sont, dépendant #sur la classe. #----------------------------------------------------------------------------- LEVEL_UP_BONUSES = false
CLASS_LEVEL_UP_BONUS_CLASS_DEP = false # Si vrai, bonus basés sur niveau de classe #Si faux, bonus basés sur niveau d'acteur #----------------------------------------------------------------------------- # * Configuration module #----------------------------------------------------------------------------- STAT_BONUS = { # <--- Do not remove # res and dex only active with YEZ Battler stats res and dex # Class HP MP ATK DEF INT AGI RES DEX 1 => [ 526, 0, 4, 5, 0, 0, 0, 0], #Paladin 2 => [ 29, 0, 8, 0, 0, 2, 0, 0], #Beserker 3 => [ 0, 19, 0, 0, 8, 0, 0, 0], #Priest 4 => [ 0, 26, 0, 0, 7, 0, 0, 0], #Magician 5 => [ 24, 0, 4, 4, 0, 0, 0, 0], #Knight 6 => [ 26, 0, 6, 6, 0, 0, 0, 0], #Dark Knight 7 => [ 34, 0, 8, 2, 0, 3, 0, 0], #Monk 8 => [ 12, 0, 2, 0, 0, 11, 0, 0], #Thief } # Do not remove this. #----------------------------------------------------------------------------- # Si le niveau est diminué, est des bonus stat perdus ? #============================================================================= LOSE_STAT_BONUS = false #============================================================================= # Description de la classe pour la fenêtre d'aide #----------------------------------------------------------------------------- # format: class_id => ["description"], Class_Descriptions = { # <--- Do not remove 1 =>["Un fier combatant."], #Guerrier 2 =>["Un comédien abouti."], #Chanteuse 3 =>["Un combatant à distance."], #archer 4 =>["Maitre des éléments."], #Mage noir 5 =>["Soigne ses alliées."],#mage blanc 6 =>["Le combatant du coté obcur."], #Dark Knight 7 =>["Un combatant féroce"], #Berserk 8 =>["Maitre du bushido."],#Samourai 9 =>["Combatant bestial."],#Animiste 10 =>["Maitre des techniques dragons."],#Ch. dragon 11 =>["Maitre des techniques ninjutsu."],#Ninja }# <--- Do not remove #============================================================================= # icons appear next to class in job changer window # requested by Andrelvis USE_ICONS_FOR_CLASSES = true # format: class_id => [icon_id], Class_Icons = { # <--- Do not remove 0 => 0, #default if no icon assigned 1 => 2, 2 => 88, 3 => 16, 4 => 212, 5 => 128, 6 => 136, 7 => 11, 8 => 9, 9 => 12, 10 => 5, 11 => 25, } # <--- Do not remove #----------------------------------------------------------------------------- Custom_JP_Needed_For_Level = true #Si vrai, utilise exp_list comme des valeurs de départ et la formule semblable. # Si faux, utilise seulement exp_list pour jp nécessaire pour le niveau de classe en haut. CLASS_JP_MOD_BASIS = 25 CLASS_JP_MOD_INFLATION = 35
end end #============================================================================= # * End Customization * #=============================================================================
Dernière édition par tontonjif le Mer 25 Juil 2012 - 15:19, édité 1 fois
Titou
Illusionniste Lv.12
Inscrit le : 22/05/2012 Messages : 773
Sujet: Re: probleme avec JobChanger for VX, by Blackmorning Mer 25 Juil 2012 - 14:33
Y permet de faire quoi se script?
tontonjif
Poulet trizo Lv.3
Age : 42 Inscrit le : 20/10/2011 Messages : 30
Sujet: Re: probleme avec JobChanger for VX, by Blackmorning Mer 25 Juil 2012 - 14:43
c'est une parti du script pour faire un changement de classe
Ice Monkey
Templier Lv.15
Age : 26 Inscrit le : 30/01/2011 Messages : 1273
Sujet: Re: probleme avec JobChanger for VX, by Blackmorning Mer 25 Juil 2012 - 14:50
Il faut le script entier
tontonjif
Poulet trizo Lv.3
Age : 42 Inscrit le : 20/10/2011 Messages : 30
Sujet: Re: probleme avec JobChanger for VX, by Blackmorning Mer 25 Juil 2012 - 15:21
la second partie je n'y ai pas toucher
Ice Monkey
Templier Lv.15
Age : 26 Inscrit le : 30/01/2011 Messages : 1273
Sujet: Re: probleme avec JobChanger for VX, by Blackmorning Mer 25 Juil 2012 - 15:32
Meme ça peut venir d'une fausse manip quand tu l'as copié collé.
tontonjif
Poulet trizo Lv.3
Age : 42 Inscrit le : 20/10/2011 Messages : 30
Sujet: Re: probleme avec JobChanger for VX, by Blackmorning Mer 25 Juil 2012 - 16:32
le voila en trois partie
Citation :
Ne touchez pas, toutes les personnalisations peuvent être faites dans le scénario ci-dessus. #=============================================================================== module S_B::CLASS module_function def permit_jobchange(enabled = true) if enabled $game_switches[S_B::CLASS::DISABLE_CLASS] = false else $game_switches[S_B::CLASS::DISABLE_CLASS] = true end end #-------------------------------------------------------------------------- def check_class_level(actor, class_id, variable_id = 0) level = 0 c = $data_classes[class_id] level = $game_actors[actor].class_level[c.id] $game_variables[variable_id] = level if variable_id > 0 return level end #-------------------------------------------------------------------------- def actor_class_list_size(actor, variable_id = 0) class_list = $game_actors[actor].unlocked_classes $game_variables[variable_id] = class_list.size if variable_id > 0 return class_list end end #=============================================================================== class Game_Interpreter include S_B::CLASS end #=============================================================================== module Vocab ObtainClassExp = S_B::CLASS::ObtainClassExp ClassLevelUp = S_B::CLASS::ClassLevelUp Display_Actor_Msg = S_B::CLASS::DISPLAY_ACTOR_MSG Classes_Vocab = S_B::CLASS::MENU_CLASS_CHANGE_TITLE def self.jp return S_B::CLASS::CLASS_EXP end def self.jp_a return S_B::CLASS::CLASS_EXP_A end end $imported = {} if $imported == nil $imported["JobChange"] = true #=============================================================================== module YE module REGEXP module BASEITEM # These are skill related. JP_BOOST_SET = /<(?:JP_BOOST_SET|jp_boost_set)\s*(\d+)>/i JP_BOOST_RAN = /<(?:JP_BOOST_RAN|jp_boost_ran)\s*(\d+)>/i # These are item related. GAIN_JP = /<(?:GAIN_JP|gain_jp)\s*(\d+)>/i UNLOCK_CLASS = /<(?:UNLOCK_CLASS|unlock class)[ ]*(\d+)>/i LOCK_CLASS = /<(?:LOCK_CLASS|lock class)[ ]*(\d+)>/i end # BASEITEM module ENEMY # These are enemy related ENEMY_JP = /<(?:ENEMY_JP|enemy_jp)\s*(\d+)>/i end # ENEMY module STATE # This affects states. BONUS_JP_PER = /<(?:BONUS_JP_PER|bonus_jp_per)[ ]*(\d+)(?:%|%)?>/i BONUS_JP_SET = /<(?:BONUS_JP_SET|bonus_jp_set)[ ]*(\d+)>/i end # STATE end # REGEXP end # YE #=============================================================================== # RPG::State *from yanfly #=============================================================================== class RPG::State #-------------------------------------------------------------------------- # Yanfly_Cache_SSS #-------------------------------------------------------------------------- def yanfly_cache_state_sss @bonus_jp_per = 100; @bonus_jp_set = 0 self.note.split(/[\r\n]+/).each { |line| case line when YE::REGEXP::STATE::BONUS_JP_PER @bonus_jp_per = $1.to_i when YE::REGEXP::STATE::BONUS_JP_SET @bonus_jp_set = $1.to_i end } end # cache #-------------------------------------------------------------------------- # definitions #-------------------------------------------------------------------------- def bonus_jp_per yanfly_cache_state_sss if @bonus_jp_per == nil return @bonus_jp_per end def bonus_jp_set yanfly_cache_state_sss if @bonus_jp_set == nil return @bonus_jp_set end end #=============================================================================== # RPG::BaseItem *from yanfly #=============================================================================== class RPG::BaseItem #-------------------------------------------------------------------------- # Yanfly_Cache_SSS #-------------------------------------------------------------------------- def yanfly_cache_baseitem_sss @jp_boost_set = 0; @jp_boost_ran = 0 @gain_jp = 0; @unlock_class = []; @lock_class = [] self.note.split(/[\r\n]+/).each { |line| case line when YE::REGEXP::BASEITEM::JP_BOOST_SET @jp_boost_set = $1.to_i when YE::REGEXP::BASEITEM::JP_BOOST_RAN @jp_boost_ran = $1.to_i when YE::REGEXP::BASEITEM::GAIN_JP @gain_jp = $1.to_i when YE::REGEXP::BASEITEM::UNLOCK_CLASS @unlock_class.push($1.to_i) when YE::REGEXP::BASEITEM::LOCK_CLASS @lock_class.push($1.to_i) end } end # cache #-------------------------------------------------------------------------- # JP definitions #-------------------------------------------------------------------------- def jp_boost_set yanfly_cache_baseitem_sss if @jp_boost_set == nil return @jp_boost_set end def jp_boost_ran yanfly_cache_baseitem_sss if @jp_boost_ran == nil return @jp_boost_ran end def gain_jp yanfly_cache_baseitem_sss if @gain_jp == nil return @gain_jp end #-------------------------------------------------------------------------- # class definitions #-------------------------------------------------------------------------- def unlock_class yanfly_cache_baseitem_sss if @unlock_class == nil return @unlock_class end def lock_class yanfly_cache_baseitem_sss if @lock_class == nil return @lock_class end end #=============================================================================== # RPG::Enemy *from yanfly #=============================================================================== class RPG::Enemy #-------------------------------------------------------------------------- # Yanfly_Cache_SSS #-------------------------------------------------------------------------- def yanfly_cache_enemy_sss @enemy_jp = S_B::CLASS::ENEMIES_JP_DEFAULT self.note.split(/[\r\n]+/).each { |line| case line when YE::REGEXP::ENEMY::ENEMY_JP @enemy_jp = $1.to_i end } end # cache #-------------------------------------------------------------------------- # definitions #-------------------------------------------------------------------------- def enemy_jp yanfly_cache_enemy_sss if @enemy_jp == nil return @enemy_jp end end #============================================================================== # ** Game_Actor *from prexus and TBK and blackmorning #============================================================================== class Game_Actor < Game_Battler attr_accessor :jp_list attr_accessor :jp_exp attr_accessor :class_level #-------------------------------------------------------------------------- alias job_initialize initialize unless $@ #-------------------------------------------------------------------------- def initialize(actor_id) job_initialize(actor_id) @exist_character_graphics = [] end #-------------------------------------------------------------------------- alias job_setup setup unless $@ #-------------------------------------------------------------------------- def setup(actor_id) job_setup(actor_id) #default @jp_list = {}
for id in 1..$data_classes.size - 1 next unless $data_classes[id] @jp_list[id] = Array.new(101) end
end #-------------------------------------------------------------------------- # * Calculate JP Experience #-------------------------------------------------------------------------- def make_jp_exp_list for id in 1..$data_classes.size - 1 next unless $data_classes[id] if S_B::CLASS::Custom_JP_Needed_For_Level if S_B::CLASS::CLASS_JP_MOD.include?(id) jp_basis = S_B::CLASS::CLASS_JP_MOD[id][0] jp_inflation = S_B::CLASS::CLASS_JP_MOD[id][1] else jp_basis = S_B::CLASS::CLASS_JP_MOD_BASIS jp_inflation = S_B::CLASS::CLASS_JP_MOD_INFLATION end maxlevel = S_B::CLASS::CLASS_MAX_LEVELS[id] maxlevel = S_B::CLASS::MAX_CLASS_LEVEL_DEFAULT if maxlevel == nil @jp_list[id][1] = @jp_list[id][maxlevel+1] = 0 m = jp_basis n = (0.75 + jp_inflation / 200.0); for i in 2..(maxlevel) @jp_list[id][i] = @jp_list[id][i - 1] + Integer(m) m *= 1 + n; n *= 0.5; end else @jp_list[id] = @exp_list end end end #-------------------------------------------------------------------------- def forget_class_skills(id = nil) id = @class_id if id == nil for i in $data_classes[id].learnings forget_skill(i.skill_id) unless S_B::CLASS::KEEP_SKILLS or S_B::CLASS::SPECIAL_CLASS_ACTORS.include?(actor.id) end end #-------------------------------------------------------------------------- def define_skills(id = nil) id = @class_id if id == nil if !S_B::CLASS::USE_BONUS_JP && !S_B::CLASS::ENEMIES_GIVE_JP for i in $data_classes[id].learnings learn_skill(i.skill_id) if i.level <= @level end else for i in $data_classes[id].learnings learn_skill(i.skill_id) if i.level <= @class_level[id] end end end #-------------------------------------------------------------------------- def change_jp(jp, id = nil, show = false) id = @class_id if id == nil last_level = @class_level[id] last_skills = skills @jp_exp[id] = [[jp, 999999].min, 0].max while @jp_exp[id] >= @jp_list[id][@class_level[id] + 1] and @jp_list[id][@class_level[id] + 1] > 0 class_level_up(id) end while @jp_exp[id] < @jp_list[id][@class_level[id]] class_level_down(id) end if show and @class_level[id] > last_level display_class_level_up(skills - last_skills, id) end end #-------------------------------------------------------------------------- def jp_exp_s(id = nil) id = @class_id if id == nil return @jp_list[id][@class_level[id]+1] > 0 ? @jp_exp[id] : "-------" end #-------------------------------------------------------------------------- # * Get jp - numeric for calculations #-------------------------------------------------------------------------- def now_jp_exp(id = nil) id = @class_id if id == nil return @jp_exp[id] - @jp_list[id][@class_level[id]] end #-------------------------------------------------------------------------- def next_jp_exp_s(id = nil) id = @class_id if id == nil return @jp_list[id][@class_level[id]+1] > 0 ? @jp_list[id][@class_level[id]+1] : "-------" end #-------------------------------------------------------------------------- def next_class_rest_exp_s(id = nil) id = @class_id if id == nil return @jp_list[id][@class_level[id]+1] > 0 ? (@jp_list[id][@class_level[id]+1] - @jp_exp[id]) : "-------" end #-------------------------------------------------------------------------- def class_level_up(id = nil, adjust = false) id = @class_id if id == nil maxlevel = S_B::CLASS::CLASS_MAX_LEVELS[id] maxlevel = S_B::CLASS::MAX_CLASS_LEVEL_DEFAULT if maxlevel == nil @class_level[id] += 1 unless @class_level[id] == maxlevel @jp_exp[id] = @jp_list[id][@class_level[id]] if S_B::CLASS::LEVEL_UP_BONUSES if S_B::CLASS::CLASS_LEVEL_UP_BONUS_CLASS_DEP && S_B::CLASS::STAT_BONUS.include?(id) self.maxhp += S_B::CLASS::STAT_BONUS[id][0] self.maxmp += S_B::CLASS::STAT_BONUS[id][1] self.atk += S_B::CLASS::STAT_BONUS[id][2] self.def += S_B::CLASS::STAT_BONUS[id][3] self.spi += S_B::CLASS::STAT_BONUS[id][4] self.agi += S_B::CLASS::STAT_BONUS[id][5] self.res += S_B::CLASS::STAT_BONUS[id][6] if $imported["BattlerStatRES"] or $imported["RES Stat"] self.dex += S_B::CLASS::STAT_BONUS[id][7] if $imported["BattlerStatDEX"] or $imported["DEX Stat"] end end define_skills define_skills(id) if S_B::CLASS::KEEP_SKILLS or S_B::CLASS::SPECIAL_CLASS_ACTORS.include?(actor.id) end #-------------------------------------------------------------------------- def class_level_down(id = nil, adjust = false) id = @class_id if id == nil @class_level[id] -= 1 unless @class_level[id] == 1 @jp_exp[id] = @jp_list[id][@class_level[id]] if S_B::CLASS::LEVEL_UP_BONUSES if S_B::CLASS::CLASS_LEVEL_UP_BONUS_CLASS_DEP && S_B::CLASS::LOSE_STAT_BONUS && S_B::CLASS::STAT_BONUS.include?(id) self.maxhp -= S_B::CLASS::STAT_BONUS[id][0] self.maxmp -= S_B::CLASS::STAT_BONUS[id][1] self.atk -= S_B::CLASS::STAT_BONUS[id][2] self.def -= S_B::CLASS::STAT_BONUS[id][3] self.spi -= S_B::CLASS::STAT_BONUS[id][4] self.agi -= S_B::CLASS::STAT_BONUS[id][5] self.res -= S_B::CLASS::STAT_BONUS[id][6] if $imported["BattlerStatRES"] or $imported["RES Stat"] self.dex -= S_B::CLASS::STAT_BONUS[id][7] if $imported["BattlerStatDEX"] or $imported["DEX Stat"] end end define_skills define_skills(id) if S_B::CLASS::KEEP_SKILLS or S_B::CLASS::SPECIAL_CLASS_ACTORS.include?(actor.id) end #-------------------------------------------------------------------------- # level up #-------------------------------------------------------------------------- def level_up @level += 1 if S_B::CLASS::LEVEL_UP_BONUSES if !S_B::CLASS::CLASS_LEVEL_UP_BONUS_CLASS_DEP && S_B::CLASS::STAT_BONUS.include?(id) self.maxhp += S_B::CLASS::STAT_BONUS[id][0] self.maxmp += S_B::CLASS::STAT_BONUS[id][1] self.atk += S_B::CLASS::STAT_BONUS[id][2] self.def += S_B::CLASS::STAT_BONUS[id][3] self.spi += S_B::CLASS::STAT_BONUS[id][4] self.agi += S_B::CLASS::STAT_BONUS[id][5] self.res += S_B::CLASS::STAT_BONUS[id][6] if $imported["BattlerStatRES"] or $imported["RES Stat"] self.dex += S_B::CLASS::STAT_BONUS[id][7] if $imported["BattlerStatDEX"] or $imported["DEX Stat"] end end end #-------------------------------------------------------------------------- alias jp_leveldown level_down unless $@ #-------------------------------------------------------------------------- def level_down jp_leveldown if S_B::CLASS::LEVEL_UP_BONUSES if !S_B::CLASS::CLASS_LEVEL_UP_BONUS_CLASS_DEP && S_B::CLASS::LOSE_STAT_BONUS && S_B::CLASS::STAT_BONUS.include?(id) self.maxhp -= S_B::CLASS::STAT_BONUS[id][0] self.maxmp -= S_B::CLASS::STAT_BONUS[id][1] self.atk -= S_B::CLASS::STAT_BONUS[id][2] self.def -= S_B::CLASS::STAT_BONUS[id][3] self.spi -= S_B::CLASS::STAT_BONUS[id][4] self.agi -= S_B::CLASS::STAT_BONUS[id][5] self.res -= S_B::CLASS::STAT_BONUS[id][6] if $imported["BattlerStatRES"] or $imported["RES Stat"] self.dex -= S_B::CLASS::STAT_BONUS[id][7] if $imported["BattlerStatDEX"] or $imported["DEX Stat"] end end end #-------------------------------------------------------------------------- def jp_received(jp, id = nil, show = false) id = @class_id if id == nil change_jp(@jp_exp[id] + jp, id, show) end #-------------------------------------------------------------------------- # forget all skills #-------------------------------------------------------------------------- def forget_all_skills @skills = [] end #-------------------------------------------------------------------------- def class_change_level(level, id = nil, show = false) id = @class_id if id == nil maxlevel = S_B::CLASS::CLASS_MAX_LEVELS[id] maxlevel = S_B::CLASS::MAX_CLASS_LEVEL_DEFAULT if maxlevel == nil level = [[level, maxlevel].min, 1].max change_jp(@jp_list[id][level], id, show) end #-------------------------------------------------------------------------- def class_id=(class_id) forget_class_skills @class_id = class_id for i in 0..4 # Remove unequippable items change_equip(i, nil) unless equippable?(equips[i]) end if $imported["EquipExtension"] return if extra_armor_number == 0 for i in 5..armor_number change_equip(i, nil) unless equippable?(equips[i]) end end purge_unequippable if $imported["EquipmentOverhaul"] unless @unlocked_classes.include?(@class_id) @unlocked_classes.push(@class_id) end @unlocked_classes.sort! purge_unequippable_skills if $imported["EquipSkillSlots"] define_skills pic_name = "$#{actor.id}_#{$data_classes[class_id].id}" if S_B::CLASS::CHANGE_GRAPHIC && graphic_exist?(pic_name) $game_actors[@actor_id].set_graphic(pic_name, 0, @face_name, @face_index) $game_player.refresh end end #-------------------------------------------------------------------------- # return unlocked classes #-------------------------------------------------------------------------- def unlocked_classes results = [] @unlocked_classes = [self.class.id] if @unlocked_classes == nil @unlocked_classes.sort! results = @unlocked_classes results.push(self.class.id) unless results.include?(self.class.id) return results end #-------------------------------------------------------------------------- # perform unlock class #-------------------------------------------------------------------------- def unlock_class(newclass_id) @unlocked_classes = [self.class.id] if @unlocked_classes == nil unless @unlocked_classes.include?(newclass_id) @unlocked_classes.push(newclass_id) end @unlocked_classes.sort! end #-------------------------------------------------------------------------- # perform lock class #-------------------------------------------------------------------------- def lock_class(newclass_id) return if newclass_id == self.class.id @unlocked_classes = [self.class.id] if @unlocked_classes == nil @unlocked_classes.delete(newclass_id) @unlocked_classes.sort! end #-------------------------------------------------------------------------- # perform unlock all classes #-------------------------------------------------------------------------- def unlock_all_classes for i in 0..$data_classes.size unlock = $data_classes[i + 1] self.unlock_class(unlock.id) end @unlocked_classes.sort! end #-------------------------------------------------------------------------- # perform lock all classes #-------------------------------------------------------------------------- def lock_all_classes for i in 0..$data_classes.size unlock = $data_classes[i + 1] self.lock_class(unlock.id) end @unlocked_classes.sort! end #-------------------------------------------------------------------------- # * Determine if Graphic Filename Exists #-------------------------------------------------------------------------- def graphic_exist?(filename) return true if @exist_character_graphics.include?(filename) begin Cache.character(filename) @exist_character_graphics.push(filename) return true rescue return false end end #-------------------------------------------------------------------------- def display_class_level_up(new_skills, id) $game_message.new_page i = @class_id c = $data_classes[i] level = @class_level[c.id] text = sprintf(Vocab::ClassLevelUp, @name, $data_classes[id].name, Vocab::level, level.to_s) $game_message.texts.push(text) for skill in new_skills text = sprintf(Vocab::ObtainSkill, skill.name) $game_message.texts.push(text) end end #-------------------------------------------------------------------------- # * Show Level Up Message # new_skills : Array of newly learned skills #-------------------------------------------------------------------------- def display_level_up(new_skills) text = sprintf(Vocab::LevelUp, @name, Vocab::level, @level) $game_message.texts.push(text) for skill in new_skills text = sprintf(Vocab::ObtainSkill, skill.name) $game_message.texts.push(text) end end #-------------------------------------------------------------------------- # * Get Critical Ratio #-------------------------------------------------------------------------- alias job_cri cri unless $@ def cri n = job_cri n += 4 if self.job_critical_bonus return n end #============================================================================= # * Change Actor Options based on Class *from TBK #============================================================================= if S_B::CLASS::CHANGE_ACTOR_OPTIONS #-------------------------------------------------------------------------- # * Get [Critical Bonus] Option #-------------------------------------------------------------------------- def job_critical_bonus return true if S_B::CLASS::CRITICAL_CLASSES.include?(@class_id) end #-------------------------------------------------------------------------- # * Get [Dual Wield] Option #-------------------------------------------------------------------------- alias job_two_sword two_swords_style unless $@ def two_swords_style return true if S_B::CLASS::TWOSWORDS_CLASSES.include?(@class_id) job_two_sword end #-------------------------------------------------------------------------- # * Get [Automatic Battle] Option #-------------------------------------------------------------------------- alias job_auto_battle auto_battle unless $@ def auto_battle return true if S_B::CLASS::AUTOBATTLE_CLASSES.include?(@class_id) job_auto_battle end #-------------------------------------------------------------------------- # * Get [Super Guard] Option #-------------------------------------------------------------------------- alias job_super_guard super_guard unless $@ def super_guard return true if S_B::CLASS::SUPERGUARD_CLASSES.include?(@class_id) job_super_guard end
tontonjif
Poulet trizo Lv.3
Age : 42 Inscrit le : 20/10/2011 Messages : 30
Sujet: Re: probleme avec JobChanger for VX, by Blackmorning Mer 25 Juil 2012 - 16:32
Citation :
#-------------------------------------------------------------------------- # * Get [Pharmocology] Option #-------------------------------------------------------------------------- alias job_pharmacology pharmacology unless $@ def pharmacology return true if S_B::CLASS::PHARMACOLOGY_CLASSES.include?(@class_id) job_pharmacology end #-------------------------------------------------------------------------- # * Get [Half MP Cost] Option #-------------------------------------------------------------------------- alias job_half_mp_cost half_mp_cost unless $@ def half_mp_cost return true if S_B::CLASS::HALP_MP_CLASSES.include?(@class_id) job_half_mp_cost end #-------------------------------------------------------------------------- # * Get [HP Recover] Option #-------------------------------------------------------------------------- alias job_auto_hp_recover auto_hp_recover unless $@ def auto_hp_recover return true if S_B::CLASS::HP_RECOVER.include?(@class_id) job_auto_hp_recover end #-------------------------------------------------------------------------- # * Get [Fast Attack] Option #-------------------------------------------------------------------------- alias job_fast_attack fast_attack unless $@ def fast_attack return true if S_B::CLASS::FAST_ATTACK.include?(@class_id) job_fast_attack end else def job_critical_bonus return false end end
def base_stat_class(type, actclass = @class_id) if S_B::CLASS::CHANGE_BASE_STATS and S_B::CLASS::BASE_STAT_CHANGE.include?(actclass) multiplier = S_B::CLASS::BASE_STAT_CHANGE[actclass][type] - 1 elsif S_B::CLASS::CHANGE_BASE_STATS multiplier = S_B::CLASS::BASE_STAT_CHANGE[0][type] - 1 else multiplier = 0 end if type == 6 && $imported["BattlerStatRES"] if YEZ::STAT::ACTOR_BASE_RES.include?(@actor_id) n = eval(YEZ::STAT::ACTOR_BASE_RES[@actor_id]) else n = eval(YEZ::STAT::ACTOR_BASE_RES[0]) end value = multiplier * n elsif type == 6 && $imported["RES Stat"] if YEM::STATS::RES::ACTOR_BASE.include?(@actor_id) n = eval(YEM::STATS::RES::ACTOR_BASE[@actor_id]) else n = eval(YEM::STATS::RES::ACTOR_BASE[0]) end value = multiplier * n elsif type == 7 && $imported["BattlerStatDEX"] if YEZ::STAT::ACTOR_BASE_DEX.include?(@actor_id) n = eval(YEZ::STAT::ACTOR_BASE_DEX[@actor_id]) else n = eval(YEZ::STAT::ACTOR_BASE_DEX[0]) end value = multiplier * n elsif type == 7 && $imported["DEX Stat"] if YEM::STATS::DEX::ACTOR_BASE.include?(@actor_id) n = eval(YEM::STATS::DEX::ACTOR_BASE[@actor_id]) else n = eval(YEM::STATS::DEX::ACTOR_BASE[0]) end value = multiplier * n elsif $imported["LimitBreak"] value = multiplier * base_parameter(type) else value = multiplier * actor.parameters[type, @level] end return Integer(value) end
def barehand? if S_B::CLASS::BAREHANDED_CLASSES.include?(@class_id) if self.weapons[0] == nil and self.weapons[1] == nil return true else return false end else return false end end #-------------------------------------------------------------------------- # bare handed multiplier #-------------------------------------------------------------------------- def barehanded_multiplier(value) multiplier = S_B::CLASS::BAREHAND_BASE_MULTIPLIER id = @class_id classlevel = @class_level[id] multiplier += S_B::CLASS::BAREHAND_PER_LEVEL_BOOST * (classlevel - 1) multiplier = [S_B::CLASS::BAREHAND_MAX_MULTIPLIER, multiplier].min value *= multiplier value /= 100 return value end #============================================================================# # * Change Parameters based on Class # #============================================================================# #-------------------------------------------------------------------------- # * Get Basic Maximum HP #-------------------------------------------------------------------------- alias job_base_maxhp base_maxhp unless $@ def base_maxhp n = job_base_maxhp n += base_stat_class(0) return Integer(n) end #-------------------------------------------------------------------------- # * Get basic Maximum MP #-------------------------------------------------------------------------- alias job_base_maxmp base_maxmp unless $@ def base_maxmp n = job_base_maxmp n += base_stat_class(1) return Integer(n) end #-------------------------------------------------------------------------- # * Get Basic Attack #-------------------------------------------------------------------------- alias job_base_atk base_atk unless $@ def base_atk n = job_base_atk n += base_stat_class(2) barehand_trait = self.barehand? n = barehanded_multiplier(n) if barehand_trait return Integer(n) end #-------------------------------------------------------------------------- # * Get Basic Defense #-------------------------------------------------------------------------- alias job_base_def base_def unless $@ def base_def n = job_base_def n += base_stat_class(3) return Integer(n) end #-------------------------------------------------------------------------- # * Get Basic Spirit #-------------------------------------------------------------------------- alias job_base_spi base_spi unless $@ def base_spi n = job_base_spi n += base_stat_class(4) return Integer(n) end #-------------------------------------------------------------------------- # * Get Basic Agility #-------------------------------------------------------------------------- alias job_base_agi base_agi unless $@ def base_agi n = job_base_agi n += base_stat_class(5) return Integer(n) end #-------------------------------------------------------------------------- # * Get Basic Resistance #-------------------------------------------------------------------------- if $imported["BattlerStatRES"] or $imported["RES Stat"] alias job_base_res base_res unless $@ def base_res n = job_base_res n += base_stat_class(6) return Integer(n) end end #-------------------------------------------------------------------------- # * Get Basic Dexterity #-------------------------------------------------------------------------- if $imported["BattlerStatDEX"] or $imported["DEX Stat"] alias job_base_dex base_dex unless $@ def base_dex n = job_base_dex n += base_stat_class(7) return Integer(n) end end end #=============================================================================== # *Window_Base #=============================================================================== class Window_Base < Window #-------------------------------------------------------------------------- # * Draw Class Level #-------------------------------------------------------------------------- def draw_class_level(actor, x, y) w = 60 i = actor.class_id c = $data_classes[i] level = actor.class_level[c.id] maxlevel = S_B::CLASS::CLASS_MAX_LEVELS[c.id] maxlevel = S_B::CLASS::MAX_CLASS_LEVEL_DEFAULT if maxlevel == nil unless level == maxlevel self.contents.font.color = system_color self.contents.draw_text(x, y, w - 30, WLH, "(#{Vocab::level_a}.") self.contents.draw_text(x, y, w, WLH, "#{level.to_s})", 2) end end #-------------------------------------------------------------------------- alias job_draw_actor_class draw_actor_class unless $@ #-------------------------------------------------------------------------- def draw_actor_class(actor, x, y) i = actor.class_id c = $data_classes[i] level = actor.class_level[c.id] maxlevel = S_B::CLASS::CLASS_MAX_LEVELS[c.id] maxlevel = S_B::CLASS::MAX_CLASS_LEVEL_DEFAULT if maxlevel == nil if level == maxlevel w = x + 108 draw_icon(S_B::CLASS::MASTERED_ICON, x, y, enabled = true) job_draw_actor_class(actor, x + 24, y) else job_draw_actor_class(actor, x, y) end end #-------------------------------------------------------------------------- # * Draw Class Experience #-------------------------------------------------------------------------- def draw_jp_exp(actor, x, y) w = self.contents.width i = actor.class_id c = $data_classes[i] level = actor.class_level[c.id] maxlevel = S_B::CLASS::CLASS_MAX_LEVELS[c.id] maxlevel = S_B::CLASS::MAX_CLASS_LEVEL_DEFAULT if maxlevel == nil unless level == maxlevel s1 = actor.jp_exp_s(c.id) s2 = actor.next_class_rest_exp_s(c.id) s_next = "#{Vocab.jp_a} manquant" self.contents.font.color = system_color self.contents.draw_text(x, y, w, WLH, Vocab.jp) self.contents.draw_text(x, y + WLH, w, WLH, s_next) self.contents.font.color = normal_color self.contents.draw_text(x, y, w, WLH, s1, 2) self.contents.draw_text(x, y + WLH, w, WLH, s2, 2) end end end #=============================================================================== # ■ Scene_Title #=============================================================================== class Scene_Title < Scene_Base #-------------------------------------------------------------------------- # ● Create various game objects #-------------------------------------------------------------------------- alias job_create_game_objects create_game_objects unless $@ def create_game_objects job_create_game_objects unless S_B::CLASS::MENU_CLASS_CHANGE_OPTION $game_switches[S_B::CLASS::DISABLE_CLASS] = true $game_switches[S_B::CLASS::HIDE_CLASS] = true end end end #=============================================================================== # ■ Game_Party #=============================================================================== class Game_Party #-------------------------------------------------------------------------- def jobchange_enable? if $game_switches[S_B::CLASS::DISABLE_CLASS] return false else return true end end end
#============================================================================== # ** Game_Troop (addon) *from yanfly #============================================================================== class Game_Troop < Game_Unit attr_accessor :jp_total #-------------------------------------------------------------------------- def jp_total jp = 0 if S_B::CLASS::ENEMIES_GIVE_JP for enemy in dead_members jp += enemy.enemy.enemy_jp unless enemy.hidden end end return jp end end #============================================================================== # Game_Battler *from yanfly #============================================================================== class Game_Battler attr_accessor :jp_counter #-------------------------------------------------------------------------- # perform gain_jp #-------------------------------------------------------------------------- def gain_jp_battle(amount) return unless self.actor? jp = amount for state in states jp *= state.bonus_jp_per jp /= 100 end for state in states jp += state.bonus_jp_set end if double_exp_gain jp *= 2 end self.jp_counter += jp if $scene.is_a?(Scene_Battle) end #-------------------------------------------------------------------------- # jp counter #-------------------------------------------------------------------------- def jp_counter @jp_counter = 0 if @jp_counter == nil return @jp_counter end def jp_counter=(newvalue) @jp_counter = 0 if @jp_counter == nil @jp_counter = newvalue end #-------------------------------------------------------------------------- # alias attack effect #-------------------------------------------------------------------------- alias attack_effect_sss attack_effect unless $@ def attack_effect(attacker) attack_effect_sss(attacker) return unless attacker.actor? return unless S_B::CLASS::USE_BONUS_JP return unless S_B::CLASS::EARN_JP_VIA_ATTACK_ENABLE amount = S_B::CLASS::EARN_JP_VIA_ATTACK_AMOUNT unless S_B::CLASS::EARN_JP_VIA_ATTACK_RANDOM == 0 amount += rand(S_B::CLASS::EARN_JP_VIA_ATTACK_RANDOM) end attacker.gain_jp_battle(amount) end #-------------------------------------------------------------------------- # alias skill effect #-------------------------------------------------------------------------- alias skill_effect_sss skill_effect unless $@ def skill_effect(user, skill) skill_effect_sss(user, skill) return unless user.actor? return unless S_B::CLASS::USE_BONUS_JP return unless S_B::CLASS::EARN_JP_VIA_SKILL_ENABLE return unless $scene.is_a?(Scene_Battle) amount = S_B::CLASS::EARN_JP_VIA_SKILL_AMOUNT unless S_B::CLASS::EARN_JP_VIA_SKILL_RANDOM == 0 amount += rand(S_B::CLASS::EARN_JP_VIA_SKILL_RANDOM) end amount += skill.jp_boost_set unless skill.jp_boost_set <= 0 jp += rand(skill.jp_boost_ran) unless skill.jp_boost_ran <= 0 user.gain_jp_battle(amount) end #-------------------------------------------------------------------------- # alias item effect #-------------------------------------------------------------------------- alias item_effect_sss item_effect unless $@ def item_effect(user, item) item_effect_sss(user, item) return unless user.actor? user.jp_received(item.gain_jp, nil, true) #---------------------------------- if item.unlock_class != [] for class_id in item.unlock_class user.unlock_class(class_id) end end if item.lock_class != [] for class_id in item.lock_class user.lock_class(class_id) end end #---------------------------------- return unless S_B::CLASS::USE_BONUS_JP return unless S_B::CLASS::EARN_JP_VIA_ITEMS_ENABLE return unless $scene.is_a?(Scene_Battle) amount = S_B::CLASS::EARN_JP_VIA_ITEMS_AMOUNT unless S_B::CLASS::EARN_JP_VIA_ITEMS_RANDOM == 0 amount += rand(S_B::CLASS::EARN_JP_VIA_ITEMS_RANDOM) end user.gain_jp_battle(amount) end #-------------------------------------------------------------------------- # alias item test #-------------------------------------------------------------------------- alias item_test_sss item_test unless $@ def item_test(user, item) if self.actor? return true if item.unlock_class != [] return true if item.lock_class != [] return true if item.gain_jp > 0 end return item_test_sss(user, item) end end #============================================================================== # ** Scene_Battle (addon) *from yanfly #============================================================================== class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # alias process_battle_start #-------------------------------------------------------------------------- alias process_battle_start_sss process_battle_start unless $@ def process_battle_start for actor in $game_party.members actor.jp_counter = 0 end process_battle_start_sss end #-------------------------------------------------------------------------- # alias execute_action_guard #-------------------------------------------------------------------------- alias execute_action_guard_sss execute_action_guard unless $@ def execute_action_guard execute_action_guard_sss return unless @active_battler.actor? return unless S_B::CLASS::USE_BONUS_JP return unless S_B::CLASS::EARN_JP_VIA_GUARD_ENABLE amount = S_B::CLASS::EARN_JP_VIA_GUARD_AMOUNT unless S_B::CLASS::EARN_JP_VIA_GUARD_RANDOM == 0 amount += rand(S_B::CLASS::EARN_JP_VIA_GUARD_RANDOM) end @active_battler.gain_jp_battle(amount) end
alias job_display_exp_and_gold display_exp_and_gold unless $@ def display_exp_and_gold @ignore_wait_for_message = true # call the original code
job_display_exp_and_gold
display_JP @ignore_wait_for_message = false wait_for_message end #-------------------------------------------------------------------------- def display_JP jp = 0 jp = $game_troop.jp_total if S_B::CLASS::ENEMIES_GIVE_JP if jp > 0 text = sprintf(Vocab::ObtainClassExp, jp) $game_message.texts.push('\.' + text) end for actor in $game_party.existing_members jp = 0 jp = $game_troop.jp_total if S_B::CLASS::ENEMIES_GIVE_JP
unless $imported["battleresults"] if S_B::CLASS::USE_BONUS_JP && S_B::CLASS::DISPLAY_BONUS_JP i = actor.class_id c = $data_classes[i] maxlevel = S_B::CLASS::CLASS_MAX_LEVELS[c.id] maxlevel = S_B::CLASS::MAX_CLASS_LEVEL_DEFAULT if maxlevel == nil if actor.jp_counter > 0 && actor.class_level != maxlevel text = sprintf(Vocab::Display_Actor_Msg, actor.name, actor.jp_counter) $game_message.texts.push('\>' + text) end end end if actor.double_exp_gain jp *= 2 end for state in actor.states jp *= state.bonus_jp_per jp /= 100 end for state in actor.states jp += state.bonus_jp_set end jp = jp + actor.jp_counter if S_B::CLASS::USE_BONUS_JP last_level = actor.class_level last_skills = actor.skills actor.jp_received(jp, nil, true) end end end #============================================================================== # ** Scene_Job (new) *from prexus #============================================================================== class Scene_Job < Scene_Base #-------------------------------------------------------------------------- def initialize(actor_index = 0, menu_index = 0) @menu_index = menu_index @actor_index = actor_index end #-------------------------------------------------------------------------- def start @actor = $game_party.members[@actor_index] create_menu_background create_windows @classlist_window.refresh end #-------------------------------------------------------------------------- def create_windows @classlist_window = Window_ClassPick.new(@actor) @classchange_window = Window_Class_Change.new(@actor) @skills_window = Window_ShowSkills.new(@actor) @help_window = Window_Help.new @help_window.visible = false @help_window.close @help_window2 = Window_Help.new @classchange_window.x = 0 @classlist_window.y = @classchange_window.y = @help_window2.height @classchange_window.width = @classlist_window.width = Graphics.width / 2 @classlist_window.x = @classchange_window.width @classlist_window.height = @classchange_window.height = Graphics.height - @help_window2.height @classlist_window.index = 0 @help_window.width = 448 @help_window.x = @skills_window.x = (Graphics.width - @help_window.width)/2 @help_window.y = 280 @help_window.create_contents @skills_window.help_window = @help_window @skills_window.help_window.back_opacity = 255 @confirm_window = Window_Confirm.new end #-------------------------------------------------------------------------- def update_windows @classlist_window.update(@actor) @classchange_window.update @skills_window.update @help_window.update @help_window2.update @confirm_window.update if @classlist_window.active @classchange_window.set(@actor, @classlist_window.item) id = @classlist_window.item.id if S_B::CLASS::Class_Descriptions.include?(id) @help_window2.set_text(S_B::CLASS::Class_Descriptions[id][0]) else @help_window2.set_text("") end end end
tontonjif
Poulet trizo Lv.3
Age : 42 Inscrit le : 20/10/2011 Messages : 30
Sujet: Re: probleme avec JobChanger for VX, by Blackmorning Mer 25 Juil 2012 - 16:33
Citation :
#-------------------------------------------------------------------------- def terminate super @classlist_window.dispose if @classlist_window != nil @classchange_window.dispose if @classchange_window != nil @skills_window.dispose if @skills_window != nil @help_window.dispose if @help_window != nil @help_window2.dispose if @help_window2 != nil @confirm_window.dispose if @confirm_window != nil end #-------------------------------------------------------------------------- def update super update_menu_background update_windows if @classlist_window.active update_class_list elsif @skills_window.active update_skills_list elsif @confirm_window.active update_confirm_window end end #-------------------------------------------------------------------------- # * Switch to Next Actor Screen #-------------------------------------------------------------------------- def next_actor @actor_index += 1 @actor_index %= $game_party.members.size $scene = Scene_Job.new(@actor_index, @menu_index) end #-------------------------------------------------------------------------- # * Switch to Previous Actor Screen #-------------------------------------------------------------------------- def prev_actor @actor_index += $game_party.members.size - 1 @actor_index %= $game_party.members.size $scene = Scene_Job.new(@actor_index, @menu_index) end #-------------------------------------------------------------------------- # * Return to previous scene #-------------------------------------------------------------------------- def return_scene if $imported["SceneStatusReDux"] and $game_temp.status_menu_flag $scene = Scene_Status.new(@actor_index, $game_temp.status_menu_index) elsif @menu_index == 0 $scene = Scene_Map.new else $scene = Scene_Menu.new(@menu_index) end end #-------------------------------------------------------------------------- def update_class_list if Input.trigger?(Input::B) Sound.play_cancel return_scene elsif Input.trigger?(Input::C) if @classlist_window.item.id == @classlist_window.actor.class_id Sound.play_buzzer return end Sound.play_decision @confirm_window.visible = true @confirm_window.active = true @confirm_window.index = 0 @confirm_window.open @classlist_window.active = false elsif Input.trigger?(S_B::CLASS::SHOW_SKILLS_WINDOW) Sound.play_decision @skills_window.set(@actor, @classlist_window.item.id) @skills_window.active = true @skills_window.index = 0 @skills_window.open @help_window.visible = true @help_window.open @classlist_window.active = false elsif Input.trigger?(Input::R) or Input.trigger?(Input::RIGHT) Sound.play_cursor next_actor elsif Input.trigger?(Input::L) or Input.trigger?(Input::LEFT) Sound.play_cursor prev_actor end end def update_skills_list if Input.trigger?(Input::B) Sound.play_cancel @classlist_window.active = true @skills_window.active = false @skills_window.index = -1 @skills_window.close @help_window.close end end def update_confirm_window if Input.trigger?(Input::B) Sound.play_cancel if @confirm_window.index == 1 @confirm_window.active = false @confirm_window.index = -1 @confirm_window.close @classlist_window.active = true return else @confirm_window.index = 1 return end elsif Input.trigger?(Input::C) case @confirm_window.index when 0 Sound.play_decision actor = @classlist_window.actor actor.class_id = @classlist_window.item.id #Check to make sure that if @actor.hp > @actor.maxhp @actor.hp = @actor.maxhp end if @actor.mp > @actor.maxmp @actor.mp = @actor.maxmp end @confirm_window.active = false @confirm_window.index = -1 @confirm_window.close @classlist_window.refresh @classchange_window.refresh @classlist_window.active = true when 1 @confirm_window.active = false @confirm_window.index = -1 @confirm_window.close @classlist_window.active = true return end end end end
#============================================================================== # ** Window_ClassPick # window where selectable class list is generated #============================================================================== class Window_ClassPick < Window_Selectable #-------------------------------------------------------------------------- def initialize(actor) super(Graphics.width / 2, 48, Graphics.width / 2, Graphics.height - (WLH + 32)) create_contents @actor = actor self.index = 0 self.active = true refresh end #-------------------------------------------------------------------------- def update(actor = nil) super() return if actor == @actor @actor = actor refresh end #-------------------------------------------------------------------------- def actor return @actor end #-------------------------------------------------------------------------- def item return $data_classes[@actor.unlocked_classes[index]] end #-------------------------------------------------------------------------- # refresh #-------------------------------------------------------------------------- def refresh @data = [] for class_id in @actor.unlocked_classes @data.push(class_id) end @item_max = @data.size create_contents for i in 0...@item_max draw_item(i) end end #-------------------------------------------------------------------------- # draw item #-------------------------------------------------------------------------- def draw_item(index) rect = item_rect(index) self.contents.clear_rect(rect) iclass = $data_classes[@actor.unlocked_classes[index]] if iclass.id != 0 rect.width -= 4 enabled = true enabled = false if iclass == @actor.class level = @actor.class_level[iclass.id] maxlevel = S_B::CLASS::CLASS_MAX_LEVELS[iclass.id] maxlevel = S_B::CLASS::MAX_CLASS_LEVEL_DEFAULT if maxlevel == nil if level == maxlevel icon = S_B::CLASS::MASTERED_ICON elsif S_B::CLASS::USE_ICONS_FOR_CLASSES if S_B::CLASS::Class_Icons.include?(iclass.id) icon = S_B::CLASS::Class_Icons[iclass.id] else icon = S_B::CLASS::Class_Icons[0] end end draw_icon(icon, rect.x, rect.y, enabled) dx = rect.x dy = rect.y dw = rect.width dh = rect.height self.contents.font.color.alpha = enabled ? 255 : 128 self.contents.draw_text(dx+24, dy, dw-48, dh, iclass.name, 0) unless !S_B::CLASS::USE_BONUS_JP && !S_B::CLASS::ENEMIES_GIVE_JP self.contents.draw_text(dx, dy, dw, dh, "Lv. " + level.to_s, 2) end end end end #============================================================================== # ** Window_Class_Change #============================================================================== class Window_Class_Change < Window_Base #-------------------------------------------------------------------------- def initialize(actor = nil, class_obj = nil) super(0, 48, Graphics.width / 2, Graphics.height - (WLH + 32)) create_contents @actor = actor @class_obj = class_obj refresh end #-------------------------------------------------------------------------- def actor return @actor end #-------------------------------------------------------------------------- def item return @class_obj end #-------------------------------------------------------------------------- def set(actor, class_obj) old_actor = @actor @actor = actor old_class_obj = @class_obj @class_obj = class_obj refresh if (old_actor != @actor) or (old_class_obj != @class_obj) end #-------------------------------------------------------------------------- def refresh self.contents.clear
return unless @actor c = (@class_obj != nil ? @class_obj : $data_classes[@actor.class_id]) x, y = 0, 0 w = self.contents.width hy = self.contents.height - WLH * 4 self.draw_actor_face(@actor, x + 2, y + 2)
draw_basic_info(112, 0) self.contents.font.color = system_color self.contents.draw_text(x, hy + WLH * 0, w, WLH, "Classe:") unless !S_B::CLASS::USE_BONUS_JP && !S_B::CLASS::ENEMIES_GIVE_JP self.contents.draw_text(x, hy + WLH * 1, w, WLH, "Classe #{Vocab::level_a}:") s_next = ("#{Vocab.jp} manquant:") self.contents.draw_text(x, hy + WLH * 2, w, WLH, Vocab.jp) self.contents.draw_text(x, hy + WLH * 3, w, WLH, s_next) end dy = WLH * 4
y1 = (hy - dy - 80)/2 y = y1 + dy
draw_parameters(x, y)
return unless @class_obj self.contents.font.color = normal_color self.contents.draw_text(x, hy + WLH * 0, w, WLH, c.name,2) maxlevel = S_B::CLASS::CLASS_MAX_LEVELS[c.id] maxlevel = S_B::CLASS::MAX_CLASS_LEVEL_DEFAULT if maxlevel == nil s1 = @actor.jp_exp_s(c.id) s2 = @actor.next_class_rest_exp_s(c.id) if @actor.class_level[c.id] == maxlevel draw_icon(S_B::CLASS::MASTERED_ICON, w - 24, hy + WLH * 1, enabled = true) self.contents.font.color = normal_color self.contents.draw_text(x, hy + WLH * 1, w - 24, WLH, "Mastered",2) else unless !S_B::CLASS::USE_BONUS_JP && !S_B::CLASS::ENEMIES_GIVE_JP self.contents.draw_text(x, hy + WLH * 1, w, WLH, @actor.class_level[c.id], 2) self.contents.font.color = normal_color end end self.contents.draw_text(x, hy + WLH * 2, w, WLH, s1, 2) self.contents.draw_text(x, hy + WLH * 3, w, WLH, s2, 2) end
def draw_basic_info(x, y) w = self.contents.width self.contents.font.color = system_color self.contents.draw_text(x, y + WLH * 0, w, WLH, "Nom:") self.contents.font.color = normal_color self.contents.draw_text(x, y + WLH * 1, w - 112, WLH, actor.name, 2) self.contents.font.color = system_color self.contents.draw_text(x, y + WLH * 2, w, WLH, "Classe actuelle:") self.contents.font.color = normal_color self.contents.draw_text(x, y + WLH * 3, w - 112, WLH, actor.class.name, 2) self.draw_actor_level(@actor, x - 112, y + WLH * 4) self.draw_icon(S_B::CLASS::Skills_Icon, w - 24, y + WLH * 4) self.contents.font.color = system_color self.contents.draw_text(x - 112, y + WLH * 4, w - 24, WLH, 'Compétences', 2) end
def draw_parameters(x, y) last_font_size = self.contents.font.size if $imported["BattlerStatRES"] || $imported["BattlerStatDEX"] || $imported["RES Stat"] || $imported["DEX Stat"] self.contents.font.size = 13 a = 13 else self.contents.font.size = 15 a = 15 end draw_parameter(x, y + a * 0, 0) draw_parameter(x, y + a * 1, 1) draw_parameter(x, y + a * 2, 2) draw_parameter(x, y + a * 3, 3) draw_parameter(x, y + a * 4, 4) draw_parameter(x, y + a * 5, 5) b = 0 draw_parameter(x, y + a * 6, 6) if $imported["BattlerStatRES"] or $imported["RES Stat"] b = 13 if $imported["BattlerStatRES"] or $imported["RES Stat"] draw_parameter(x, y + a * 6 + b, 7) if $imported["BattlerStatDEX"] or $imported["DEX Stat"] self.contents.font.size = last_font_size end #-------------------------------------------------------------------------- # * Draw Parameters #-------------------------------------------------------------------------- def draw_parameter(x, y, type) c = (@class_obj != nil ? @class_obj : $data_classes[@actor.class_id]) case type when 0 name = Vocab::hp_a value = @actor.maxhp when 1 name = Vocab::mp_a value = @actor.maxmp when 2 name = Vocab::atk value = @actor.atk when 3 name = Vocab::def value = @actor.def when 4 name = Vocab::spi value = @actor.spi when 5 name = Vocab::agi value = @actor.agi when 6 name = "RES" value = @actor.res when 7 name = "DEX" value = @actor.dex end old = @actor.base_stat_class(type) if @class_obj new = @actor.base_stat_class(type, c.id) new_value = value - old + new difference = new - old if difference > 0 difference = "+ #{new - old}" end end self.contents.font.color = system_color self.contents.draw_text(x + 26, y, 80, WLH, name) self.contents.font.color = normal_color self.contents.draw_text(x + 70, y, 30, WLH, value, 2) self.contents.font.color = system_color self.contents.draw_text(x + 122, y, 20, WLH, "-->", 1) if new_value != nil self.contents.font.color = new_parameter_color(value, new_value) if S_B::CLASS::SHOW_DIFFERENCE if difference == 0 self.contents.draw_text(x + 152, y, 30, WLH, "---", 2) else self.contents.draw_text(x + 152, y, 30, WLH, difference, 2) end else self.contents.draw_text(x + 152, y, 30, WLH, new_value, 2) end end end
def new_parameter_color(old_value, new_value) if new_value > old_value # Get stronger return power_up_color elsif new_value == old_value # No change return normal_color else # Get weaker return power_down_color end end end #============================================================================== # ** Window_ShowSkills #============================================================================== class Window_ShowSkills < Window_Selectable #-------------------------------------------------------------------------- def initialize(actor, class_id = nil) super(48, 80, 448, 200) @actor = actor @class_id = (class_id != nil ? class_id : @actor.class_id) @item_max = $data_classes[@class_id].learnings.size @column_max = 3 create_contents self.index = -1 self.active = false self.openness = 0 self.back_opacity = 255 refresh end #-------------------------------------------------------------------------- def set(actor, class_id) old_actor = @actor @actor = actor old_class_id = @class_id @class_id = class_id @item_max = $data_classes[@class_id].learnings.size unless @class_id == nil create_contents refresh end #-------------------------------------------------------------------------- def refresh return if @class_id == nil return if $data_classes[@class_id].learnings.empty? for i in 0...@item_max rect = item_rect(i) learning = $data_classes[@class_id].learnings[i] next unless learning self.contents.font.color.alpha = (@actor.class_level[@class_id] >= learning.level ? 255 : 128) self.contents.draw_text(rect, $data_skills[learning.skill_id].name) end end #-------------------------------------------------------------------------- def update_help if $data_classes[@class_id].learnings.empty? self.help_window.set_text('') return end level = $data_classes[@class_id].learnings[self.index].level skill = $data_skills[$data_classes[@class_id].learnings[self.index].skill_id] self.help_window.set_text(skill == nil ? '' : "[Level #{level}] #{skill.description}") end end #============================================================================== # ** Window_Confirm #============================================================================== class Window_Confirm < Window_Selectable #-------------------------------------------------------------------------- def initialize(index = -1) dx = (Graphics.width - 160)/2 super(dx, 168, 160, 80) create_contents @item_max = 2 @column_max = 2 self.index = index self.active = false self.openness = 0 refresh end #-------------------------------------------------------------------------- def refresh for i in 0..@item_max rect = item_rect(i) self.contents.clear_rect(rect) end self.contents.draw_text(0, 0, self.contents.width, WLH, "Confirmer?", 1) rect = item_rect(0) self.contents.draw_text(rect, "Oui", 1) rect = item_rect(1) self.contents.draw_text(rect, "Non", 1) end #-------------------------------------------------------------------------- def item_rect(index) rect = Rect.new(0, 0, 0, 0) rect.width = (contents.width + @spacing) / @column_max - @spacing rect.height = WLH rect.x = index % @column_max * (rect.width + @spacing) rect.y = (index / @column_max * WLH) + WLH return rect end end #============================================================================== # ** Character_Class #============================================================================== class Character_Class def self.new_class(actor, class_id) $game_actors[actor].unlock_class(class_id) end #-------------------------------------------------------------------------- def self.remove_class(actor, class_id) $game_actors[actor].lock_class(class_id) end end
#============================================================================== # Window_Command (imported from KGC) #==============================================================================
class Window_Command < Window_Selectable unless method_defined?(:add_command) #-------------------------------------------------------------------------- # add command #-------------------------------------------------------------------------- def add_command(command) @commands << command @item_max = @commands.size item_index = @item_max - 1 refresh_command draw_item(item_index) return item_index end #-------------------------------------------------------------------------- # refresh command #-------------------------------------------------------------------------- def refresh_command buf = self.contents.clone self.height = [self.height, row_max * WLH + 32].max create_contents self.contents.blt(0, 0, buf, buf.rect) buf.dispose end #-------------------------------------------------------------------------- # insert command #-------------------------------------------------------------------------- def insert_command(index, command) @commands.insert(index, command) @item_max = @commands.size refresh_command refresh end #-------------------------------------------------------------------------- # remove command #-------------------------------------------------------------------------- def remove_command(command) @commands.delete(command) @item_max = @commands.size refresh end end end #=============================================================================== # Scene Menu #=============================================================================== class Scene_Menu < Scene_Base #-------------------------------------------------------------------------- # alias create command window #-------------------------------------------------------------------------- alias create_command_window_sss create_command_window unless $@ def create_command_window create_command_window_sss return if $imported["CustomMenuCommand"] return if $game_switches[S_B::CLASS::HIDE_CLASS] if S_B::CLASS::MENU_CLASS_CHANGE_OPTION || $game_party.jobchange_enable? scc_text = Vocab::Classes_Vocab @command_class_change = @command_window.add_command(scc_text) @command_window.draw_item(@command_class_change, $game_party.jobchange_enable?) if @command_window.oy > 0 @command_window.oy -= Window_Base::WLH end end @command_window.index = @menu_index end #-------------------------------------------------------------------------- # alias update command selection #-------------------------------------------------------------------------- alias update_command_selection_sss update_command_selection unless $@ def update_command_selection call_job_command = 0 if Input.trigger?(Input::C) case @command_window.index when @command_class_change call_job_command = 1 end end if call_job_command == 1 if $game_party.members.size == 0 || !$game_party.jobchange_enable? Sound.play_buzzer return end Sound.play_decision start_actor_selection return end update_command_selection_sss end
#-------------------------------------------------------------------------- # alias update actor selection #-------------------------------------------------------------------------- alias update_actor_selection_sss update_actor_selection unless $@ def update_actor_selection if Input.trigger?(Input::C) $game_party.last_actor_index = @status_window.index Sound.play_decision case @command_window.index when @command_class_change $scene = Scene_Job.new(@status_window.index, @command_class_change) return end end update_actor_selection_sss end
end # Scene Menu if S_B::CLASS::SHOW_CLASS_LVL_STATUS && (S_B::CLASS::USE_BONUS_JP || S_B::CLASS::ENEMIES_GIVE_JP) #============================================================================== # ** Window_MenuStatus #============================================================================== class Window_Status < Window_Base def draw_actor_class(actor, x, y) i = actor.class_id c = $data_classes[i] level = actor.class_level[c.id] maxlevel = S_B::CLASS::CLASS_MAX_LEVELS[c.id] maxlevel = S_B::CLASS::MAX_CLASS_LEVEL_DEFAULT if maxlevel == nil if level == maxlevel w = x + 108 draw_icon(S_B::CLASS::MASTERED_ICON, x, y, true) job_draw_actor_class(actor, x + 24, y) else job_draw_actor_class(actor, x + 60, y) draw_class_level(actor, x, y) end end end class Window_Status_Actor < Window_Base def draw_actor_class(actor, x, y) i = actor.class_id c = $data_classes[i] level = actor.class_level[c.id] maxlevel = S_B::CLASS::CLASS_MAX_LEVELS[c.id] maxlevel = S_B::CLASS::MAX_CLASS_LEVEL_DEFAULT if maxlevel == nil if level == maxlevel w = x + 108 draw_icon(S_B::CLASS::MASTERED_ICON, x, y, true) job_draw_actor_class(actor, x + 24, y) else job_draw_actor_class(actor, x + 60, y) draw_class_level(actor, x, y) end end end end if S_B::CLASS::SHOW_CLASS_LVL_MAIN && (S_B::CLASS::USE_BONUS_JP || S_B::CLASS::ENEMIES_GIVE_JP) class Window_MenuStatus < Window_Selectable def draw_actor_class(actor, x, y) i = actor.class_id c = $data_classes[i] level = actor.class_level[c.id] maxlevel = S_B::CLASS::CLASS_MAX_LEVELS[c.id] maxlevel = S_B::CLASS::MAX_CLASS_LEVEL_DEFAULT if maxlevel == nil if level == maxlevel w = x + 108 draw_icon(S_B::CLASS::MASTERED_ICON, x, y, true) job_draw_actor_class(actor, x + 24, y) else self.contents.font.color = normal_color self.contents.draw_text(x + 40, y, 108 - 20, WLH, actor.class.name) draw_class_level(actor, x - 20, y) end end end end
Ice Monkey
Templier Lv.15
Age : 26 Inscrit le : 30/01/2011 Messages : 1273
Sujet: Re: probleme avec JobChanger for VX, by Blackmorning Mer 25 Juil 2012 - 16:54
Arg met en balise
Code:
[code][/code]
Sinon je ne sais pas si c'est toi qui as fait une erreur en copie collant mais regarde :
Code:
Ne touchez pas, toutes les personnalisations peuvent être faites dans le scénario ci-dessus. #=============================================================================== module S_B::CLASS module_function def permit_jobchange(enabled = true) if enabled $game_switches[S_B::CLASS::DISABLE_CLASS] = false else $game_switches[S_B::CLASS::DISABLE_CLASS] = true end end
Il manque un # devant cette ligne :
Code:
Ne touchez pas, toutes les personnalisations peuvent être faites dans le scénario ci-dessus.
Donc remplace cette ligne par
Code:
#Ne touchez pas, toutes les personnalisations peuvent être faites dans le scénario ci-dessus.
Et dis moi si ça marche. Sinon je verrais s'il y manque un end quelque part.
tontonjif
Poulet trizo Lv.3
Age : 42 Inscrit le : 20/10/2011 Messages : 30
Sujet: Re: probleme avec JobChanger for VX, by Blackmorning Mer 25 Juil 2012 - 17:14
le # était là c'est moi qui a du mal collé
tontonjif
Poulet trizo Lv.3
Age : 42 Inscrit le : 20/10/2011 Messages : 30
Sujet: Re: probleme avec JobChanger for VX, by Blackmorning Ven 27 Juil 2012 - 12:32
Bon je viens d'essayer le script dans un projet vierge pour verifier d'éventuelle incompatibilité avec d'autre script
donc je ne peut toujours pas monter de niveau n'importe quelle classe du perso n°8 avec la commande $game_actors[008] .class_level_up (11) alors que cette commande marche pour les persos 1 à 7.
Mais en regardant de plus prés la démo, j'ai trouver une autre commande qui a à peu prés la même fonction et qui fonctionne $game_actors[8].jp_received(1000, 11)
Zangther
Maître des Duels
Age : 32 Inscrit le : 29/07/2009 Messages : 7841
Sujet: Re: probleme avec JobChanger for VX, by Blackmorning Ven 27 Juil 2012 - 12:38
T'es sur que le script est bien complet ?
tontonjif
Poulet trizo Lv.3
Age : 42 Inscrit le : 20/10/2011 Messages : 30
Sujet: Re: probleme avec JobChanger for VX, by Blackmorning Sam 28 Juil 2012 - 8:03
J'ai vérifier avec la demo, et il font bien le meme nombre de ligne
Zangther
Maître des Duels
Age : 32 Inscrit le : 29/07/2009 Messages : 7841
Sujet: Re: probleme avec JobChanger for VX, by Blackmorning Sam 28 Juil 2012 - 8:17
Sur la démo ça marche ?
tontonjif
Poulet trizo Lv.3
Age : 42 Inscrit le : 20/10/2011 Messages : 30
Sujet: Re: probleme avec JobChanger for VX, by Blackmorning Dim 29 Juil 2012 - 8:25
effectivement même sur la demo cela ne marche pas.
Contenu sponsorisé
Sujet: Re: probleme avec JobChanger for VX, by Blackmorning