Fix for TR quests not registered in quest log

This commit is contained in:
infinitefusion
2025-02-01 00:20:45 -05:00
parent 71894707b1
commit e7d2330a2f
10 changed files with 79 additions and 20 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -5,8 +5,8 @@
#==============================================================================# #==============================================================================#
module Settings module Settings
# The version of your game. It has to adhere to the MAJOR.MINOR.PATCH format. # The version of your game. It has to adhere to the MAJOR.MINOR.PATCH format.
GAME_VERSION = '6.4.5' GAME_VERSION = '6.4.6'
GAME_VERSION_NUMBER = "6.4.5" GAME_VERSION_NUMBER = "6.4.6"
LATEST_GAME_RELEASE = "6.4" LATEST_GAME_RELEASE = "6.4"
POKERADAR_LIGHT_ANIMATION_RED_ID = 17 POKERADAR_LIGHT_ANIMATION_RED_ID = 17

View File

@@ -1640,3 +1640,46 @@ def fixMissedHMs()
pbReceiveItem(:HM10) pbReceiveItem(:HM10)
end end
end end
def fixFinishedRocketQuests()
fix_broken_TR_quests()
var_tr_missions_cerulean = 288
switch_tr_mission_cerulean_4 = 1116
switch_tr_mission_celadon_1 = 1084
switch_tr_mission_celadon_2 = 1086
switch_tr_mission_celadon_3 = 1088
switch_tr_mission_celadon_4 = 1110
switch_pinkan_done = 1119
nb_cerulean_missions = pbGet(var_tr_missions_cerulean)
finishTRQuest("tr_cerulean_1",:SUCCESS,true) if nb_cerulean_missions >= 1 && !pbCompletedQuest?("tr_cerulean_1")
echoln pbCompletedQuest?("tr_cerulean_1")
finishTRQuest("tr_cerulean_2",:SUCCESS,true) if nb_cerulean_missions >= 2 && !pbCompletedQuest?("tr_cerulean_2")
finishTRQuest("tr_cerulean_3",:SUCCESS,true) if nb_cerulean_missions >= 3 && !pbCompletedQuest?("tr_cerulean_3")
finishTRQuest("tr_cerulean_4",:SUCCESS,true) if $game_switches[switch_tr_mission_cerulean_4] && !pbCompletedQuest?("tr_cerulean_4")
finishTRQuest("tr_celadon_1",:SUCCESS,true) if $game_switches[switch_tr_mission_celadon_1] && !pbCompletedQuest?("tr_celadon_1")
finishTRQuest("tr_celadon_2",:SUCCESS,true) if $game_switches[switch_tr_mission_celadon_2] && !pbCompletedQuest?("tr_celadon_2")
finishTRQuest("tr_celadon_3",:SUCCESS,true) if $game_switches[switch_tr_mission_celadon_3] && !pbCompletedQuest?("tr_celadon_3")
finishTRQuest("tr_celadon_4",:SUCCESS,true) if $game_switches[switch_tr_mission_celadon_4] && !pbCompletedQuest?("tr_celadon_4")
finishTRQuest("tr_pinkan",:SUCCESS,true) if $game_switches[switch_pinkan_done] && !pbCompletedQuest?("tr_pinkan")
end
def fix_broken_TR_quests()
for trainer_quest in $Trainer.quests
if trainer_quest.id ==0 #tr quests were all set to ID 0 instead of their real ID in v 6.4.0
for rocket_quest_id in TR_QUESTS.keys
rocket_quest = TR_QUESTS[rocket_quest_id]
next if !rocket_quest
if trainer_quest.name == rocket_quest.name
trainer_quest.id = rocket_quest_id
end
end
end
end
end

View File

