diff --git a/Data/CommonEvents.rxdata b/Data/CommonEvents.rxdata index 89c2c5f78..08a21f5eb 100644 Binary files a/Data/CommonEvents.rxdata and b/Data/CommonEvents.rxdata differ diff --git a/Data/Map009.rxdata b/Data/Map009.rxdata index 911a5217f..43861883c 100644 Binary files a/Data/Map009.rxdata and b/Data/Map009.rxdata differ diff --git a/Data/Map019.rxdata b/Data/Map019.rxdata index d6042df59..b2509d85c 100644 Binary files a/Data/Map019.rxdata and b/Data/Map019.rxdata differ diff --git a/Data/Map035.rxdata b/Data/Map035.rxdata index 0c3faeec0..38914733e 100644 Binary files a/Data/Map035.rxdata and b/Data/Map035.rxdata differ diff --git a/Data/Map107.rxdata b/Data/Map107.rxdata index 1b1b61db4..1265cd790 100644 Binary files a/Data/Map107.rxdata and b/Data/Map107.rxdata differ diff --git a/Data/Map159.rxdata b/Data/Map159.rxdata index 162eb6cc4..5a16b8232 100644 Binary files a/Data/Map159.rxdata and b/Data/Map159.rxdata differ diff --git a/Data/Map325.rxdata b/Data/Map325.rxdata index 422bad301..61b75295f 100644 Binary files a/Data/Map325.rxdata and b/Data/Map325.rxdata differ diff --git a/Data/Map338.rxdata b/Data/Map338.rxdata index 4d880964d..8ca627265 100644 Binary files a/Data/Map338.rxdata and b/Data/Map338.rxdata differ diff --git a/Data/Map439.rxdata b/Data/Map439.rxdata index cd93cb54a..770be993f 100644 Binary files a/Data/Map439.rxdata and b/Data/Map439.rxdata differ diff --git a/Data/Map778.rxdata b/Data/Map778.rxdata index f1a0563c1..08b3d3377 100644 Binary files a/Data/Map778.rxdata and b/Data/Map778.rxdata differ diff --git a/Data/MapInfos.rxdata b/Data/MapInfos.rxdata index f73ad9892..a9f8f5f70 100644 Binary files a/Data/MapInfos.rxdata and b/Data/MapInfos.rxdata differ diff --git a/Data/Scripts/052_AddOns/GameplayUtils.rb b/Data/Scripts/052_AddOns/GameplayUtils.rb index 288165fcf..cd6aad64d 100644 --- a/Data/Scripts/052_AddOns/GameplayUtils.rb +++ b/Data/Scripts/052_AddOns/GameplayUtils.rb @@ -1561,89 +1561,6 @@ def turnPlayerTowardsEvent(event) end end -def showQuestStatistics(eventId,includeRocketQuests=false) - quests_accepted = [] - quests_in_progress=[] - quests_completed=[] - for quest in $Trainer.quests - next if quest.npc == QuestBranchRocket && !includeRocketQuests - quests_accepted<= reward.nb_quests && !$PokemonGlobal.questRewardsObtained.include?(reward.item) - end - - #Calculate how many until next reward - next_reward = get_next_quest_reward - nb_to_next_reward = next_reward.nb_quests - nb_quests_completed - rewards_to_give << next_reward if nb_to_next_reward <=0 #for compatibility with old system - - - - #Give rewards - for reward in rewards_to_give - if !reward.can_have_multiple && $PokemonBag.pbQuantity(reward.item) >= 1 - $PokemonGlobal.questRewardsObtained << reward.item - next - end - pbCallBub(2, eventId) - pbMessage("Also, there's one more thing...") - pbCallBub(2, eventId) - pbMessage("As a gift for having helped so many people, I want to give you this.") - pbReceiveItem(reward.item, reward.quantity) - $PokemonGlobal.questRewardsObtained << reward.item - - #recalculate nb to next reward - next_reward = get_next_quest_reward - nb_to_next_reward = next_reward.nb_quests - nb_quests_completed - end - - - pbCallBub(2, eventId) - if nb_to_next_reward == 0 - pbMessage("I have no more rewards to give you! Thanks for helping all these people!") - elsif nb_to_next_reward == 1 - pbMessage("Help #{nb_to_next_reward} more person and I'll give you something good!") - else - pbMessage("Help #{nb_to_next_reward} more people and I'll give you something good!") - end -end - -def get_next_quest_reward() - for reward in QUEST_REWARDS - nextReward = reward - break if !$PokemonGlobal.questRewardsObtained.include?(reward.item) - end - # rewards_to_give << nextReward if nb_to_next_reward <=0 #for compatibility with old system - return nextReward -end def displaySpriteWindowWithMessage(pif_sprite, message = "", x = 0, y = 0,z=0) spriteLoader = BattleSpriteLoader.new @@ -1667,3 +1584,57 @@ def select_any_pokemon() return pbChooseList(commands, 0, nil, 1) end + +SWITCH_SS_ANNE_DEPARTED=88 +SWITCH_SNORLAX_GONE_ROUTE_12=110 +SWITCH_TELEPORT_NPC = 122 +SWITCH_GOT_DIVE=317 +SWITCH_GOT_ROCK_CLIMB=661 +SWITCH_GOT_WATERFALL=388 + +def fixMissedHMs() + #Flash + if $PokemonBag.pbQuantity(:HM08) < 1 && $PokemonGlobal.questRewardsObtained.include?(:HM08) + pbReceiveItem(:HM08) + end + + #Cut + if $PokemonBag.pbQuantity(:HM01) < 1 && $game_switches[SWITCH_SS_ANNE_DEPARTED] + pbReceiveItem(:HM01) + end + + #Strength + if $PokemonBag.pbQuantity(:HM04) < 1 && $game_switches[SWITCH_SNORLAX_GONE_ROUTE_12] + pbReceiveItem(:HM04) + end + + #Surf + if $PokemonBag.pbQuantity(:HM03) < 1 && $game_self_switches[[107, 1, "A"]] + pbReceiveItem(:HM03) + end + + #Teleport + if $PokemonBag.pbQuantity(:HM07) < 1 && $game_switches[SWITCH_TELEPORT_NPC] + pbReceiveItem(:HM07) + end + + #Fly + if $PokemonBag.pbQuantity(:HM02) < 1 && $game_self_switches[[439, 1, "B"]] + pbReceiveItem(:HM02) + end + + #Waterfall + if $PokemonBag.pbQuantity(:HM05) < 1 && $game_switches[SWITCH_GOT_WATERFALL] + pbReceiveItem(:HM05) + end + + #Dive + if $PokemonBag.pbQuantity(:HM06) < 1 && $game_switches[SWITCH_GOT_DIVE] + pbReceiveItem(:HM06) + end + + #Rock Climb + if $PokemonBag.pbQuantity(:HM10) < 1 && $game_switches[SWITCH_GOT_ROCK_CLIMB] + pbReceiveItem(:HM10) + end +end diff --git a/Data/Scripts/052_AddOns/HttpCalls.rb b/Data/Scripts/052_AddOns/HttpCalls.rb index 97af2e1d2..753bf77da 100644 --- a/Data/Scripts/052_AddOns/HttpCalls.rb +++ b/Data/Scripts/052_AddOns/HttpCalls.rb @@ -364,7 +364,7 @@ end def updateOnlineCustomSpritesFile return if !downloadAllowed?() - echoln "HERE" + echoln "UPDATING CUSTOM SPRITE LISTS" download_file(Settings::SPRITES_FILE_URL, Settings::CUSTOM_SPRITES_FILE_PATH) download_file(Settings::BASE_SPRITES_FILE_URL, Settings::BASE_SPRITES_FILE_PATH) end diff --git a/Data/Scripts/052_AddOns/QuestLogScript.rb b/Data/Scripts/052_AddOns/QuestLogScript.rb index 0b34d9584..d9a8a7da3 100644 --- a/Data/Scripts/052_AddOns/QuestLogScript.rb +++ b/Data/Scripts/052_AddOns/QuestLogScript.rb @@ -1005,4 +1005,91 @@ def pbSynchronizeQuestLog() pbSetQuest(40, true) if $game_self_switches[[565, 9, "A"]] pbSetQuest(41, true) if $game_self_switches[[565, 10, "A"]] +end + + + +def showQuestStatistics(eventId,includeRocketQuests=false) + quests_accepted = [] + quests_in_progress=[] + quests_completed=[] + for quest in $Trainer.quests + next if quest.npc == QuestBranchRocket && !includeRocketQuests + quests_accepted<= reward.nb_quests && !$PokemonGlobal.questRewardsObtained.include?(reward.item) + end + + #Calculate how many until next reward + next_reward = get_next_quest_reward + nb_to_next_reward = next_reward.nb_quests - nb_quests_completed + + for reward in rewards_to_give + echoln reward.item + + end + #Give rewards + for reward in rewards_to_give + if !reward.can_have_multiple && $PokemonBag.pbQuantity(reward.item) >= 1 + $PokemonGlobal.questRewardsObtained << reward.item + next + end + pbCallBub(2, eventId) + pbMessage("Also, there's one more thing...") + pbCallBub(2, eventId) + pbMessage("As a gift for having helped so many people, I want to give you this.") + pbReceiveItem(reward.item, reward.quantity) + $PokemonGlobal.questRewardsObtained << reward.item + + #recalculate nb to next reward + next_reward = get_next_quest_reward + nb_to_next_reward = next_reward.nb_quests - nb_quests_completed + end + + + pbCallBub(2, eventId) + if nb_to_next_reward <= 0 + pbMessage("I have no more rewards to give you! Thanks for helping all these people!") + elsif nb_to_next_reward == 1 + pbMessage("Help #{nb_to_next_reward} more person and I'll give you something good!") + else + pbMessage("Help #{nb_to_next_reward} more people and I'll give you something good!") + end +end + +def get_next_quest_reward() + for reward in QUEST_REWARDS + nextReward = reward + break if !$PokemonGlobal.questRewardsObtained.include?(reward.item) + end + # rewards_to_give << nextReward if nb_to_next_reward <=0 #for compatibility with old system + return nextReward end \ No newline at end of file diff --git a/Data/System.rxdata b/Data/System.rxdata index be2ebe3e3..4da424714 100644 Binary files a/Data/System.rxdata and b/Data/System.rxdata differ