Advertisement
Rajang

[RGSS3] Quest system 2

Oct 13th, 2014
2,857
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 8.88 KB | None | 0 0
  1. #==============================================================================
  2. #
  3. #          Quests         v. 1.0
  4. #          by MHRajang
  5. #
  6. #==============================================================================
  7. #==============================================================================
  8. # o Compatibility o
  9. #------------------------------------------------------------------------------
  10. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  11. # it will run with RPG Maker VX without adjusting.
  12. #
  13. # It only works with the window 640*480 (with Yanfly Core Engine or others
  14. # script that extend the window)
  15. #==============================================================================
  16. #==============================================================================
  17. # o Rights on this script o
  18. #------------------------------------------------------------------------------
  19. # You can use it in free or commercial games,
  20. # but just credit me and give me a free copy of your game
  21. #==============================================================================
  22. #==============================================================================
  23. # o How to use it ? o
  24. #------------------------------------------------------------------------------
  25. # Call quests : SceneManager.call(Scene_MHRquests)
  26. #------------------------------------------------------------------------------
  27. # Just enter the title and the description of the quests
  28. # You can choose what variable will modify the state of the quest
  29. # 0      = quest not discovered yet
  30. # 1      = quest discovered
  31. # 2 or 3 = quest complete
  32. #------------------------------------------------------------------------------
  33. # example :
  34. #
  35. # def quest1
  36. #     display_message($game_variables[103], "Save the princess", <= begin of customization
  37. #     "Description",                   ^ this is the variable you will change in events            
  38. #     "Bla Bla",                         you can choose an other
  39. #     "bla",
  40. #     "This   description",
  41. #     "is",
  42. #     "the",
  43. #     "description",
  44. #     "oooooooooooooooooooo",
  45. #     "that's all folks !")              <= end of customization
  46. #    SceneManager.call(Scene_MHRquests)
  47. #  end
  48. #==============================================================================
  49. # Nice making, my friends ! ;)
  50. #==============================================================================
  51.  
  52.  
  53. # Scene journal
  54. class Scene_MHRquests < Scene_Base
  55.   # Lancement de la scène
  56.   def start
  57.     super
  58.     create_title
  59.     create_commands
  60.     create_window_message
  61.   end
  62.   # Création de la fenêtre de titre
  63.   def create_title
  64.     @title = Window_Help.new(1)
  65.     @title.set_text("         Journal de quêtes")
  66.   end
  67.   # Création de la fenêtre de sélection
  68.   def create_commands
  69.     @window_selection = Window_List.new(0, 48)
  70.     @window_selection.set_handler(:quest1, method(:quest1))
  71.     @window_selection.set_handler(:quest2, method(:quest2))
  72.     @window_selection.set_handler(:quest3, method(:quest3))
  73.     @window_selection.set_handler(:quest4, method(:quest4))
  74.     @window_selection.set_handler(:quest5, method(:quest5))
  75.     @window_selection.set_handler(:quest6, method(:quest6))
  76.     @window_selection.set_handler(:quest7, method(:quest7))
  77.     @window_selection.set_handler(:quest8, method(:quest8))
  78.     @window_selection.set_handler(:quest9, method(:quest9))
  79.     @window_selection.set_handler(:quest10, method(:quest10))
  80.     @window_selection.set_handler(:quest11, method(:quest11))
  81.     @window_selection.set_handler(:quest12, method(:quest12))
  82.     @window_selection.set_handler(:quest13, method(:quest13))
  83.     @window_selection.set_handler(:quest14, method(:quest14))
  84.     @window_selection.set_handler(:quest15, method(:quest15))
  85.     @window_selection.set_handler(:quest16, method(:quest16))
  86.     @window_selection.set_handler(:cancel, method(:return_scene))
  87.     @window_selection.set_handler(:unknowquest, method(:unknowquest))
  88.   end
  89.  
  90.   def create_window_message
  91.     @message = Window_Base.new(160, 48, 480, 432)
  92.   end
  93.  
  94.   def display_message(number, text, text2, text3, text4,
  95.     text5, text6, text7, text8, text9, text10)
  96.     # Description =
  97.     @message.draw_text(0, 20, 600, 80, text)
  98.     @message.draw_text(100, 70, 600, 38, "_____________________")
  99.     @message.draw_text(0, 120, 600, 38, text2)
  100.     @message.draw_text(0, 145, 600, 38, text3)
  101.     @message.draw_text(0, 170, 600, 38, text4)
  102.     @message.draw_text(0, 195, 600, 38, text5)
  103.     @message.draw_text(0, 220, 600, 38, text6)
  104.     @message.draw_text(0, 245, 600, 38, text7)
  105.     @message.draw_text(0, 270, 600, 38, text8)
  106.     @message.draw_text(0, 295, 600, 38, text9)
  107.     @message.draw_text(0, 320, 600, 38, text10)
  108.     # Si accompli (3), ou non (1) =
  109.     if number <= 1
  110.       message = "To do"
  111.     else message = "Complete !"
  112.     end
  113.     @message.draw_text(120, 0, 280, 38, message)
  114.     @message.show
  115.   end
  116.  
  117.   def quest1
  118.     display_message($game_variables[103], "Titre", # <= You can choose another
  119.     "Description ligne 1",                         #    variable if you want
  120.     "",
  121.     "",
  122.     "",
  123.     "",
  124.     "",
  125.     "",
  126.     "",
  127.     "")
  128.     SceneManager.call(Scene_MHRquests)
  129.   end
  130.   def quest2
  131.     display_message($game_variables[104], "Titre",
  132.     "Description ligne 1",
  133.     "",
  134.     "",
  135.     "",
  136.     "",
  137.     "",
  138.     "",
  139.     "",
  140.     "")
  141.     SceneManager.call(Scene_MHRquests)
  142.   end
  143.   def quest3
  144.     display_message($game_variables[105], "Titre",
  145.     "Description ligne 1",
  146.     "",
  147.     "",
  148.     "",
  149.     "",
  150.     "",
  151.     "",
  152.     "",
  153.     "")
  154.     SceneManager.call(Scene_MHRquests)
  155.   end
  156.   def quest4
  157.     display_message($game_variables[106], "Titre",
  158.     "Description ligne 1",
  159.     "",
  160.     "",
  161.     "",
  162.     "",
  163.     "",
  164.     "",
  165.     "",
  166.     "")
  167.     SceneManager.call(Scene_MHRquests)
  168.   end
  169.   def quest5
  170.     display_message($game_variables[107], "Titre",
  171.     "Description ligne 1",
  172.     "",
  173.     "",
  174.     "",
  175.     "",
  176.     "",
  177.     "",
  178.     "",
  179.     "")
  180.     SceneManager.call(Scene_MHRquests)
  181.   end
  182.   def quest6
  183.   end
  184.   def quest7
  185.   end
  186.   def quest8
  187.   end
  188.   def quest9
  189.   end
  190.   def quest10
  191.   end
  192.   def quest11
  193.   end
  194.   def quest12
  195.   end
  196.   def quest13
  197.   end
  198.   def quest14
  199.   end
  200.   def quest15
  201.   end
  202.   def quest16
  203.   end
  204.   def unknowquest
  205.     display_message($game_variables[120], "Inconnu",
  206.     "",
  207.     "A decouvrir !",
  208.     "",
  209.     "",
  210.     "",
  211.     "",
  212.     "",
  213.     "",
  214.     "")
  215.     SceneManager.call(Scene_MHRquests)
  216.   end
  217.  
  218.   # Attente de la pression du bouton C
  219.   def pre_terminate
  220.     super
  221.     loop do
  222.       Graphics.update
  223.       Input.update
  224.       break if Input.trigger?(:C)
  225.     end
  226.   end
  227. end
  228.  
  229. # Fenêtre de sélection
  230. class Window_List < Window_Command
  231.   # Création de la liste de selection
  232.   def make_command_list
  233.     if $game_variables[103] == 0
  234.       add_command("inconnu", :unknowquest)
  235.     else add_command("-Quête 01-", :quest1)
  236.     end
  237.     if $game_variables[104] == 0
  238.       add_command("inconnu", :unknowquest)
  239.     else add_command("-Quête 02-", :quest1)
  240.     end
  241.     if $game_variables[105] == 0
  242.       add_command("inconnu", :unknowquest)
  243.     else add_command("-Quête 03-", :quest1)
  244.     end
  245.     if $game_variables[106] == 0
  246.       add_command("inconnu", :unknowquest)
  247.     else add_command("-Quête 04-", :quest1)
  248.     end
  249.     if $game_variables[107] == 0
  250.       add_command("inconnu", :unknowquest)
  251.     else add_command("-Quête 05-", :quest1)
  252.     end
  253.     if $game_variables[108] == 0
  254.       add_command("inconnu", :unknowquest)
  255.     else add_command("-Quête 06-", :quest1)
  256.     end
  257.     if $game_variables[109] == 0
  258.       add_command("inconnu", :unknowquest)
  259.     else add_command("-Quête 07-", :quest1)
  260.     end
  261.     if $game_variables[110] == 0
  262.       add_command("inconnu", :unknowquest)
  263.     else add_command("-Quête 08-", :quest1)
  264.     end
  265.     if $game_variables[111] == 0
  266.       add_command("inconnu", :unknowquest)
  267.     else add_command("-Quête 09-", :quest1)
  268.     end
  269.     if $game_variables[112] == 0
  270.       add_command("inconnu", :unknowquest)
  271.     else add_command("-Quête 10-", :quest1)
  272.     end
  273.     if $game_variables[113] == 0
  274.       add_command("inconnu", :unknowquest)
  275.     else add_command("-Quête 11-", :quest1)
  276.     end
  277.     if $game_variables[114] == 0
  278.       add_command("inconnu", :unknowquest)
  279.     else add_command("-Quête 12-", :quest1)
  280.     end
  281.     if $game_variables[115] == 0
  282.       add_command("inconnu", :unknowquest)
  283.     else add_command("-Quête 13-", :quest1)
  284.     end
  285.     if $game_variables[116] == 0
  286.       add_command("inconnu", :unknowquest)
  287.     else add_command("-Quête 14-", :quest1)
  288.     end
  289.     if $game_variables[117] == 0
  290.       add_command("inconnu", :unknowquest)
  291.     else add_command("-Quête 15-", :quest1)
  292.     end
  293.     if $game_variables[118] == 0
  294.       add_command("inconnu", :unknowquest)
  295.     else add_command("-Quête 16-", :quest1)
  296.     end
  297.     add_command("Back", :cancel)
  298.   end
  299. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement