khanhdu

[RPGVXACE] CharacterCreationDemo ( Chức Chọn Nhân Vật )

Aug 6th, 2018
640
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 24.45 KB | None | 0 0
  1. =begin
  2.  
  3.  Minor changes used to build the demo. Please ignore
  4.  
  5. =end
  6. class Scene_Title < Scene_Base
  7.   def draw_game_title
  8.     @foreground_sprite.bitmap.font.size = 48
  9.     rect = Rect.new(0, -25, Graphics.width, Graphics.height / 2)
  10.     txt = $data_system.game_title.split("  ")
  11.     for t in txt
  12.       @foreground_sprite.bitmap.draw_text(rect, t, 1)
  13.       rect.y+=50
  14.     end
  15.   end
  16. end
  17.  
  18. class Window_NameInput < Window_Selectable
  19.   def table
  20.     return [LATIN1, LATIN2]
  21.   end
  22. end
  23.  
  24. class CharConfig
  25. attr_accessor :Races
  26. attr_accessor :RaceAppearanceNames
  27. attr_accessor :RaceFaceImage
  28. attr_accessor :RaceFaceIndex
  29. attr_accessor :RaceChara
  30. attr_accessor :RaceIndex
  31. attr_accessor :GenderVar
  32. attr_accessor :RaceDescription
  33. attr_accessor :ClassList
  34. attr_accessor :AppearanceVariable
  35. attr_accessor :RaceVariable
  36. def initialize
  37.   @Races = Array.new
  38.   @RaceAppearanceNames = Array.new
  39.   @RaceFaceImage = Array.new
  40.   @RaceFaceIndex = Array.new
  41.   @RaceChara = Array.new
  42.   @RaceIndex = Array.new
  43.   @GenderVar = Array.new
  44.   @RaceDescription = Array.new
  45.   @ClassList = Array.new
  46. #############CONFIG######################
  47. #Here list all the names of all races in the game
  48. # Example:
  49. # Races = ["Human","Elf","Dwarf"]
  50. # Creates three races, called Human, Elf and Dwarf
  51. @Races = ["Hiệp Sĩ ","Pháp Sư","Cung Thủ","Ninja"]
  52.  
  53. Font.default_name = ["UTM DaxBold"] # Edit as you see fit.
  54. Font.default_size = 18# Edit as you see fit.
  55. Font.default_bold      = true
  56.  
  57. #Which race the player chooses will be stored in a variable, which is defined
  58. #below. This can be used later create effects that only affect, say, Dwarves,
  59. #such as giving them the ability to use heavy armour, regardless of class.
  60. #This can be acheived by having an event check that variable, then run actions
  61. #accordingly
  62. @RaceVariable = 25
  63.  
  64. #Additionally a variable can store information depending on the appearance of the
  65. #character. This can be used so that events can check information related to the
  66. #appearance, such as gender.
  67. @AppearanceVariable = 26
  68. #The default is to store the Race in variable 25. By default this will mean that
  69. #if the player is human that varible will be 1, 2 if an elf, and 3 if a dwarf.
  70. #
  71. #Then we need to do some setup for each race
  72. #Example:
  73. #RaceAppearanceNames << ["Female","Male"]
  74. #RaceFaceImage << ["Actor3.png","Actor3.png"]
  75. #RaceFaceIndex << [6,5]
  76. #RaceChara << ["Actor3.png","Actor3.png"]
  77. #RaceIndex << [6,5]
  78. #GenderVar << [1,0]
  79. #ClassList << [6,-1,2,-4]
  80. #RaceDescription <<
  81. #["Industrious and smart, although most
  82. #lead mundane lives, among Humanity walk
  83. #the most powerful mages and warrior
  84. #on this earth."]
  85. #
  86. #The first row shows that the first race we typed in at the start has two
  87. #different Appearances. One called Female, one called Male.
  88. #
  89. #The second row shows the File name for that appearances face. So both Male and
  90. #Female humans use Actor1.png
  91. #The third row shows which face in the file to use, as each image has 8 faces,
  92. #so female humans use the first face in the Actor1.png Image, and Males use the
  93. #second image.
  94. #
  95. #The fourth and fifth line work like the Faces, appart from for defining the
  96. #Character image that is seen walking around the screen. In the example above
  97. #both Male and Female humans have characters to match their faces.
  98. #
  99. #The 6th line is used to set the Appearance variable. In this case having the
  100. #"Male" apperance will set the Appearance variable (Default 26) to 0, while the
  101. #"Female" will set it to 1. This way you can have NPCs react depending on Gender
  102. #
  103. #The seventh line lists all classes, in order, that that class can take.
  104. #Listing a class as negitive (I.e. -3) will mean that it is listed, but you cannot
  105. #select it. This can be used to clearly show what class can and cannot take certain
  106. #classes, but without confusing the player by hiding information
  107. #
  108. #Finally we have a description for the race. This is at max four lines, and each line
  109. #should not be longer than the in the example Races.
  110. #
  111. #For each race you defined at the start, copy paste these lines, and customize
  112. #as you wish.
  113.  
  114. #Race 1:
  115. @RaceAppearanceNames << ["    Gro","    Ken","    Yumi","    Nu"]
  116. @RaceFaceImage << ["Actor7.png","Actor9.png","Actor20.png","Actor25.png"]
  117. @RaceFaceIndex << [1,2,3,4]
  118. @RaceChara << ["$Actor7.png","$Actor9.png","$Actor20.png","$Actor_etc6.png"]
  119. @RaceIndex << [1,1,1,1]
  120. @GenderVar << [0,1,0,1]
  121. @ClassList << [1,2,3,4,5]
  122. @RaceDescription <<
  123. ["Hiệp sĩ Là người sẽ đem lại công lý cho
  124. người dân hoặc có khi họ là những người luôn
  125. phục vụ cho chủ nhân của họ và hi sinh cả
  126. tính mạng."]
  127. #Race 2:
  128. @RaceAppearanceNames << ["     Sakura","     Meta IU"]
  129. @RaceFaceImage << ["Actor95.png","Actor103.png"]
  130. @RaceFaceIndex << [6,5]
  131. @RaceChara << ["$Actor95.png","$Actor103.png"]
  132. @RaceIndex << [1,1]
  133. @GenderVar << [1,0]
  134. @ClassList << [1,2,3,4,5]
  135. @RaceDescription <<
  136. ["Pháp Sư Là những người nắm giữ phép thuật
  137. trong tay như là ma pháp trận, ma pháp viên,
  138. vòng tròn ma thuật hay kết giới."]
  139. #Race 3:
  140. @RaceAppearanceNames << ["     Jun"]
  141. @RaceFaceImage << ["Actor101.png"]
  142. @RaceFaceIndex << [1]
  143. @RaceChara << ["$Actor101.png"]
  144. @RaceIndex << [1]
  145. @GenderVar << [0]
  146. @ClassList << [1,2,3,4,5]
  147. @RaceDescription <<
  148. ["Cung Thủ Là những người chuyển về những vũ
  149. khí ảnh hưởng xa những vũ khí của họ thường
  150. là Súng , Cung , Nỏ."]
  151. #Race 4:
  152. @RaceAppearanceNames << ["     Javed Iqbal","     Thug Behram"]
  153. @RaceFaceImage << ["Actor42.png","Actor44.png"]
  154. @RaceFaceIndex << [1,1]
  155. @RaceChara << ["$Actor42.png","$Actor44.png"]
  156. @RaceIndex << [1,1]
  157. @GenderVar << [1,1]
  158. @ClassList << [1,2,3,4,5]
  159. @RaceDescription <<
  160. ["Ninja Hay còn gọi là shinobi là danh xưng để
  161. chỉ những cá nhân hay tổ chức đánh thuê chuyên
  162. về hoạt động bí mật "]
  163.  
  164. #####################ADVANCED CONFIG####################
  165. #It is assumed that the code will only be called once, near
  166. #start of the game to create the main character, and that
  167. #all other party members are precreated. If this is NOT the case,
  168. #the script can be called to create an actor with a specific
  169. #actor ID in the following way:
  170. #
  171. #CharCreationManager.setActorID(N)
  172. #SceneManager.call(Scene_CharacterCreation)
  173. #
  174. #Otherwise the character at the FRONT of the party will be selected
  175. #
  176. #Note that the '#'s should both be removed from the start, and the N
  177. #should be replaced with the id of the actor being edited.
  178. #
  179. #Secondly, whenever this script is called, it will use the options defined
  180. #above. You can define an alterate set of options for
  181. #character creation in your game. This will be useful
  182. #if you want to, at somepoint throughout the game, to
  183. #allow the player to customize an actor being added to
  184. #the party. You may have, for example, one set of options
  185. #the 'Friendly Bandit' who joins the player near the start
  186. #of the game, a differnt set for the 'Demigod Ally' who
  187. #joins right before the final battle, and a differnt set
  188. #still for the 'Mages Apprentice' which the player is rewarded
  189. #for completing all the quests in the Mages Guild
  190. #
  191. #Please refer back to the Forums on how to create this altenate set
  192. #of options. Once it is created, it can be called using
  193. #
  194. #CharCreationManager.setOptions(
  195. #YOUR_OPTIONS_NAME_HERE.new
  196. #)
  197. #SceneManager.call(Scene_CharacterCreation)
  198. #
  199. #Again, the '#'s must be removed and the YOUR_OPTIONS_NAME_HERE
  200. #should be replaced with the name of your options set. For more on
  201. #having multiple Character Options check the Forums or message
  202. #Kaimonkey
  203. #
  204. ############END CONFIG############################
  205. end
  206. end
  207.  
  208. class Scene_CharacterCreation < Scene_MenuBase
  209.   #--------------------------------------------------------------------------
  210.   # * Start Processing
  211.   #--------------------------------------------------------------------------
  212.   def start
  213.     super
  214.     @charConfig = CharCreationManager.getOptions
  215.     if(CharCreationManager.getActorID!=nil)
  216.       @actor = $game_actors[CharCreationManager.getActorID]
  217.     end
  218.     create_status_window
  219.     @status_window.width = @status_window.height
  220.     @desc_window = Window_Desc.new(Graphics.width-@status_window.width, @status_window.height)
  221.     @desc_window.x = @status_window.width
  222.     @stage = 1
  223.     @finished = false
  224.     @class_window = Window_Create.new(@actor,@charConfig )
  225.     @race_window = Window_Race.new(@actor,@charConfig )
  226.     @look_window = Window_Appearance.new(@actor,1,@charConfig)
  227.     @class_window.index =  (@actor.class.id - 1)
  228.     @class_window.width = Graphics.width / 3
  229.     @class_window.active = false
  230.     @class_window.visible = false
  231.     @class_window.id = 0
  232.     @look_window.active = false
  233.     @look_window.visible = false
  234.     @race_window.width = Graphics.width / 3
  235.     @look_window.width = Graphics.width / 3
  236.     @class_window.set_handler(:class,method(:changeActorClass))
  237.     @class_window.set_handler(:cancel,   method(:back))
  238.     @look_window.set_handler(:cancel,   method(:back))
  239.     @look_window.set_handler(:look,   method(:finish))
  240.     @race_window.set_handler(:race,method(:changeActorRace))
  241.     @prevClassID = 0;
  242.   end
  243.  
  244.  alias oldupdate update
  245.   def update()
  246.     oldupdate()
  247.     if @finished == true
  248.       return_scene
  249.     end
  250.     raceID = @race_window.index
  251.     appID = @look_window.index
  252.     @actor.set_graphic(@charConfig.RaceChara[raceID][appID],@charConfig.RaceIndex[raceID][appID]-1 ,@charConfig.RaceFaceImage[raceID][appID],@charConfig.RaceFaceIndex[raceID][appID]-1)
  253.     if(@stage!=2)
  254.       str = @charConfig.RaceDescription[raceID][0]
  255.       str.gsub("\n", " ")
  256.       @desc_window.setText(reformat_wrapped(str,37))
  257.     else
  258.        classID = @charConfig.ClassList[raceID][@class_window.index].abs
  259.        if(@prevClassID!=classID)
  260.           @desc_window.setText(getDesc($data_classes[classID]))
  261.           @prevClassID = classID
  262.         end
  263.     end
  264.     #@actor.set_graphic("Animal.png" ,3,RaceFaceImage[raceID][appID],RaceFaceIndex[raceID][appID]-1)    
  265.     $game_player.refresh
  266.     classID = @charConfig.ClassList[raceID][@class_window.index]
  267.     @actor.change_class(classID)
  268.     @actor.hp = @actor.mhp
  269.     @actor.mp = @actor.mmp
  270.     @actor.init_exp
  271.     @actor.init_skills
  272.     @status_window.refresh
  273.   end
  274.  
  275.   def getDesc(charClass)
  276.     unless charClass.note.include?("<desc")
  277.       bestStat = getBestStat(charClass)
  278.       skillType = getSkillType(charClass)
  279.       example = getSkill(charClass)
  280.       str = "As a "+charClass.name+" you use your "+bestStat+" and your "+skillType+" skills, such as "+example+", to defeat foes"
  281.       str = reformat_wrapped(str,40)
  282.       return str
  283.     end
  284.     str = charClass.note
  285.     str = str.split("<desc")[1].split("/>")[0].strip!
  286.     return str
  287.   end
  288.  
  289.   def getSkill(charClass)
  290.     str =  $data_skills[charClass.learnings[0].skill_id].name
  291.     str += " and eventually "
  292.     str += $data_skills[charClass.learnings[charClass.learnings.length-1].skill_id].name
  293.     return str
  294.   end
  295.  
  296.   def getSkillType(charClass)
  297.     tally = Hash.new(0)
  298.    
  299.     for l in charClass.learnings
  300.       id = l.skill_id
  301.       stype_id =  $data_skills[id].stype_id
  302.       tally[$data_system.skill_types[stype_id]] += 1
  303.     end
  304.    
  305.     highestCount = 0
  306.     type = "no"
  307.     for t in tally
  308.       if(t[1]>highestCount)
  309.         highestCount = t[1]
  310.         type = t[0].to_s
  311.       end
  312.     end
  313.    
  314.     return type
  315.   end
  316.  
  317.   def getBestStat(charClass)
  318.      bestParam = 0
  319.      bestScore = 0
  320.      for i in 2..5
  321.        if charClass.params()[i,99] > bestScore
  322.          bestScore = charClass.params()[i,99]
  323.          bestParam = i;
  324.        end
  325.      end
  326.      return Vocab::param(bestParam)
  327.   end
  328.  
  329.  def reformat_wrapped(s, width=78)
  330.  lines = []
  331.  line = ""
  332.  s.split(/\s+/).each do |word|
  333.    if line.size + word.size >= width
  334.      lines << line
  335.      line = word
  336.    elsif line.empty?
  337.     line = word
  338.    else
  339.     line << " " << word
  340.   end
  341.   end
  342.   lines << line if line
  343.  return lines.join "\n"
  344. end
  345.  
  346.  
  347.   def finish()
  348.     raceID = @race_window.index
  349.     $game_variables[@charConfig.AppearanceVariable] = @charConfig.GenderVar[raceID][@look_window.index]
  350.     @finished = true
  351.   end
  352.   def back()
  353.     @class_window.active = false
  354.     @race_window.active = false    
  355.     @look_window.active = false
  356.     if @stage == 2
  357.       @look_window.index = 0
  358.       @class_window.index = 0
  359.       @race_window.active = true
  360.       @stage = 1
  361.     elsif @stage == 3
  362.       @stage = 2
  363.       @class_window.active = true  
  364.     end
  365.   end
  366.  
  367.   def changeActorClass()
  368.     classID = @class_window.index
  369.     @stage = 3
  370.     @look_window.active = true
  371.     @look_window.visible = true
  372.     @status_window.refresh
  373.   end
  374.  
  375.   def changeActorRace()
  376.     raceID = @race_window.index
  377.     @actor.set_graphic(@charConfig.RaceFaceImage[raceID][0],@charConfig.RaceFaceIndex[raceID][0],@charConfig.RaceFaceImage[raceID][0],@charConfig.RaceFaceIndex[raceID][0]-1)
  378.     @status_window.refresh
  379.     @stage = 2
  380.     @class_window.activate
  381.     @class_window.visible = true
  382.     @look_window.id=raceID
  383.     @class_window.id=raceID
  384.     @look_window.index = 0
  385.     $game_variables[@charConfig.RaceVariable] = raceID +1
  386.   end
  387.  
  388.   def create_status_window
  389.     y = 0
  390.     @status_window = Window_SkillStatus.new(0,0)
  391.     @status_window.viewport = @viewport
  392.     @status_window.actor = @actor
  393.   end
  394. end
  395.  
  396. #==============================================================================
  397. # ** Window_Status
  398. #------------------------------------------------------------------------------
  399. #  This window displays full status specs on the status screen.
  400. #==============================================================================
  401.  
  402. class Window_Create < Window_Command
  403.   #--------------------------------------------------------------------------
  404.   # * Object Initialization
  405.   #--------------------------------------------------------------------------
  406.   def initialize(actor,charConfig)
  407.     @charConfig = charConfig
  408.     @actor = actor
  409.     super(Graphics.width / 3, fitting_height(4))
  410.    
  411.     self.height = Graphics.height - fitting_height(4)
  412. #    create_help_window
  413.   end
  414.   #--------------------------------------------------------------------------
  415.   # * Set Actor
  416.   #--------------------------------------------------------------------------
  417.   def actor=(actor)
  418.     return if @actor == actor
  419.     @actor = actor
  420.     refresh
  421.   end
  422.   #--------------------------------------------------------------------------
  423.   # * Create Command List
  424.   #--------------------------------------------------------------------------
  425.   def make_command_list
  426.     for i in @charConfig.ClassList[@id.to_i]
  427.       if(i<0)
  428.         add_command($data_classes[-i].name, :class,false)
  429.       else
  430.         add_command($data_classes[i].name, :class,true)
  431.       end
  432.     end
  433.   end
  434.   #------------------------------------------------------------------------
  435.   def id=(id)
  436.     @id = id
  437.     refresh
  438.   end
  439. end
  440.  
  441. ############################################################
  442. #
  443. #
  444. # RACE MEANU
  445. #####
  446. class Window_Race < Window_Command
  447.   #--------------------------------------------------------------------------
  448.   # * Object Initialization
  449.   #--------------------------------------------------------------------------
  450.   def initialize(actor,charConfig )
  451.     @charConfig = charConfig
  452. #    create_help_window
  453.     @actor = actor
  454.     super(0, fitting_height(4))
  455.     self.height = Graphics.height - fitting_height(4)
  456.   end
  457.   #--------------------------------------------------------------------------
  458.   # * Set Actor
  459.   #--------------------------------------------------------------------------
  460.   def actor=(actor)
  461.     return if @actor == actor
  462.     @actor = actor
  463.     refresh
  464.   end
  465.   #--------------------------------------------------------------------------
  466.   # * Create Command List
  467.   #--------------------------------------------------------------------------
  468.   def make_command_list
  469.     count = 0
  470.     for i in @charConfig.Races
  471.       add_command(i, :race)
  472.     end
  473.   end
  474. end
  475.  
  476.  
  477.  
  478.  
  479. class Window_Appearance < Window_Command
  480.   #--------------------------------------------------------------------------
  481.   # * Object Initialization
  482.   #--------------------------------------------------------------------------
  483.   def initialize(actor,id,charConfig )
  484.     @actor = actor
  485.     @id = id
  486.     @charConfig  = charConfig
  487.     super(Graphics.width / 1.5, fitting_height(4))
  488.     self.height = Graphics.height - fitting_height(4)
  489. #    create_help_window
  490.     #item_height = 36
  491.   end
  492.   #--------------------------------------------------------------------------
  493.   # * Set Actor
  494.   #--------------------------------------------------------------------------
  495.   def actor=(actor)
  496.     return if @actor == actor
  497.     @actor = actor
  498.     refresh
  499.    # self.item_height = 36
  500.   end
  501.  
  502.   def id=(id)
  503.     @id = id
  504.     refresh
  505. #    self.item_height = 36
  506.     count = 0
  507.     i_id = @id.to_i
  508.     lookArray = @charConfig.RaceAppearanceNames#[@id]
  509.     for i in (0...(lookArray[i_id].length))
  510.       #add_command("   "+lookArray[i_id][i], :look)
  511.       #draw_item(i,RaceChara[i_id][i],RaceIndex[i_id][i])
  512.       draw_character(@charConfig.RaceChara[i_id][i], @charConfig.RaceIndex[i_id][i]-1,16,36*(i+1)-2)
  513.     end
  514.   end
  515.   #--------------------------------------------------------------------------
  516.   # * Create Command List
  517.   #--------------------------------------------------------------------------
  518.   alias oldCommand make_command_list
  519.   def make_command_list
  520.     oldCommand
  521.     count = 0
  522.     i_id = @id.to_i
  523.     lookArray = @charConfig.RaceAppearanceNames#[@id]
  524.     for i in (0...(lookArray[i_id].length))
  525.       add_command("   "+lookArray[i_id][i], :look)
  526.       #draw_item(i,RaceChara[i_id][i],RaceIndex[i_id][i])
  527.       #draw_character(RaceChara[i_id][i], RaceIndex[i_id][i],16,36*(i+1)-2)
  528.     end
  529.     #draw_character(RaceChara[i_id][i], RaceIndex[i_id][i], 0, 0)
  530.   end
  531.  
  532.   def draw_item(index,chara="Actor1.png",chaIndex = 1)
  533.     change_color(normal_color, command_enabled?(index))
  534.     draw_text(item_rect_for_text(index), command_name(index), alignment)
  535.     #draw_character(chara,chaIndex,16,36*(index+1)-2)
  536.   end
  537.   def item_rect(index)
  538.     rect = Rect.new
  539.     rect.width = item_width
  540.     rect.height = 36#item_height
  541.     rect.x = index % col_max * (item_width + spacing)
  542.     rect.y = index / col_max * 36#item_height
  543.     rect
  544.   end
  545.   def update_cursor
  546.     if @cursor_all
  547.       cursor_rect.set(0, 0, contents.width, row_max * 36)
  548.       self.top_row = 0
  549.     elsif @index < 0
  550.       cursor_rect.empty
  551.     else
  552.       ensure_cursor_visible
  553.       cursor_rect.set(item_rect(@index))
  554.     end
  555.   end
  556.     def contents_height
  557.     [super - super % 36, row_max * 36].max
  558.   end
  559.    def update_padding_bottom
  560.     surplus = (height - standard_padding * 2) % 36
  561.     self.padding_bottom = padding + surplus
  562.   end
  563.   def top_row
  564.     oy / 36
  565.   end
  566.    def page_row_max
  567.     (height - padding - padding_bottom) / 36
  568.   end
  569.   def top_row=(row)
  570.     row = 0 if row < 0
  571.     row = row_max - 1 if row > row_max - 1
  572.     self.oy = row * 36
  573.   end
  574. end
  575.  
  576. class Window_Desc < Window_Base
  577.   @text
  578.   def initialize(w,h)
  579.       super(0,0,w,h)
  580.       self.width = w
  581.       self.height = h
  582.   end
  583.  
  584.   def setText(text)
  585.     if(text!=@text)
  586.       @text = text
  587.       refresh
  588.     end
  589.  end
  590.   def refresh()
  591.     contents.clear
  592.     draw_text_ex(4, 0, @text)
  593.   end
  594. end
  595.  
  596. module CharCreationManager  
  597.   def self.setActorID(id)
  598.     @actorID = id
  599.   end
  600.  
  601.   def self.setOptions(opt)
  602.     @options = opt
  603.   end
  604.    
  605.    
  606.   def self.getActorID
  607.       return @actorID
  608.     end
  609.    
  610.   def self.getOptions
  611.       if(@options != nil)
  612.         return @options
  613.       end
  614.       return CharConfig.new
  615.   end
  616.  
  617. end
  618.  
  619. #######CONFIG#########################
  620. #
  621. #Here we can define an alterate set of options for
  622. #character creation in your game. This will be useful
  623. #if you want to, at somepoint throughout the game, to
  624. #allow the player to customize an actor being added to
  625. #the party. You may have, for example, one set of options
  626. #the 'Friendly Bandit' who joins the player near the start
  627. #of the game, a differnt set for the 'Demigod Ally' who
  628. #joins right before the final battle, and a differnt set
  629. #still for the 'Mages Apprentice' which the player is rewarded
  630. #for completing all the quests in the Mages Guild
  631. #
  632. #On the line below you MUST give your set of options a name.
  633. #For example:
  634. #
  635. #class MagesGuildOptions < CharConfig
  636. #
  637. #will create a set of options called "MagesGuildOptions". Make
  638. #sure to remember this name, as you will need to use it to tell
  639. #the game to switch the options
  640. #
  641. class MagesGuildOptions < CharConfig
  642. ##############END CONFIG##############
  643.  
  644.  
  645. def initialize
  646.   super
  647.   @RaceAppearanceNames = Array.new
  648.   @RaceFaceImage = Array.new
  649.   @RaceFaceIndex = Array.new
  650.   @RaceChara = Array.new
  651.   @RaceIndex = Array.new
  652.   @GenderVar = Array.new
  653.   @RaceDescription = Array.new
  654.   @ClassList = Array.new
  655.  
  656.  
  657. #############CONFIG######################
  658. #Here list all the names of all races in this set of options
  659. # Example:
  660. # Races = ["Human","Elf","Dwarf"]
  661. # Creates three races, called Human, Elf and Dwarf
  662. @Races = ["Trợ Thủ","Đỡ Đòn"]
  663. #Which race the player chooses will be stored in a variable, which is defined
  664. #below. This can be used later create effects that only affect, say, Dwarves,
  665. #such as giving them the ability to use heavy armour, regardless of class.
  666. #This can be acheived by having an event check that variable, then run actions
  667. #accordingly
  668. @RaceVariable = 27
  669.  
  670. #Additionally a variable can store information depending on the appearance of the
  671. #character. This can be used so that events can check information related to the
  672. #appearance, such as gender.
  673. @AppearanceVariable = 28
  674. #The default is to store the Race in variable 25. By default this will mean that
  675. #if the player is human that varible will be 1, 2 if an elf, and 3 if a dwarf.
  676. #
  677. #Then we need to do some setup for each race
  678. #Example:
  679. #RaceAppearanceNames << ["Female","Male"]
  680. #RaceFaceImage << ["Actor3.png","Actor3.png"]
  681. #RaceFaceIndex << [6,5]
  682. #RaceChara << ["Actor3.png","Actor3.png"]
  683. #RaceIndex << [6,5]
  684. #GenderVar << [1,0]
  685. #ClassList << [6,-1,2,-4]
  686. #RaceDescription <<
  687. #["Industrious and smart, although most
  688. #lead mundane lives, among Humanity walk
  689. #the most powerful mages and warrior
  690. #on this earth."]
  691. #
  692. #The first row shows that the first race we typed in at the start has two
  693. #different Appearances. One called Female, one called Male.
  694. #
  695. #The second row shows the File name for that appearances face. So both Male and
  696. #Female humans use Actor1.png
  697. #The third row shows which face in the file to use, as each image has 8 faces,
  698. #so female humans use the first face in the Actor1.png Image, and Males use the
  699. #second image.
  700. #
  701. #The fourth and fifth line work like the Faces, appart from for defining the
  702. #Character image that is seen walking around the screen. In the example above
  703. #both Male and Female humans have characters to match their faces.
  704. #
  705. #The 6th line is used to set the Appearance variable. In this case having the
  706. #"Male" apperance will set the Appearance variable (Default 26) to 0, while the
  707. #"Female" will set it to 1. This way you can have NPCs react depending on Gender
  708. #
  709. #The seventh line lists all classes, in order, that that class can take.
  710. #Listing a class as negitive (I.e. -3) will mean that it is listed, but you cannot
  711. #select it. This can be used to clearly show what class can and cannot take certain
  712. #classes, but without confusing the player by hiding information
  713. #
  714. #Finally we have a description for the race. This is at max four lines, and each line
  715. #should not be longer than the in the example Races.
  716. #
  717. #For each race you defined at the start, copy paste these lines, and customize
  718. #as you wish.
  719.  
  720. #Race 1:
  721. @RaceAppearanceNames << ["     Huna"]
  722. @RaceFaceImage << ["Actor34.png"]
  723. @RaceFaceIndex << [1]
  724. @RaceChara << ["$Actor34.png"]
  725. @RaceIndex << [1]
  726. @GenderVar << [0]
  727. @ClassList << [6,7]
  728. @RaceDescription <<
  729. ["Trợ Thủ Hay gọi là người hộ thể , người nắm
  730. sinh mạng và sự tái sinh của vạn vật "]
  731. #Race 2:
  732. @RaceAppearanceNames << ["     Kun"]
  733. @RaceFaceImage << ["Actor31.png"]
  734. @RaceFaceIndex << [1]
  735. @RaceChara << ["$Actor31.png"]
  736. @RaceIndex << [2]
  737. @GenderVar << [1]
  738. @ClassList << [6,7]
  739. @RaceDescription <<
  740. ["Đỡ đòn là những người bảo vệ chủ nhân của mình
  741. dù khá năng tấn công của họ rất yếu nhưng họ đc coi
  742. là nhưng con cờ của tính mạng"]
  743. #####################END CONFIG##################################
  744. end
  745. end
Advertisement
Add Comment
Please, Sign In to add comment