@@ -92,7 +92,7 @@ QUESTS = {
#Cerulean hotel #Cerulean hotel
3 => Quest.new(3, "Playing Cupid", "A boy in Cerulean City wants you bring a love letter to a Pokémon Breeder named Maude. She's probably somewhere in one of the routes near Cerulean City", QuestBranchHotels, "BW (18)", "Cerulean City", HotelQuestColor), 3 => Quest.new(3, "Playing Cupid", "A boy in Cerulean City wants you bring a love letter to a Pokémon Breeder named Maude. She's probably somewhere in one of the routes near Cerulean City", QuestBranchHotels, "BW (18)", "Cerulean City", HotelQuestColor),
4 => Quest.new(4, "Fishing for Sole", "A fisherman wants you to fish up an old boot. Hook it up with the old rod in any body of water.", QuestBranchHotels, "BW (71)", "Cerulean City", HotelQuestColor), 4 => Quest.new(4, "Fishing for Sole", "A fisherman wants you to fish up an old boot. Hook it up with the old rod in any body of water.", QuestBranchHotels, "BW (71)", "Cerulean City", HotelQuestColor),
5 => Quest.new(5, "Johto Pokémon", "An traveler in the PokéMart wants you to show him a Pokémon native to the Johto region.", QuestBranchHotels, "traveler_johto", "Cerulean City", HotelQuestColor), 5 => Quest.new(5, "Johto Pokémon", "A traveler in the PokéMart wants you to show him a Pokémon native to the Johto region.", QuestBranchHotels, "traveler_johto", "Cerulean City", HotelQuestColor),
"cerulean_2" => Quest.new(5, "Type Experts", "Defeat all of the Type Experts scattered around the Kanto region (#{pbGet(VAR_TYPE_EXPERTS_BEATEN)}/#{TOTAL_NB_TYPE_EXPERTS})", QuestBranchHotels, "expert-normal", "Cerulean City", HotelQuestColor), "cerulean_2" => Quest.new(5, "Type Experts", "Defeat all of the Type Experts scattered around the Kanto region (#{pbGet(VAR_TYPE_EXPERTS_BEATEN)}/#{TOTAL_NB_TYPE_EXPERTS})", QuestBranchHotels, "expert-normal", "Cerulean City", HotelQuestColor),
#Route 24 #Route 24
@@ -267,6 +267,10 @@ end
def pbSetQuest(id, completed) def pbSetQuest(id, completed)
$Trainer.quests = [] if $Trainer.quests.class == NilClass $Trainer.quests = [] if $Trainer.quests.class == NilClass
for q in $Trainer.quests for q in $Trainer.quests
echoln id
echoln q.id
echoln q.completed
echoln "----"
q.completed = completed if q.id == id q.completed = completed if q.id == id
end end
end end
@@ -328,12 +332,26 @@ class Questlog
@box = 0 @box = 0
@completed = [] @completed = []
@ongoing = [] @ongoing = []
echoln "BEFORE:"
for trainer_quest in $Trainer.quests
echoln "id: #{trainer_quest.id} completed: #{trainer_quest.completed}"
end
echoln "----------"
fix_broken_TR_quests()
for q in $Trainer.quests for q in $Trainer.quests
@ongoing << q if !q.completed && @ongoing.include?(q) @ongoing << q if !q.completed && @ongoing.include?(q)
@completed << q if q.completed && @completed.include?(q) @completed << q if q.completed && @completed.include?(q)
end end
echoln "AFTER:"
for trainer_quest in $Trainer.quests
echoln "id: #{trainer_quest.id} completed: #{trainer_quest.completed}"
end
for q in $Trainer.quests for q in $Trainer.quests
echoln "#{q.id}: #{q.completed}"
@ongoing << q if !q.completed @ongoing << q if !q.completed
@completed << q if q.completed @completed << q if q.completed
end end
@@ -376,6 +394,7 @@ class Questlog
pbUpdate pbUpdate
end end
def pbUpdate def pbUpdate
@frame = 0 @frame = 0
loop do loop do
@@ -385,13 +404,13 @@ class Questlog
if @scene == 0 if @scene == 0
break if Input.trigger?(Input::B) break if Input.trigger?(Input::B)
pbList(@sel_one) if Input.trigger?(Input::C) pbList(@sel_one) if Input.trigger?(Input::C)
pbSwitch(:DOWN) if Input.trigger?(Input::DOWN) pbSwitch(:DOWN) if Input.press?(Input::DOWN)
pbSwitch(:UP) if Input.trigger?(Input::UP) pbSwitch(:UP) if Input.trigger?(Input::UP)
end end
if @scene == 1 if @scene == 1
pbMain if Input.trigger?(Input::B) pbMain if Input.trigger?(Input::B)
pbMove(:DOWN) if Input.trigger?(Input::DOWN) pbMove(:DOWN) if Input.press?(Input::DOWN)
pbMove(:UP) if Input.trigger?(Input::UP) pbMove(:UP) if Input.press?(Input::UP)
pbLoad(0) if Input.trigger?(Input::C) pbLoad(0) if Input.trigger?(Input::C)
pbArrows pbArrows
end end
@@ -640,7 +659,6 @@ class Questlog
end end
def pbMove(dir) def pbMove(dir)
pbWait(1)
if dir == :DOWN if dir == :DOWN
return if @sel_two == @ongoing.size - 1 && @mode == 0 return if @sel_two == @ongoing.size - 1 && @mode == 0
return if @sel_two == @completed.size - 1 && @mode == 1 return if @sel_two == @completed.size - 1 && @mode == 1
@@ -743,10 +761,11 @@ class Questlog
end end
end end
end end
pbWait(4)
end end
def pbList(id) def pbList(id)
pbWait(1) pbWait(2)
@sel_two = 0 @sel_two = 0
@page = 0 @page = 0
@scene = 1 @scene = 1

View File

@@ -29,12 +29,9 @@ def acceptTRQuest(id, show_description = true)
end end
def addRocketQuest(id) def addRocketQuest(id)
echoln $Trainer.quests.length
$Trainer.quests = [] if $Trainer.quests.class == NilClass $Trainer.quests = [] if $Trainer.quests.class == NilClass
quest = TR_QUESTS[id] quest = TR_QUESTS[id]
$Trainer.quests << quest if quest $Trainer.quests << quest if quest
echoln $Trainer.quests.length
end end
def showNewTRMissionMessage(title, description, show_description) def showNewTRMissionMessage(title, description, show_description)
@@ -65,17 +62,17 @@ def finishTRQuest(id, status, silent = false)
end end
TR_QUESTS = { TR_QUESTS = {
"tr_cerulean_1" => Quest.new(0, "Creepy Crawlies", "The Team Rocket Captain has tasked you with clearing the bug infestation in the temporary Rocket HQ in Cerulean City", QuestBranchRocket, "rocket_petrel", "Cerulean City", TRQuestColor), "tr_cerulean_1" => Quest.new("tr_cerulean_1", "Creepy Crawlies", "The Team Rocket Captain has tasked you with clearing the bug infestation in the temporary Rocket HQ in Cerulean City", QuestBranchRocket, "rocket_petrel", "Cerulean City", TRQuestColor),
"tr_cerulean_2" => Quest.new(0, "No Fishing Zone", "Intimidate the fishermen at Nugget Bridge until they leave the area.", QuestBranchRocket, "rocket_petrel", "Cerulean City", TRQuestColor), "tr_cerulean_2" => Quest.new("tr_cerulean_2", "No Fishing Zone", "Intimidate the fishermen at Nugget Bridge until they leave the area.", QuestBranchRocket, "rocket_petrel", "Cerulean City", TRQuestColor),
"tr_cerulean_3" => Quest.new(0, "Disobedient Pokémon", "Bring back the Pokémon given by the Team Rocket Captain fainted to teach it a lesson.", QuestBranchRocket, "rocket_petrel", "Cerulean City", TRQuestColor), "tr_cerulean_3" => Quest.new("tr_cerulean_3", "Disobedient Pokémon", "Bring back the Pokémon given by the Team Rocket Captain fainted to teach it a lesson.", QuestBranchRocket, "rocket_petrel", "Cerulean City", TRQuestColor),
"tr_cerulean_4" => Quest.new(0, "Gran Theft Pokémon!", "Follow Petrel and go steal a rare Pokémon from a young girl.", QuestBranchRocket, "rocket_petrel", "Cerulean City", TRQuestColor), "tr_cerulean_4" => Quest.new("tr_cerulean_4", "Gran Theft Pokémon!", "Follow Petrel and go steal a rare Pokémon from a young girl.", QuestBranchRocket, "rocket_petrel", "Cerulean City", TRQuestColor),
"tr_celadon_1" => Quest.new(0, "Supplying the new grunts", "Catch 4 Pokémon with Rocket Balls in the outskirts of Celadon City.", QuestBranchRocket, "rocket_archer", "Celadon City", TRQuestColor), "tr_celadon_1" => Quest.new("tr_celadon_1", "Supplying the new grunts", "Catch 4 Pokémon with Rocket Balls in the outskirts of Celadon City.", QuestBranchRocket, "rocket_archer", "Celadon City", TRQuestColor),
"tr_celadon_2" => Quest.new(0, "Interception!", "Intercept the TMs shipment to the Celadon Store and pose as the delivery person to deliver fake TMs.", QuestBranchRocket, "rocket_archer", "Celadon City", TRQuestColor), "tr_celadon_2" => Quest.new("tr_celadon_2", "Interception!", "Intercept the TMs shipment to the Celadon Store and pose as the delivery person to deliver fake TMs.", QuestBranchRocket, "rocket_archer", "Celadon City", TRQuestColor),
"tr_celadon_3" => Quest.new(0, "Pokémon Collector", "Go meet a Pokémon collector on Route 22, near Viridian City and get his rare Pokémon.", QuestBranchRocket, "rocket_archer", "Celadon City", TRQuestColor), "tr_celadon_3" => Quest.new( "tr_celadon_3", "Pokémon Collector", "Go meet a Pokémon collector on Route 22, near Viridian City and get his rare Pokémon.", QuestBranchRocket, "rocket_archer", "Celadon City", TRQuestColor),
"tr_celadon_4" => Quest.new(0, "Operation Shutdown", "The Team Rocket HQ is being raided! Regroup with the rest of the grunts in Goldenrod Tunnel!", QuestBranchRocket, "rocket_archer", "Goldenrod City", TRQuestColor), "tr_celadon_4" => Quest.new("tr_celadon_4", "Operation Shutdown", "The Team Rocket HQ is being raided! Regroup with the rest of the grunts in Goldenrod Tunnel!", QuestBranchRocket, "rocket_archer", "Goldenrod City", TRQuestColor),
"tr_pinkan" => Quest.new(0, "Pinkan Island!", "Help Team Rocket with a heist on a Pokémon nature preserve!", QuestBranchRocket, "rocket_archer", "Goldenrod City", TRQuestColor), "tr_pinkan" => Quest.new("tr_pinkan", "Pinkan Island!", "Help Team Rocket with a heist on a Pokémon nature preserve!", QuestBranchRocket, "rocket_archer", "Goldenrod City", TRQuestColor),
} }

Binary file not shown.