diff --git a/Data/Actors.rxdata b/Data/Actors.rxdata index 41edc8e26..7967a5432 100644 Binary files a/Data/Actors.rxdata and b/Data/Actors.rxdata differ diff --git a/Data/Animations.rxdata b/Data/Animations.rxdata index 71336e1f0..a900929a9 100644 Binary files a/Data/Animations.rxdata and b/Data/Animations.rxdata differ diff --git a/Data/Armors.rxdata b/Data/Armors.rxdata index 901f2bb2b..2249bec14 100644 Binary files a/Data/Armors.rxdata and b/Data/Armors.rxdata differ diff --git a/Data/CommonEvents.rxdata b/Data/CommonEvents.rxdata index 20f29bd25..c0f66baff 100644 Binary files a/Data/CommonEvents.rxdata and b/Data/CommonEvents.rxdata differ diff --git a/Data/Enemies.rxdata b/Data/Enemies.rxdata index be622f513..004ee903d 100644 Binary files a/Data/Enemies.rxdata and b/Data/Enemies.rxdata differ diff --git a/Data/Items.rxdata b/Data/Items.rxdata index fe767fa0b..3e62ba6d2 100644 Binary files a/Data/Items.rxdata and b/Data/Items.rxdata differ diff --git a/Data/Map017.rxdata b/Data/Map017.rxdata index 0af08c37c..4b60febe4 100644 Binary files a/Data/Map017.rxdata and b/Data/Map017.rxdata differ diff --git a/Data/Map019.rxdata b/Data/Map019.rxdata index 06fa8692f..d048dbbeb 100644 Binary files a/Data/Map019.rxdata and b/Data/Map019.rxdata differ diff --git a/Data/Map029.rxdata b/Data/Map029.rxdata index d7fdcb30b..d0d8dd716 100644 Binary files a/Data/Map029.rxdata and b/Data/Map029.rxdata differ diff --git a/Data/Map035.rxdata b/Data/Map035.rxdata index 38914733e..e04a52619 100644 Binary files a/Data/Map035.rxdata and b/Data/Map035.rxdata differ diff --git a/Data/Map036.rxdata b/Data/Map036.rxdata index 129e11b11..11e46b36d 100644 Binary files a/Data/Map036.rxdata and b/Data/Map036.rxdata differ diff --git a/Data/Map357.rxdata b/Data/Map357.rxdata index 1857bfa63..ff02f3310 100644 Binary files a/Data/Map357.rxdata and b/Data/Map357.rxdata differ diff --git a/Data/Map380.rxdata b/Data/Map380.rxdata index 7ced20d50..37c1e744e 100644 Binary files a/Data/Map380.rxdata and b/Data/Map380.rxdata differ diff --git a/Data/Map460.rxdata b/Data/Map460.rxdata index 3cc6cc231..bff22a09c 100644 Binary files a/Data/Map460.rxdata and b/Data/Map460.rxdata differ diff --git a/Data/Map462.rxdata b/Data/Map462.rxdata index ef870f2da..5f60188ad 100644 Binary files a/Data/Map462.rxdata and b/Data/Map462.rxdata differ diff --git a/Data/Map464.rxdata b/Data/Map464.rxdata index c3244749f..b094b4eb6 100644 Binary files a/Data/Map464.rxdata and b/Data/Map464.rxdata differ diff --git a/Data/Map647.rxdata b/Data/Map647.rxdata index ec47ef806..9c674bcf6 100644 Binary files a/Data/Map647.rxdata and b/Data/Map647.rxdata differ diff --git a/Data/MapInfos.rxdata b/Data/MapInfos.rxdata index 45587f874..e8655f08c 100644 Binary files a/Data/MapInfos.rxdata and b/Data/MapInfos.rxdata differ diff --git a/Data/Scripts/052_AddOns/QuestLogScript.rb b/Data/Scripts/052_AddOns/QuestLogScript.rb index a0ea2a733..6ad0c8841 100644 --- a/Data/Scripts/052_AddOns/QuestLogScript.rb +++ b/Data/Scripts/052_AddOns/QuestLogScript.rb @@ -87,13 +87,14 @@ QUESTS = { "pewter_1" => Quest.new("pewter_1", "Mushroom Gathering", "A lady in Pewter City wants you to bring her 3 TinyMushroom from Viridian Forest to make a stew.", QuestBranchHotels, "BW (74)", "Pewter City", HotelQuestColor), "pewter_2" =>Quest.new("pewter_2", "Lost Medicine", "A youngster in Pewter City needs your help to find a lost Revive. He lost it by sitting on a bench somewhere in Pewter City.", QuestBranchHotels, "BW (19)", "Pewter City", HotelQuestColor), "pewter_3" =>Quest.new("pewter_3", "Bug Evolution ", "A Bug Catcher in Pewter City wants you to show him a fully-evolved Bug Pokémon.", QuestBranchHotels, "BWBugCatcher_male", "Pewter City", HotelQuestColor), - 63 => Quest.new(63, "I Choose You!", "A Pikachu in the PokéMart has lost its official Pokémon League Hat. Find one and give it to the Pikachu!", QuestBranchField, "YOUNGSTER_LeagueHat", "Pewter City", FieldQuestColor), + "pewter_field_1" => Quest.new("pewter_field_1", "Nectar garden", "An old man wants you to bring differently colored flowers for the city's garden.", QuestBranchField, "BW (039)", "Pewter City", FieldQuestColor), + "pewter_field_2" => Quest.new("pewter_field_2", "I Choose You!", "A Pikachu in the PokéMart has lost its official Pokémon League Hat. Find one and give it to the Pikachu!", QuestBranchField, "YOUNGSTER_LeagueHat", "Pewter City", FieldQuestColor), #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), - 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), + "cerulean_1" => Quest.new("cerulean_1", "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), + "cerulean_2" => Quest.new("cerulean_2", "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), + 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), #Route 24 6 => Quest.new(6, "Field Research (Part 1)", "Professor Oak's aide wants you to catch an Abra.", QuestBranchField, "BW (82)", "Route 24", FieldQuestColor), @@ -101,11 +102,11 @@ QUESTS = { 8 => Quest.new(8, "Field Research (Part 3)", "Professor Oak's aide wants you to catch a Buneary using the Pokéradar.", QuestBranchField, "BW (82)", "Route 24", FieldQuestColor), #Vermillion City - 9 => Quest.new(9, "Unusual Types 1", "A woman at the hotel wants you to show her a Water/Fire-type Pokémon", QuestBranchHotels, "BW (58)", "Vermillion City", HotelQuestColor), - 10 => Quest.new(10, "Trainer House", "Earn 10 Trainer Points at the Trainer House in Viridian City", QuestBranchHotels, "BW (55)", "Vermillion City", HotelQuestColor), - 11 => Quest.new(11, "Powering the Lighthouse", "Catch some Voltorb to power up the lighthouse", QuestBranchHotels, "BW (43)", "Vermillion City", HotelQuestColor), - 12 => Quest.new(12, "Seafood Cocktail ", "Get some steamed Krabby legs from the S.S. Anne's kitchen and bring them back to the hotel before they get cold", QuestBranchHotels, "BW (36)", "Vermillion City", HotelQuestColor), - 13 => Quest.new(13, "Building Materials ", "Get some wooden planks from Viridian City and some Bricks from Pewter City.", QuestBranchField, "BW (36)", "Vermillion City", FieldQuestColor), + "vermillion_2" => Quest.new("vermillion_2", "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), + "vermillion_1" => Quest.new("vermillion_1", "Unusual Types 1", "A woman at the hotel wants you to show her a Water/Fire-type Pokémon", QuestBranchHotels, "BW (58)", "Vermillion City", HotelQuestColor), + 11 => Quest.new(11, "Powering the Lighthouse", "Catch some Voltorb to power up the lighthouse", QuestBranchHotels, "BW (43)", "Vermillion City", HotelQuestColor), + "vermillion_3" => Quest.new("vermillion_3", "Seafood Cocktail ", "Get some steamed Krabby legs from the S.S. Anne's kitchen and bring them back to the hotel before they get cold", QuestBranchHotels, "BW (36)", "Vermillion City", HotelQuestColor), + "vermillion_field_1" => Quest.new("vermillion_field_1", "Building Materials ", "Get some wooden planks from Viridian City and some Bricks from Pewter City.", QuestBranchField, "BW (36)", "Vermillion City", FieldQuestColor), 64 => Quest.new(64, "Waiter on the Water", "The S.S. Anne waiter wants you to take restaurant orders while he went to get a replacement cake.", QuestBranchField, "BW (53)", "S.S. Anne", FieldQuestColor), #Celadon City @@ -178,7 +179,6 @@ QUESTS = { 52 => Quest.new(52, "The long night (Part 5)", "You found a strange fruit that appears to be related to the mysterious darkness. Go see professor Oak to have it analyzed.", QuestBranchLegendary, "BW029", "Safari Zone", LegendaryQuestColor), 53 => Quest.new(53, "The long night (Part 6)", "The strange plant you found appears to glow in the mysterious darkness that now covers the entire region. Try to follow the glow to find out the source of the disturbance.", QuestBranchLegendary, "BW-oak", "Pallet Town", LegendaryQuestColor), - 54 => Quest.new(54, "Nectar garden", "An old man wants you to bring differently colored flowers for the city's garden.", QuestBranchField, "BW (039)", "Pewter City", FieldQuestColor), 55 => Quest.new(55, "The Cursed Forest", "A child wants you to find a floating tree stump in Ilex Forest. What could she be talking about?", QuestBranchHotels, "BW109", "Goldenrod City", HotelQuestColor), 56 => Quest.new(56, "Bitey Pokémon", "A fisherman wants to know what is the sharp-toothed Pokémon that bit him in the Safari Zone's lake.", QuestBranchHotels, "BW (71)", "Fuchsia City", HotelQuestColor), @@ -219,22 +219,31 @@ def showNewQuestMessage(title,description, show_description) end def isQuestAlreadyAccepted?(id) - $Trainer.quests = [] if $Trainer.quests.class == NilClass - for quest in $Trainer.quests - return true if quest.id == id - end - return false + $Trainer.quests ||= [] # Initializes quests as an empty array if nil + $Trainer.quests.any? { |quest| quest.id.to_s == id.to_s } end + def finishQuest(id, silent=false) return if pbCompletedQuest?(id) pbMEPlay("Register phone") if !silent Kernel.pbMessage("\\C[6]Quest completed!") if !silent + + + $game_variables[222] += 1 # karma $game_variables[97] -= 1 #nb. quests active $game_variables[98] += 1 #nb. quests completed pbSetQuest(id, true) + + + # character_sprite = $scene.spriteset.character_sprites[@event_id] + # echoln character_sprite + # if character_sprite + # character_sprite.removeQuestIcon + # end + # $scene.reset_map(true,false) #to remove the quest icon end def pbCompletedQuest?(id) @@ -267,10 +276,10 @@ end def pbSetQuest(id, completed) $Trainer.quests = [] if $Trainer.quests.class == NilClass for q in $Trainer.quests - echoln id - echoln q.id - echoln q.completed - echoln "----" + # echoln id + # echoln q.id + # echoln q.completed + # echoln "----" q.completed = completed if q.id == id end end diff --git a/Data/Scripts/052_AddOns/quest_icons.rb b/Data/Scripts/052_AddOns/quest_icons.rb new file mode 100644 index 000000000..6577c3044 --- /dev/null +++ b/Data/Scripts/052_AddOns/quest_icons.rb @@ -0,0 +1,67 @@ +class Sprite_Character + QUEST_NPC_TRIGGER = "questNPC" + + QUEST_ICON_FOLDER = "Graphics/Pictures/Quests/" + QUEST_ICON_NAME = "Graphics/Pictures/Quests/questIcon" + + attr_accessor :questIcon + + alias questIcon_init initialize + def initialize(viewport, character = nil) + questIcon_init(viewport,character) + @quest_switch = detectQuestSwitch(character) + if @quest_switch + echoln "balablbi #{@quest_switch}" + addQuestMarkerToSprite + end + end + + alias questIcon_update update + def update + questIcon_update + positionQuestIndicator if @questIcon + removeQuestIcon if @questIcon && isQuestAlreadyAccepted?(@quest_switch) + end + + # Event name must contain questNPC(x) for a quest icon to be displayed + # Where x is the quest ID + # if the quest has not already been accepted, the quest marker will be shown + def detectQuestSwitch(event) + return nil if event.is_a?(Game_Player) + name = event.name.clone + match = name.match(/#{Regexp.escape(QUEST_NPC_TRIGGER)}\(([^)]+)\)/) # Capture anything inside parentheses + return nil unless match + quest_id = match[1] + quest_id = quest_id.gsub(/^['"]|['"]$/, '') # Remove quotes if they exist + return nil if isQuestAlreadyAccepted?(quest_id) + return quest_id + end + + + def addQuestMarkerToSprite() + removeQuestIcon if @questIcon + @questIcon = Sprite.new(@viewport) + @questIcon.bmp(QUEST_ICON_NAME) + positionQuestIndicator + end + + def positionQuestIndicator() + y_offset =-70 + + @questIcon.ox = @questIcon.bitmap.width / 2.0 + @questIcon.oy = @questIcon.bitmap.height / 2.0 + + x_position = @character.screen_x + y_position = @character.screen_y + y_offset + @questIcon.x = x_position + @questIcon.y = y_position + @questIcon.z = 999 + end + + def removeQuestIcon() + echoln "REMOVAL for #{self}" + @questIcon.dispose + @questIcon = nil + end + +end diff --git a/Data/Skills.rxdata b/Data/Skills.rxdata index a45219f5e..61cba7ea2 100644 Binary files a/Data/Skills.rxdata and b/Data/Skills.rxdata differ diff --git a/Data/States.rxdata b/Data/States.rxdata index 868d49e59..0f9b4ae5d 100644 Binary files a/Data/States.rxdata and b/Data/States.rxdata differ diff --git a/Data/System.rxdata b/Data/System.rxdata index 4beda8754..97eecde40 100644 Binary files a/Data/System.rxdata and b/Data/System.rxdata differ diff --git a/Data/Tilesets.rxdata b/Data/Tilesets.rxdata index 0b708e8c4..35596a744 100644 Binary files a/Data/Tilesets.rxdata and b/Data/Tilesets.rxdata differ diff --git a/Data/Weapons.rxdata b/Data/Weapons.rxdata index c7ea19a7a..d9bd35260 100644 Binary files a/Data/Weapons.rxdata and b/Data/Weapons.rxdata differ diff --git a/Graphics/Characters/YOUNGSTER_LeagueHat.png b/Graphics/Characters/YOUNGSTER_LeagueHat.png index fd2433447..50f0ab3ae 100644 Binary files a/Graphics/Characters/YOUNGSTER_LeagueHat.png and b/Graphics/Characters/YOUNGSTER_LeagueHat.png differ