设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 120|回复: 0

[转载发布] Quest Script

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    2026-7-12 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    9071

    主题

    864

    回帖

    6万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    58883
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    68848

    灌水之王

    发表于 2026-8-1 13:33:53 | 显示全部楼层 |阅读模式
    Hi there. This is a pretty old script, but here it is nonetheless. I'm not the best programmer, so there may be compatibility issues with other scripts, but if you wanna give it a try here it is  
      - Heres an old vid of it:








            Code:

    Spoiler                Code:       
    1. #-============================================================================-#
    2. #    ProQuest Version 3
    3. #   
    4. #    Now with EasyUpdate! No more need to update and completely redo quests.  
    5. #-============================================================================-#
    6. #-=HOW TO USE!-=+=============================================================-#
    7. =begin  
    8.         
    9.         Set quest name: (id = quest id number)
    10.         $game_quests.setname(id, name)
    11.         
    12.         Set quest short name:
    13.         $game_quests.setshortname(id, name)
    14.         
    15.         Set quest description:
    16.         $game_quests.setdesc(id, desc)
    17.         can be 3 lines long.
    18.         
    19.         Set quest sender:
    20.         $game_quests.setsender(id, name)
    21.         
    22.         Set quest EXP:
    23.         $game_quests.setexp(id, amount)
    24.         
    25.         Set quest Gold:
    26.         $game_quests.setgold(id, amount)
    27.         
    28.         Set quest Item:
    29.         $game_quests.setitem(id, name)
    30.         
    31.         Set quest location
    32.         $game_quests.setlocation(id, location)
    33.         
    34.         Set quest Face
    35.         $game_quests.setface(id, face_name, face_index)
    36.         
    37.         Set quest expired
    38.         $game_quests.setexpired(id, on)
    39.         
    40.         Set quest level:
    41.         $game_quests.set_level(id, min_level, max_level)
    42.         
    43.         set quest type:
    44.         $game_quests.set_type(id, type, type_icon)
    45.         
    46.         Set goals: (Use 0 if disabled) up to 6 goals.
    47.         $game_quests.set_goals(id, g1, g2, g3, g4, g5, g6)
    48.         
    49.         Set goal Min:
    50.         $game_quests.set_goals_min(id, g1, g2, g3, g4, g5, g6)
    51.         
    52.         Set goal Max:
    53.         $game_quests.set_goals_max(id, g1, g2, g3, g4, g5, g6)
    54.         
    55.         Check if quest is complete, and if so, complete it.
    56.         $game_quests.do_complete(id)
    57.         
    58.         Set points earned for completing quest
    59.         $game_quests.set_quest_points(id, val)
    60.         
    61.         Add Goal progress:
    62.         $game_quests.add_goal_progress(id, value_to_add)
    63.         $game_quests.add_goalx_progress(id, value_to_add)
    64.         ^ replace x with 2 through 6.
    65.         
    66.         Subtract Goal progress:
    67.         $game_quests.subtract_goal_progress(id, value_to_subtract)
    68.         $game_quests.subtract_goalx_progress(id, value_to_subtract)
    69.         ^ replace x with 2 through 6.
    70.         
    71.         
    72. =end
    73.         
    74.         
    75. #-[Config-#===================================================================-#
    76. Use_Windowskin=true
    77. Map_window_X=0
    78. Map_window_Y=0
    79. Gold_Icon=361
    80. EXP_Icon=121
    81. Item_Icon=192
    82. No_Quest_Found_MSG = "Quest Not Available"
    83. $quest_size=0
    84. $font_size=Font.default_size
    85. Window_Color_r=55
    86. Window_Color_g=25
    87. Window_Color_b=15
    88. QP_Name="QP"
    89. $error_msg = "-not found-"
    90. $exp_name="EXP"
    91. $gold_name="G"
    92. Complete_ME="Audio/me/Fanfare1"
    93. Complete_ME_Volume = 100
    94. Complete_ME_Pitch=0
    95. #-============================================================================-#
    96. #-[Make Quest Information]-#==================================================-#
    97. class Game_Quests
    98.   def initialize
    99.     @name= []
    100.     @desc= []
    101.     @sender= []
    102.     @exp = []
    103.     @gold = []
    104.     @item = []
    105.     @location = []
    106.     @face = []
    107.     @face_id = []
    108.     @expired = []
    109.     @min_level = []
    110.     @max_level = []
    111.     @type = []
    112.     @type_icon = []
    113.     @goal = []
    114.     @goal2 = []
    115.     @goal3 = []
    116.     @goal4 = []
    117.     @goal5 = []
    118.     @goal6 = []
    119.     @short_name= []
    120.     @quest_complete = []
    121.    
    122.     @quest_accepted = []
    123.    
    124.     @goal_progress= []
    125.     @goal2_progress= []
    126.     @goal3_progress= []
    127.     @goal4_progress= []
    128.     @goal5_progress= []
    129.     @goal6_progress= []
    130.    
    131.     @goal_min = []
    132.     @goal2_min = []
    133.     @goal3_min = []
    134.     @goal4_min = []
    135.     @goal5_min = []
    136.     @goal6_min = []
    137.    
    138.     @goal_max = []
    139.     @goal2_max = []
    140.     @goal3_max = []
    141.     @goal4_max = []
    142.     @goal5_max = []
    143.     @goal6_max = []
    144.    
    145.     @quest_size = 0
    146.    
    147.     @quest_rating= []
    148.    
    149.     @number_complete=0
    150.     @qp=0
    151.    
    152.     @quests_enabled=0
    153.    
    154.     $index=0
    155.    
    156.     $quest_id=0
    157.     $mode=0
    158.     $selected_quest=0
    159.     $show_quest=0
    160.   end
    161.   
    162.   def get_completed_quests
    163.     return @number_complete
    164.   end
    165.   
    166.   def quests_enabled
    167.     if @quests_enabled==0
    168.       return false
    169.     else
    170.       return true
    171.     end
    172.   end
    173.   
    174.   def quest_size
    175.     return @quest_size-1
    176.   end
    177.   
    178.   def enable_quests
    179.     @quests_enabled=1
    180.   end
    181.   
    182.   
    183.   def set_quest_points(id, val)
    184.     @quest_rating[id]=val
    185.   end
    186.   
    187.   def get_poitns(id)
    188.     return @quest_rating[id]
    189.   end
    190.   
    191.   def accept(id)
    192.     return @quest_accepted[id]
    193.   end
    194.   
    195.   def do_accept(id)
    196.     @quest_accepted[id] = true
    197.     enable_quests
    198.   end
    199.   
    200.   def do_un_accept(id)
    201.     @quest_accepted[id] = false
    202.   end
    203.   
    204.   def check_complete(id)
    205.     if @goal_min[id]==@goal_max[id] && @goal2_min[id]==@goal2_max[id] && @goal3_min[id]==@goal3_max[id] && @goal4_min[id]==@goal4_max[id] && @goal5_min[id]==@goal5_max[id] && @goal6_min[id]==@goal6_max[id]
    206.       return true
    207.     else
    208.       return false
    209.     end
    210.   end
    211.   
    212.   def do_complete(id)
    213.     if check_complete(id) && @quest_complete[id] != true
    214.       @number_complete+=1
    215.       @qp+=@quest_rating[id]
    216.       @quest_complete[id]=true
    217.     end
    218.   end
    219.   
    220.   def name(id)
    221.     return @name[id]
    222.   end
    223.   
    224.   def short_name(id)
    225.     return @short_name[id]
    226.   end
    227.   
    228.   def desc(id)
    229.     return @desc[id]
    230.   end
    231.   
    232.   def sender(id)
    233.     return @sender[id]
    234.   end
    235.   
    236.   def exp(id)
    237.     return @exp[id]
    238.   end
    239.   
    240.   def gold(id)
    241.     return @gold[id]
    242.   end
    243.   
    244.   def item(id)
    245.     return @item[id]
    246.   end
    247.   
    248.   def location(id)
    249.     return @location[id]
    250.   end
    251.   
    252.   def face(id)
    253.     return @face[id]
    254.   end
    255.   
    256.   def face_id(id)
    257.     return @face_id[id]
    258.   end
    259.   
    260.   def expired(id)
    261.     return @expired[id]
    262.   end
    263.   
    264.   def min_level(id)
    265.     return @min_level[id]
    266.   end
    267.   
    268.   def max_level(id)
    269.     return @max_level[id]
    270.   end
    271.   
    272.   def type(id)
    273.     return @type[id]
    274.   end
    275.   
    276.   def type_icon(id)
    277.     return @type_icon[id]
    278.   end
    279.   
    280.   def setname(id, str)
    281.     @name[id]=str
    282.     @quest_size=id+1 if @quest_size<=id #Tell how many quests there are.
    283.   end
    284.   
    285.   def setshortname(id, str)
    286.     @short_name[id]=str
    287.   end
    288.   
    289.   def setdesc(id, str)
    290.     @desc[id]=str
    291.   end
    292.   
    293.   def setsender(id, str)
    294.     @sender[id]=str
    295.   end
    296.   
    297.   def setexp(id, str)
    298.     @exp[id]=str
    299.   end
    300.   
    301.   def setgold(id, str)
    302.     @gold[id]=str
    303.   end
    304.   
    305.   def setitem(id, str)
    306.     @item[id]=str
    307.   end
    308.   
    309.   def setlocation(id, str)
    310.     @location[id]=str
    311.   end
    312.   
    313.   def setface(id, facename, str)
    314.     @face[id]=facename
    315.     @face_id[id]=str
    316.   end
    317.   
    318.   def setexpired(id, str)
    319.     @expired[id]=str
    320.   end
    321.   
    322.   def set_level(id, str1, str2)
    323.     @min_level[id]=str1
    324.     @max_level[id]=str2
    325.   end
    326.   
    327.   def setmax_level(id, str)
    328.     @max_level[id]=str
    329.   end
    330.   
    331.   def set_type(id, str1, str2)
    332.     @type[id]=str1
    333.     @type_icon[id]=str2
    334.   end
    335.   
    336.   def settype_icon(id, str)
    337.     @type_icon[id]=str
    338.   end
    339.   
    340.   def set_goals(id, g1, g2, g3, g4, g5, g6)
    341.     @goal[id]=g1
    342.     @goal2[id]=g2
    343.     @goal3[id]=g3
    344.     @goal4[id]=g4
    345.     @goal5[id]=g5
    346.     @goal6[id]=g6
    347.   end
    348.   
    349.   def set_goals_min(id, g1, g2, g3, g4, g5, g6)
    350.     @goal_min[id]=g1
    351.     @goal2_min[id]=g2
    352.     @goal3_min[id]=g3
    353.     @goal4_min[id]=g4
    354.     @goal5_min[id]=g5
    355.     @goal6_min[id]=g6
    356.   end
    357.   
    358.   def set_goals_max(id, g1, g2, g3, g4, g5, g6)
    359.     @goal_max[id]=g1
    360.     @goal2_max[id]=g2
    361.     @goal3_max[id]=g3
    362.     @goal4_max[id]=g4
    363.     @goal5_max[id]=g5
    364.     @goal6_max[id]=g6
    365.   end
    366.   
    367.   def add_goal_progress(id, val)
    368.     @goal_min[id]=0 if @goal_min[id]==nil
    369.     @goal_min[id]+=val
    370.   end
    371.   def add_goal2_progress(id, val)
    372.     @goal2_min[id]=0 if @goal2_min[id]==nil
    373.     @goal2_min[id]+=val
    374.   end
    375.   def add_goal3_progress(id, val)
    376.     @goal3_min[id]=0 if @goal3_min[id]==nil
    377.     @goal3_min[id]+=val
    378.   end
    379.   def add_goal4_progress(id, val)
    380.     @goal4_min[id]=0 if @goal4_min[id]==nil
    381.     @goal4_min[id]+=val
    382.   end
    383.   def add_goal5_progress(id, val)
    384.     @goal5_min[id]=0 if @goal5_min[id]==nil
    385.     @goal5_min[id]+=val
    386.   end
    387.   def add_goal6_progress(id, val)
    388.     @goal6_min[id]=0 if @goal6_min[id]==nil
    389.     @goal6_min[id]+=val
    390.   end
    391.   
    392.   def subtract_goal_progress(id, val)
    393.     @goal_min[id]=0 if @goal_min[id]==nil
    394.     @goal_min[id]-=val
    395.   end
    396.   def subtract_goal2_progress(id, val)
    397.     @goal2_min[id]=0 if @goal2_min[id]==nil
    398.     @goal2_min[id]-=val
    399.   end
    400.   def subtract_goal3_progress(id, val)
    401.     @goal3_min[id]=0 if @goal3_min[id]==nil
    402.     @goal3_min[id]-=val
    403.   end
    404.   def subtract_goal4_progress(id, val)
    405.     @goal4_min[id]=0 if @goal4_min[id]==nil
    406.     @goal4_min[id]-=val
    407.   end
    408.   def subtract_goal5_progress(id, val)
    409.     @goal5_min[id]=0 if @goal5_min[id]==nil
    410.     @goal5_min[id]-=val
    411.   end
    412.   def subtract_goal6_progress(id, val)
    413.     @goal6_min[id]=0 if @goal6_min[id]==nil
    414.     @goal6_min[id]-=val
    415.   end
    416.   
    417.   def get_goal(id)
    418.     return @goal[id]
    419.   end
    420.   
    421.   def get_goal2(id)
    422.     return @goal2[id]
    423.   end
    424.   
    425.   def get_goal3(id)
    426.     return @goal3[id]
    427.   end
    428.   
    429.   def get_goal4(id)
    430.     return @goal4[id]
    431.   end
    432.   
    433.   def get_goal5(id)
    434.     return @goal5[id]
    435.   end
    436.   
    437.   def get_goal6(id)
    438.     return @goal6[id]
    439.   end
    440.   
    441.   def get_goal_max(id)
    442.     return @goal_max[id]
    443.   end
    444.   
    445.   def get_goal2_max(id)
    446.     return @goal2_max[id]
    447.   end
    448.   
    449.   def get_goal3_max(id)
    450.     return @goal3_max[id]
    451.   end
    452.   
    453.   def get_goal4_max(id)
    454.     return @goal4_max[id]
    455.   end
    456.   
    457.   def get_goal5_max(id)
    458.     return @goal5_max[id]
    459.   end
    460.   
    461.   def get_goal6_max(id)
    462.     return @goal6_max[id]
    463.   end
    464.   
    465.   def get_goal_min(id)
    466.     return @goal_min[id]
    467.   end
    468.   
    469.   def get_goal2_min(id)
    470.     return @goal2_min[id]
    471.   end
    472.   
    473.   def get_goal3_min(id)
    474.     return @goal3_min[id]
    475.   end
    476.   
    477.   def get_goal4_min(id)
    478.     return @goal4_min[id]
    479.   end
    480.   
    481.   def get_goal5_min(id)
    482.     return @goal5_min[id]
    483.   end
    484.   
    485.   def get_goal6_min(id)
    486.     return @goal6_min[id]
    487.   end
    488.   
    489.   
    490.   def qp(id)
    491.     return @quest_rating[id]
    492.   end
    493.   
    494.   def player_qp
    495.     return @qp
    496.   end
    497.   
    498.   
    499.   
    500.   def amount
    501.     return @quest_size
    502.   end
    503.   
    504. end
    505. #function to set font size in description
    506. def setFont(size)
    507.   $font_size=size
    508. end
    509. def call_quest
    510.   if $menu==0
    511.     $mode=0
    512.     SceneManager.call(Scene_Quest)
    513.   else
    514.     $mode=1
    515.     SceneManager.call(Scene_Quest)
    516.   end
    517. end
    518. #-============================================================================-#
    519. #-[DataManager Alias]-#=======================================================-#
    520. module DataManager
    521.   class << self     
    522.     alias :pq_create_game_objects    :create_game_objects
    523.     alias :pq_make_save_contents     :make_save_contents
    524.     alias :pq_extract_save_contents  :extract_save_contents
    525.   end
    526.   
    527.   def self.create_game_objects
    528.     $game_quests = Game_Quests.new
    529.     pq_create_game_objects
    530.   end
    531.   
    532.   def self.make_save_contents
    533.     contents = pq_make_save_contents
    534.     contents[:quests] = $game_quests
    535.     contents
    536.   end
    537.   
    538.   def self.extract_save_contents(contents)
    539.     pq_extract_save_contents(contents)
    540.     $game_quests = contents[:quests]
    541.   end
    542. end
    543. #-============================================================================-#
    544. #-[Quest Window]-#============================================================-#
    545. class Quest_Window < Window_Base
    546.   def initialize
    547.     super(0, 0, Graphics.width, Graphics.height)
    548.     self.windowskin=Cache.system("QuestWindow") if Use_Windowskin == true
    549.     self.opacity=0
    550.     refresh
    551.   end
    552.   
    553.   def refresh
    554.     if $game_quests.name($quest_id)!=nil
    555.       contents.clear
    556.       contents.fill_rect(0, 0, 96, 96, face_bg)
    557.       draw_face($game_quests.face($quest_id), $game_quests.face_id($quest_id), 0, 0)
    558.       contents.fill_rect(0, 96, 96, line_height, face_bg)
    559.       contents.fill_rect(96, 0, contents.width-96, line_height*4, dark)
    560.       contents.fill_rect(96, 96, contents.width-96, line_height, darker)
    561.       contents.fill_rect(96, 96, contents.width-96, 1, face_bg)
    562.       
    563.       contents.fill_rect(contents.width/2, 96+line_height*2, 1, line_height*2, white)
    564.       contents.fill_rect(contents.width/2, 96+line_height*8, 1, line_height*2, white)
    565.       contents.font.size=Font.default_size
    566.       draw_text(0, 96, 96, line_height, $game_quests.sender($quest_id))
    567.       
    568.       
    569.       text=sprintf("%s", $game_quests.desc($quest_id))
    570.       ypos = 0
    571.       change_color(normal_color)
    572.       contents.font.size=$font_size
    573.       text.split(/\n/).each do |t|
    574.         draw_text(96, ypos, contents.width-96, line_height, t)
    575.         ypos += $font_size
    576.       end
    577.       
    578.       contents.font.size=Font.default_size
    579.       $font_size=Font.default_size
    580.       
    581.       draw_icon($game_quests.type_icon($quest_id), 96, 96)
    582.       
    583.       contents.fill_rect(Graphics.width-300, 96, 100-24, line_height, dark2)
    584.       draw_icon(EXP_Icon, contents.width-300, 96)
    585.       contents.fill_rect(Graphics.width-200, 96, 100-24, line_height, dark2)
    586.       draw_icon(Gold_Icon, contents.width-200, 96)
    587.       contents.fill_rect(Graphics.width-100, 96, 100-24, line_height, dark2)
    588.       draw_icon(Item_Icon, contents.width-100, 96)
    589.       change_color(system_color)
    590.       draw_text(96+24, 96, 96, line_height, $game_quests.type($quest_id))
    591.       draw_text(Graphics.width-300, 96, 96, line_height, $game_quests.exp($quest_id))
    592.       draw_text(Graphics.width-200, 96, 96, line_height, $game_quests.gold($quest_id))
    593.       draw_text(Graphics.width-100, 96, 96, line_height, $game_quests.item($quest_id))
    594.       change_color(normal_color)
    595.       
    596.       contents.fill_rect(0, 96+line_height*2, contents.width/2-24, line_height, dark)
    597.       draw_text(0, 96+line_height*2, 200, line_height, "Min-level:")
    598.       change_color(system_color) if $game_party.members[0].level >= $game_quests.min_level($quest_id)
    599.       change_color(crisis_color) if $game_party.members[0].level < $game_quests.min_level($quest_id)
    600.       draw_text(0, 96+line_height*2, contents.width/2-24, line_height, $game_quests.min_level($quest_id), 2)
    601.       
    602.       change_color(normal_color)
    603.       
    604.       contents.fill_rect(0, 96+line_height*3, contents.width/2-24, line_height, dark)
    605.       draw_text(0, 96+line_height*3, 200, line_height, "Max-level:")
    606.       change_color(system_color) if $game_party.members[0].level <= $game_quests.max_level($quest_id)
    607.       change_color(crisis_color) if $game_party.members[0].level > $game_quests.max_level($quest_id)
    608.       draw_text(0, 96+line_height*3, contents.width/2-24, line_height, $game_quests.max_level($quest_id), 2)
    609.       
    610.       change_color(normal_color)
    611.       contents.fill_rect(contents.width/2+24, 96+line_height*2, 300, line_height, dark)
    612.       draw_text(contents.width/2+24, 96+line_height*2, 300, line_height, "Location:")
    613.       contents.fill_rect(contents.width/2+24, 96+line_height*3, 300, line_height, dark)
    614.       draw_text(contents.width/2+24, 96+line_height*3, 300, line_height, "Expired:")
    615.       change_color(system_color)
    616.       draw_text(contents.width/2-24, 96+line_height*2, contents.width/2+24, line_height, $game_quests.location($quest_id), 2)
    617.       text="Yes" if $game_quests.expired($quest_id)==true
    618.       text="No" if $game_quests.expired($quest_id)==false
    619.       draw_text(contents.width/2-24, 96+line_height*3, contents.width/2+24, line_height, text, 2)
    620.       
    621.       contents.fill_rect(0, 96+line_height*5, 50, line_height, dark)
    622.       draw_text(0, 96+line_height*5, 50, line_height, $game_quests.get_goal($quest_id))
    623.       contents.fill_rect(75, 96+line_height*5, 50, line_height, dark)
    624.       contents.fill_rect(75*2, 96+line_height*5, 50, line_height, dark)
    625.       contents.fill_rect(75*3, 96+line_height*5, 50, line_height, dark)
    626.       contents.fill_rect(75*4, 96+line_height*5, 50, line_height, dark)
    627.       contents.fill_rect(75*5, 96+line_height*5, 50, line_height, dark)
    628.       draw_text(75, 96+line_height*5, 50, line_height, $game_quests.get_goal2($quest_id)) if $game_quests.get_goal2($quest_id) != 0
    629.       draw_text(75*2, 96+line_height*5, 50, line_height, $game_quests.get_goal3($quest_id)) if $game_quests.get_goal3($quest_id) != 0
    630.       draw_text(75*3, 96+line_height*5, 50, line_height, $game_quests.get_goal4($quest_id)) if $game_quests.get_goal4($quest_id) != 0
    631.       draw_text(75*4, 96+line_height*5, 50, line_height, $game_quests.get_goal5($quest_id)) if $game_quests.get_goal5($quest_id) != 0
    632.       draw_text(75*5, 96+line_height*5, 50, line_height, $game_quests.get_goal6($quest_id)) if $game_quests.get_goal6($quest_id) != 0
    633.       
    634.       
    635.       text=sprintf("%d/%d", $game_quests.get_goal_min($quest_id), $game_quests.get_goal_max($quest_id))
    636.       text2=sprintf("%d/%d", $game_quests.get_goal2_min($quest_id), $game_quests.get_goal2_max($quest_id))
    637.       text3=sprintf("%d/%d", $game_quests.get_goal3_min($quest_id), $game_quests.get_goal3_max($quest_id))
    638.       text4=sprintf("%d/%d", $game_quests.get_goal4_min($quest_id), $game_quests.get_goal4_max($quest_id))
    639.       text5=sprintf("%d/%d", $game_quests.get_goal5_min($quest_id), $game_quests.get_goal5_max($quest_id))
    640.       text6=sprintf("%d/%d", $game_quests.get_goal6_min($quest_id), $game_quests.get_goal6_max($quest_id))
    641.       
    642.       change_color(normal_color)
    643.       
    644.       draw_text(0, 96+line_height*6, 50, line_height, text) if $game_quests.get_goal($quest_id) != 0
    645.       draw_text(75*1, 96+line_height*6, 50, line_height, text2) if $game_quests.get_goal2($quest_id) != 0
    646.       draw_text(75*2, 96+line_height*6, 50, line_height, text3) if $game_quests.get_goal3($quest_id) != 0
    647.       draw_text(75*3, 96+line_height*6, 50, line_height, text4) if $game_quests.get_goal4($quest_id) != 0
    648.       draw_text(75*4, 96+line_height*6, 50, line_height, text5) if $game_quests.get_goal5($quest_id) != 0
    649.       draw_text(75*5, 96+line_height*6, 50, line_height, text6) if $game_quests.get_goal6($quest_id) != 0
    650.       
    651.       change_color(system_color)
    652.       
    653.       contents.fill_rect(0, 96+line_height*8, contents.width/2-24, line_height*2, dark)
    654.       contents.fill_rect(contents.width/2+24, 96+line_height*8, contents.width/2-24, line_height*2, dark)
    655.       
    656.       text="Quest Worth:"
    657.       draw_text(0, 96+line_height*8, Graphics.width, line_height, text)
    658.       
    659.       draw_text(0, 96+line_height*9, Graphics.width, line_height, "Quest Complete:")
    660.       
    661.       text=sprintf("%s earned:", QP_Name)
    662.       draw_text(contents.width/2+24, 96+line_height*8, contents.width/2, line_height, text)
    663.       draw_text(contents.width/2+24, 96+line_height*9, contents.width/2, line_height, "Quests Completed:")
    664.       
    665.       
    666.       change_color(normal_color)
    667.       
    668.       text=sprintf("%d %s", $game_quests.qp($quest_id), QP_Name)
    669.       draw_text(0, 96+line_height*8, contents.width/2-24, line_height, text, 2)
    670.       
    671.       text=sprintf("Yes") if $game_quests.check_complete($quest_id)
    672.       text=sprintf("No") if !$game_quests.check_complete($quest_id)
    673.       
    674.       draw_text(0, 96+line_height*9, contents.width/2-24, line_height, text, 2)
    675.       draw_text(contents.width/2+24, 96+line_height*8, contents.width/2+24, line_height, $game_quests.player_qp, 2)
    676.       text=sprintf("%d", $game_quests.get_completed_quests)
    677.       draw_text(contents.width/2-24, 96+line_height*9, contents.width/2+24, line_height, text, 2)
    678.       
    679.       contents.font.size=12
    680.       draw_text(0, line_height*16-4, Graphics.width, 12, "ProQuest by TheUnproPro")
    681.     end
    682.       
    683.   end
    684.   
    685.   def white
    686.     color=Color.new(255, 255, 255, 150)
    687.     color
    688.   end
    689.   
    690.   def dark
    691.     color=Color.new(0, 0, 0, 50)
    692.     color
    693.   end
    694.   
    695.   def dark2
    696.     color=Color.new(0, 0, 0, 120)
    697.     color
    698.   end
    699.   
    700.   def face_bg
    701.     color=Color.new(0, 0, 0, 100)
    702.     color
    703.   end
    704.   
    705.   def darker
    706.     color=Color.new(0, 0, 55, 75)
    707.     color
    708.   end
    709.   
    710.   def update
    711.     super
    712.     if $do_refresh == 1
    713.       $game_quests.setface(01, $game_quests.face($quest_id), 3)
    714.       contents.clear
    715.       refresh
    716.       $do_refresh = 0
    717.     end
    718.   end
    719. end
    720. #-============================================================================-#
    721. #-[Empty Windows]-#===========================================================-#
    722. class Dummy_Window < Window_Base
    723.   def initialize(x, y, width, height)
    724.     super(x, y, width, height)
    725.     self.windowskin=Cache.system("QuestWindow") if Use_Windowskin == true
    726.     refresh
    727.   end
    728.   
    729.   def refresh
    730.    
    731.   end
    732.   
    733.   def update_tone
    734.     if Use_Windowskin == true
    735.       self.tone.set(brown)
    736.     else
    737.       self.tone.set($game_system.window_tone)
    738.     end
    739.   end
    740.   
    741.   def brown
    742.     if Use_Windowskin == true
    743.       tone=Tone.new(Window_Color_r, Window_Color_g, Window_Color_b, 122)
    744.       tone
    745.     else
    746.     end
    747.   end
    748. end
    749. #-============================================================================-#
    750. #-[Quest Accept Window]-#=====================================================-#
    751. class Accept_Quests < Window_HorzCommand
    752.   def make_command_list
    753.     if $game_quests.accept($quest_id)==true && $game_quests.check_complete($quest_id)!=true
    754.       add_command("Stop Quest", :stop)
    755.       add_command("Back", :decline)
    756.     end
    757.     if $game_quests.accept($quest_id)!=true && $game_quests.check_complete($quest_id)!=true
    758.       add_command("Accept", :accept, can_accept)
    759.       add_command("Decline", :decline)
    760.     end
    761.     if $game_quests.check_complete($quest_id) == true
    762.       add_command("Complete", :complete)
    763.       add_command("Back", :decline, $game_quests.check_complete($quest_id)==false)
    764.     end
    765.   end
    766.   
    767.   def window_width
    768.     return Graphics.width
    769.   end
    770.   
    771.   def can_accept
    772.     if $game_quests.min_level($quest_id) != nil && $game_quests.max_level($quest_id) != nil
    773.       if $game_party.members[0].level <= $game_quests.max_level($quest_id) && $game_party.members[0].level>= $game_quests.min_level($quest_id)
    774.         return true
    775.       else
    776.         return false
    777.       end
    778.     end
    779.   end
    780. end
    781. #-============================================================================-#
    782. #-[Quest Display Window]-#====================================================-#
    783. class Quest_Display_Choices < Window_HorzCommand
    784.   def make_command_list
    785.     $i=0
    786.     while $i<$game_quests.quest_size+1
    787.       text=sprintf("%s", $error_msg) if $game_quests.accept($i)==nil
    788.       text=sprintf("%s", $game_quests.name($i)) if $game_quests.accept($i)!=nil
    789.       add_command(text, :cmd, $game_quests.accept($i)==true)
    790.       $i+=1
    791.     end
    792.   end
    793.   
    794.   def window_width
    795.     return Graphics.width
    796.   end
    797.   
    798.   def update
    799.     super
    800.     if $game_quests.name(index) != nil
    801.       $do_refresh = 1 if $quest_id != index
    802.       $quest_id=index
    803.     end
    804.   end
    805. end
    806. #-============================================================================-#
    807. #-[Quest help for map]-#======================================================-#
    808. class Window_QuestHelp < Window_Base
    809.   def initialize
    810.     super(0, 0, Graphics.width, Graphics.height)
    811.     self.opacity=0
    812.     self.hide
    813.     self.show
    814.    
    815.     refresh
    816.   end
    817.   
    818.   def refresh
    819.     contents.clear
    820.     if $game_quests.quests_enabled == true && $show_quest==1
    821.       size=75 if $game_quests.get_goal($selected_quest) != 0
    822.       size=75*2 if $game_quests.get_goal2($selected_quest) != 0
    823.       size=75*3 if $game_quests.get_goal3($selected_quest) != 0
    824.       size=75*4 if $game_quests.get_goal4($selected_quest) != 0
    825.       size=75*5 if $game_quests.get_goal5($selected_quest) != 0
    826.       size=75*6 if $game_quests.get_goal6($selected_quest) != 0
    827.       contents.fill_rect(0, 0, size, line_height*4, darker)
    828.       contents.fill_rect(0, 0, 50, line_height, dark) if $game_quests.get_goal($selected_quest) != 0
    829.       draw_text(0, 0, 50, line_height, $game_quests.get_goal($selected_quest))
    830.       contents.font.size=18
    831.       draw_text(0, line_height*3, Graphics.width, line_height, "Q-Close")
    832.       draw_text(0, line_height*2, Graphics.width, line_height, $game_quests.name($selected_quest))
    833.       contents.font.size=Font.default_size
    834.       contents.fill_rect(75, 0, 50, line_height, dark) if $game_quests.get_goal2($selected_quest) != 0
    835.       contents.fill_rect(75*2, 0, 50, line_height, dark) if $game_quests.get_goal3($selected_quest) != 0
    836.       contents.fill_rect(75*3, 0, 50, line_height, dark) if $game_quests.get_goal4($selected_quest) != 0
    837.       contents.fill_rect(75*4, 0, 50, line_height, dark) if $game_quests.get_goal5($selected_quest) != 0
    838.       contents.fill_rect(75*5, 0, 50, line_height, dark) if $game_quests.get_goal6($selected_quest) != 0
    839.       draw_text(75, 0, 50, line_height, $game_quests.get_goal2($selected_quest)) if $game_quests.get_goal2($selected_quest) != 0
    840.       draw_text(75*2, 0, 50, line_height, $game_quests.get_goal3($selected_quest)) if $game_quests.get_goal3($selected_quest) != 0
    841.       draw_text(75*3, 0, 50, line_height, $game_quests.get_goal4($selected_quest)) if $game_quests.get_goal4($selected_quest) != 0
    842.       draw_text(75*4, 0, 50, line_height, $game_quests.get_goal5($selected_quest)) if $game_quests.get_goal5($selected_quest) != 0
    843.       draw_text(75*5, 0, 50, line_height, $game_quests.get_goal6($selected_quest)) if $game_quests.get_goal6($selected_quest) != 0
    844.    
    845.    
    846.       text=sprintf("%d/%d", $game_quests.get_goal_min($selected_quest), $game_quests.get_goal_max($selected_quest))
    847.       text2=sprintf("%d/%d", $game_quests.get_goal2_min($selected_quest), $game_quests.get_goal2_max($selected_quest))
    848.       text3=sprintf("%d/%d", $game_quests.get_goal3_min($selected_quest), $game_quests.get_goal3_max($selected_quest))
    849.       text4=sprintf("%d/%d", $game_quests.get_goal4_min($selected_quest), $game_quests.get_goal4_max($selected_quest))
    850.       text5=sprintf("%d/%d", $game_quests.get_goal5_min($selected_quest), $game_quests.get_goal5_max($selected_quest))
    851.       text6=sprintf("%d/%d", $game_quests.get_goal6_min($selected_quest), $game_quests.get_goal6_max($selected_quest))
    852.    
    853.       change_color(normal_color)
    854.    
    855.       draw_text(0, line_height, 50, line_height, text) if $game_quests.get_goal($selected_quest) != 0
    856.       draw_text(75*1, line_height, 50, line_height, text2) if $game_quests.get_goal2($selected_quest) != 0
    857.       draw_text(75*2, line_height, 50, line_height, text3) if $game_quests.get_goal3($selected_quest) != 0
    858.       draw_text(75*3, line_height, 50, line_height, text4) if $game_quests.get_goal4($selected_quest) != 0
    859.       draw_text(75*4, line_height, 50, line_height, text5) if $game_quests.get_goal5($selected_quest) != 0
    860.       draw_text(75*5, line_height, 50, line_height, text6) if $game_quests.get_goal6($selected_quest) != 0
    861.     end
    862.   end
    863.   
    864.   def dark
    865.     color=Color.new(0, 0, 0, 50)
    866.     color
    867.   end
    868.   def darker
    869.     color=Color.new(50, 50, 50, 50)
    870.     color
    871.   end
    872.   
    873.   def update
    874.     super
    875.     refresh
    876.     if Input.trigger?(:L)
    877.       Sound.play_cancel if $show_quest!=0
    878.       $show_quest=0
    879.     end
    880.   end
    881.   
    882. end
    883. #-============================================================================-#
    884. #-[Quest Scene]-#=============================================================-#
    885. class Scene_Quest < Scene_MenuBase
    886.   def start
    887.     super
    888.     make_windows
    889.   end
    890.   
    891.   def make_windows
    892.     @dummy1=Dummy_Window.new(0, 0, Graphics.width, 24*6)
    893.     @dummy2=Dummy_Window.new(0, 96+48, Graphics.width, 24*3)
    894.     @dummy3=Dummy_Window.new(0, 96+24+96, Graphics.width, 24*3)
    895.     @dummy4=Dummy_Window.new(0, 96+96+96, Graphics.width, 24*3)
    896.     @dummy5=Dummy_Window.new(0, 96+96+96+24*3, Graphics.width, 24*2+8)
    897.     @info=Quest_Window.new
    898.    
    899.     if $mode==0
    900.       @choices=Accept_Quests.new(0, 24*15-4)
    901.       @choices.opacity=0
    902.    
    903.       @choices.set_handler(:accept, method(:accept))
    904.       @choices.set_handler(:decline, method(:decline))
    905.       @choices.set_handler(:cancel, method(:decline)) if $game_quests.check_complete($quest_id)!=true
    906.       @choices.set_handler(:stop, method(:stop))
    907.       @choices.set_handler(:complete, method(:complete))
    908.     end
    909.    
    910.     if $mode == 1
    911.       @choices=Quest_Display_Choices.new(0, 24*15-4)
    912.       @choices.opacity=0
    913.    
    914.       @choices.set_handler(:cmd, method(:cmd))
    915.       @choices.set_handler(:cancel, method(:decline))
    916.     end
    917.   end
    918.   
    919.   def cmd
    920.     $selected_quest=@choices.index
    921.     $show_quest=1
    922.     $mode=0
    923.     return_scene
    924.   end
    925.   def complete
    926.     $show_quest=0
    927.     return_scene
    928.     SceneManager.call(Scene_Complete)
    929.   end
    930.   
    931.   def accept
    932.     $game_quests.do_accept($quest_id)
    933.     return_scene
    934.   end
    935.   
    936.   def stop
    937.     $game_quests.do_un_accept($quest_id)
    938.     $show_quest=0
    939.     $mode=0
    940.     return_scene
    941.   end
    942.   
    943.   def decline
    944.     $menu=0
    945.     $mode=0
    946.     return_scene
    947.   end
    948. end
    949. #-============================================================================-#
    950. #-[Add command to menu]-#=====================================================-#
    951. class Window_MenuCommand < Window_Command
    952.   
    953.   alias quest_add_original_commands add_original_commands
    954.   def add_original_commands
    955.     quest_add_original_commands
    956.     add_command("Quests", :quests, $game_quests.quests_enabled)
    957.   end
    958.   
    959. end
    960. #-============================================================================-#
    961. #-[Add command to menu]-#=====================================================-#
    962. class Scene_Menu < Scene_MenuBase
    963.   alias quest_create_command_window create_command_window
    964.   def create_command_window
    965.     quest_create_command_window
    966.     @command_window.set_handler(:quests, method(:quests))
    967.   end
    968.   
    969.   def quests
    970.     $menu=1
    971.     $mode=1
    972.     $quest_id=0
    973.     SceneManager.call(Scene_Quest)
    974.   end
    975. end
    976. #-============================================================================-#
    977. #-[Add window to map]-#=======================================================-#
    978. class Scene_Map < Scene_Base
    979.   alias quest_create_all_windows create_all_windows
    980.   def create_all_windows
    981.     quest_create_all_windows
    982.    
    983.     @help_window=Window_QuestHelp.new
    984.   end
    985. end
    986. class Window_Complete < Window_Base
    987.   def initialize
    988.     super(0, 0, Graphics.width, Graphics.height)
    989.     self.opacity=0
    990.     Audio.me_play(Complete_ME, Complete_ME_Volume, Complete_ME_Pitch)
    991.     refresh
    992.   end
    993.   
    994.   def refresh
    995.     contents.clear
    996.     contents.font.size=32
    997.     $game_quests.do_un_accept($quest_id)
    998.     change_color(system_color)
    999.     draw_text(0, 0, Graphics.width, 32, "Quest Complete!", 1)
    1000.     change_color(normal_color)
    1001.     contents.font.size=Font.default_size
    1002.     text=sprintf("You earned %d %s and %d %s", $game_quests.exp($quest_id), $exp_name, $game_quests.gold($quest_id), $gold_name)
    1003.     draw_text(0, line_height+32, Graphics.width, line_height, text)
    1004.     text=sprintf("Items gained: %s", $game_quests.item($quest_id))
    1005.     draw_text(0, line_height*2+32, Graphics.width, line_height, text)
    1006.     draw_text(0, line_height*3+32, Graphics.width, line_height, "Press confirm key to continue.")
    1007.   end
    1008. end
    1009. #-============================================================================-#
    1010. #-[Quest Complete Scene]-#====================================================-#
    1011. class Scene_Complete < Scene_MenuBase
    1012.   def start
    1013.     super
    1014.     make_win
    1015.   end
    1016.   
    1017.   def make_win
    1018.     @window=Window_Complete.new
    1019.     $game_party.all_members.each do |actor|
    1020.       actor.gain_exp($game_quests.exp($quest_id))
    1021.     end
    1022.     $game_party.gain_gold($game_quests.gold($quest_id))
    1023.   end
    1024.   
    1025.   def update
    1026.     super
    1027.     if Input.trigger?(:C)
    1028.       return_scene
    1029.     end
    1030.   end
    1031. end
    复制代码






            How to use: (Event - Script)

    SpoilerSet up quest: (With ID of 1 by default, change 1 to 0 if first quest.)


                            $quest_id=1
                            $game_quests.setname(01, "Veggies!")
                            $game_quests.setsender(01, "Derik")
                            $game_quests.setface(01, "People1", 3)
                            $game_quests.set_type(01, "Food", 298)
                            $game_quests.set_level(01, 1, 5)
                            $game_quests.setexp(01, 25)
                            $game_quests.setgold(01, 50)
                            $game_quests.setitem(01, "Sample")
                            $game_quests.setlocation(01, "Eastern Rosia")
                            $game_quests.setexpired(01, false)
                            #setFont(18)
                            $game_quests.setdesc(01, "This is the craziest thing ever. I got this awesome
                            recipe for some kind of stew, so I decided I'd like to try and make it.
                            The problem is, I need the vegetables to make it! Do you think you
                            can get me them?")


                            $game_quests.set_goals(01, "Carrots", 0, "Onions", "Basil", "Ginger", "Beats")
                            $game_quests.set_goals_min(01, 0, 0, 0, 0, 0, 0)
                            $game_quests.set_goals_max(01, 1, 3, 5, 12, 2, 3)


                            $game_quests.set_quest_points(01, 5)


                            SceneManager.call(Scene_Quest)


                            Add progress:
                            $game_quests.add_goal_progress(1, 1)
                            $game_quests.add_goal2_progress(1, 3)
                            $game_quests.add_goal3_progress(1, 5)
                            $game_quests.add_goal4_progress(1, 12)
                            $game_quests.add_goal5_progress(1, 2)
                            $game_quests.add_goal6_progress(1, 3)
                             






    本贴来自国际rpgmaker官方论坛作者:TheUnproPro处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/quest-script.59214/

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-8-17 23:22 , Processed in 0.149025 second(s), 53 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表