Advertisement
CrowMakerVX

RandomNamer1.0

Dec 12th, 2012
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 5.27 KB | None | 0 0
  1. #                             Random Namer 1.0
  2. #                              By: Ixfuru
  3. #                                9/1/12
  4. ################################################################################
  5. #  This script renames actors and enemies with a script call.
  6.  
  7. #      $game_actors[x].random_male_actor_name
  8. #                    or
  9. #      $game_actors[x].random_female_actor_name
  10.  
  11. #   Or you can replace $game_actors[x], with $game_party.members[x] to name the
  12. # member in the party in the x position.  0 is the leader.
  13.  
  14. #   Replace x with actor's id from the database.  Replace string with whatever
  15. # you wish to rename the actor.
  16. #       Troop names will be changed automatically based on random enemy names
  17. # you supply.
  18. #
  19. #      To change the original database name of the enemy, you'll need to set
  20. # up the ENEMY_NAMES hash in the configuration section.
  21. ################################################################################
  22. #     Place above Main, below materials.
  23. #     Credit Ixfuru
  24. ################################################################################
  25. #                    CONFIGURATION SECTION
  26. #===============================================================================
  27. module RandomNamer
  28.  
  29.   ACTOR_MALE_NAMES = [#<<<Don't be deleting this!
  30.  
  31.   "Illusio", "Mongraneer", "Vestucius", "Dogram", "Hashbicayo", "Mikael",
  32.   "Stoltz", "Myron", "Baxter", "Handance", "Rinton", "Mavery", "Dooblyn",
  33.   "Skyche", "Rex", "Bando"
  34.  
  35.   ]#<<<<Don't be deleting this either!
  36.  
  37.   ACTOR_FEMALE_NAMES = [#Don't delete this!
  38.  
  39.   "Shy", "Vola", "Geshnali", "Raishelle", "Erva", "Scarlet", "Heather", "Roma",
  40.   "Tempest", "Roxanne", "Vera", "Lacy", "Katherine", "Maricela"
  41.  
  42.   ]#<<<<<Don't be deleting this one!!!
  43.  
  44.   # The following hash is used to store enemy ids.  These are enemies which will
  45.   # be given random names upon encounter.  Any id left out of the hash, will
  46.   # resort back to the default way of creating names.
  47.  
  48.   ENEMY_NAMES = {#<<<<Don't delete this!
  49.  
  50.   1 => ["Riccochet", "Weevil", "Badgeler", "Drollamere", "Skontz", "Rofford"],
  51.   2 => ["Mynx", "Evlighar", "Rhynecold", "Beegun", "Wishwar", "Foster"],
  52.   3 => ["Cryltagin", "Smutz", "Girghahk", "Brutchmoor", "Leinagogus"],
  53.   4 => ["Spash", "Mumlegodeen", "Smarzwhack", "Eildrew"],
  54.   5 => ["Kurtresimo", "Urd", "Kuuma", "Dranylvin", "Shmodtoker", "Rhankbreem"],
  55.   6 => ["Brokdaitos", "Skeem", "Pladakhar", "Mynutsk", "Implig"],
  56.   7 => ["Dwaveer", "Shuck", "Penpacali", "Domerbron", "Bread", "Cashigu"],
  57.   8 => ["Lemplig", "Vaskway", "Armskot", "Trumidge", "Clobernotes"],
  58.   9 => ["Diveque", "Hajku", "Everszway", "Aloom", "Cudolf"],
  59.   10 => ["Yeq", "Harf", "Ruk", "Stok", "Erk"]
  60.  
  61.   }#<<<<<Don't delete this!
  62.  
  63.   # This constant boolean reflects how you want the names to be displayed.
  64.   # If this is set to false, the name will be displayed as JUST the random name.
  65.   # If true, it will add the random name, following the actual name of the enemy.
  66.   # Like this "Bat Freddy".  
  67.  
  68.   SPECIES_PLUS_NAME = false
  69.  
  70.   # This constant is used to replace the old "An Enemy Emerged" that is displayed
  71.   # on the outset of any battle with a new string, using the ENEMY NAMES.
  72.   USE_NEW_EMERGED = true
  73.  
  74.  
  75.  
  76. end
  77.  
  78. #===============================================================================
  79. #                 END CONFIGURATION SECTION
  80. ################################################################################
  81. #===============================================================================
  82.  
  83. ################################################################################
  84. #                             Game Enemy
  85. ################################################################################
  86.  
  87. class Game_Enemy < Game_Battler
  88.  
  89.   include RandomNamer
  90.  
  91.   alias rn_ge_name name unless $@
  92.   def name
  93.     enkeys = ENEMY_NAMES.keys
  94.     ranname = ENEMY_NAMES[@enemy_id].size - 1
  95.     if enkeys.include?(@enemy_id)
  96.       if SPECIES_PLUS_NAME
  97.         return @original_name + " " + ENEMY_NAMES[@enemy_id][rand(ranname)]
  98.       else
  99.         return ENEMY_NAMES[@enemy_id][rand(ranname)]
  100.       end
  101.     else
  102.       rn_ge_name
  103.     end
  104.   end
  105.  
  106. end
  107.  
  108.  
  109. #===============================================================================
  110. ################################################################################
  111.  
  112. class Game_Actor < Game_Battler
  113.  
  114.   include RandomNamer
  115.  
  116.   def random_male_actor_name
  117.     rn = ACTOR_MALE_NAMES.size
  118.     new_name = rand(rn - 1)
  119.     @name = ACTOR_MALE_NAMES[new_name]
  120.   end
  121.  
  122.   def random_female_actor_name
  123.     rn = ACTOR_FEMALE_NAMES.size
  124.     new_name = rand(rn - 1)
  125.     @name = ACTOR_FEMALE_NAMES[new_name]
  126.   end
  127.  
  128. end
  129.  
  130. #===============================================================================
  131. ################################################################################
  132. #                        Game Troop
  133. ################################################################################
  134.  
  135. class Game_Troop < Game_Unit
  136.  
  137.   include RandomNamer
  138.  
  139.   alias rn_gt_enemy_names enemy_names unless $@
  140.   def enemy_names
  141.     if USE_NEW_EMERGED
  142.       names = []
  143.       for enemy in members
  144.         names.push(enemy.name)
  145.       end
  146.       return names
  147.     else
  148.       rn_gt_enemy_names
  149.     end
  150.   end
  151.  
  152. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement