Skip to content

Commit

Permalink
PlayReport: implement getQuestId()
Browse files Browse the repository at this point in the history
  • Loading branch information
leoetlino committed Apr 22, 2024
1 parent f4ac69e commit 4740104
Show file tree
Hide file tree
Showing 2 changed files with 186 additions and 2 deletions.
2 changes: 1 addition & 1 deletion data/uking_functions.csv
Original file line number Diff line number Diff line change
Expand Up @@ -61184,7 +61184,7 @@ Address,Quality,Size,Name
0x0000007100a87030,O,001116,_ZN5uking10PlayReport10addMapTypeEv
0x0000007100a8748c,O,000908,_ZN5uking13reportDungeonERKN4sead14SafeStringBaseIcEES4_
0x0000007100a87818,O,001256,_ZN5uking15reportQuestStepEPKN4ksys3qst5QuestEi
0x0000007100a87d00,U,002908,getQuestId
0x0000007100a87d00,O,002908,_ZN5uking10getQuestIdERKN4sead14SafeStringBaseIcEE
0x0000007100a8885c,U,000528,uking::reportGanonQuestFinished
0x0000007100a88a6c,U,001740,uking::reportGameOver
0x0000007100a89138,U,001384,uking::reportBloodMoon
Expand Down
186 changes: 185 additions & 1 deletion src/Game/gamePlayReport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "KingSystem/System/StageInfo.h"

namespace uking {
unsigned int getQuestId(const sead::SafeString& quest_name);

void reportKorok(const sead::Vector3f& position) {
ksys::ProductReporter::getSomeBool();
s32 id = ksys::gdt::getFlag_HiddenKorok_Number();
Expand Down Expand Up @@ -52,6 +52,190 @@ void reportDungeon(const sead::SafeString& name, const sead::SafeString& event)
}
}

unsigned int getQuestId(const sead::SafeString& quest_name) {
const sead::SafeString names[] = {
"UnknownEvent",
"Animal_Forest",
"BloodyMoonRelief",
"Bottle_Mes",
"Carnivorous_Boy",
"CarryingBlueFireEXMini",
"Cliff_Maze",
"CompleteDungeon",
"CursedStatue",
"DarkWoods",
"Desert_Maze",
"DokuroEye",
"DontDamageFlower",
"Drag_Hero",
"Electric_Relic",
"FairyFountain",
"FindDungeon",
"Find_4Relic",
"Find_Impa",
"Fire_Relic",
"FironeMini_GiantHorse",
"FironeMini_HeartPond",
"FironeMini_HorseEnemy",
"FironeMini_TerribleThunder",
"FirstOhenro",
"FirstTower",
"FourJewel",
"Gaman",
"GanonQuest",
"GerudoMiniJewel",
"Gerudo_CarryIce",
"Gerudo_CarryIce_mini",
"Gerudo_Ch_FindingValetta",
"Gerudo_Ch_Helmet",
"Gerudo_Ch_Poison",
"Gerudo_Ch_SandWarm",
"Gerudo_Ch_SecretClub",
"Gerudo_Ch_SnowBoots",
"Gerudo_Ch_SnowMT",
"Gerudo_HorseBuyer",
"Gerudo_tsukamidake",
"Get_MasterSword",
"Giant_ZoraMini",
"GodTree",
"GoronCamp",
"GoronCamp_mini",
"GoronCityMini_BeatGolem",
"GoronMini_ImportGem",
"GoronMini_WallCrackTBox",
"GoronsRock",
"GotoZoraVillage",
"HateeluMini_Treasure",
"HatenoMini_BlueFire",
"HatenoMini_CameraBoy",
"HatenoMini_DevilSeal",
"HatenoMini_GoatThief",
"HatenoMini_LoveInsects",
"HatenoMini_MyHome",
"HatenoMini_ThreeTree",
"HatenoMini_WeaponMania",
"HatenoMini_WhiteDragon",
"Hateno_SheikPad_PowerUp",
"HigakkareMini_RedDragon",
"HigakkareMini_StrangeMan",
"HutagoHatago_Ch_001",
"HyruleDepthMini_WhiteHorse",
"HyrulePlainMini_Balloon",
"isso_treasure_mini",
"Kakariko_Cha_001",
"Kakariko_Cha_003",
"Kakariko_Ch_004",
"Kakariko_Ch_005",
"Kakariko_Ch_006",
"Kakariko_Ch_Cooking2",
"Kakariko_Ch_Cooking3",
"Kakariko_Ch_Cooking4",
"KnightDoll",
"KorokMini_KorokShiren",
"KorokMini_RiddleShiren",
"KorokMini_RodShiren",
"KorokMini_UMAShiren",
"MacuseIseki",
"MagneticFld",
"MarittaMini_BigWhales",
"MinakkareMini_Dragonfly",
"MinamihateeluMini_touzoku",
"MiniGame_Bowling",
"MiniGame_Crosscountry",
"MiniGame_GambleTreasureBox",
"MiniGame_HillTower_BirdMan",
"MiniGame_HorsebackArchery",
"MiniGame_HorseRace",
"MiniGame_KitakkareBF",
"MiniGame_ParasailArchery",
"MiniGame_ParasailRide",
"MiniGame_ShieldSurfing",
"MiniGame_SmashGolf",
"MiniGame_TimeLimitHunting",
"MouthofDragon",
"MtMotelMini_Landscape",
"My_Hero",
"NakedIsland",
"Oasis_Drug_Challenge",
"OldKorok_Help",
"OneHundred",
"PictureMemory",
"PrezentationOkamura",
"Relief_Landing",
"Remains_Fancier",
"RinelSearch",
"RitoMini_Cook",
"RitoMini_Flint",
"RitoMini_IceGolem",
"RitoRabitMountain",
"RitoSongMystery",
"RitoUmayadoMini_HotRecipe",
"Rito_BrosRock",
"Rito_KeelSearch",
"RiversideMini_CastleWeapon",
"RiversideMini_RoyalRecipe",
"SandStorm",
"SanrokuMini_Lizard",
"SearchStone",
"SecretofObject",
"SeekerEye",
"SetugenUmayadoMini_Umahonephoto",
"Shadow_Sign",
"ShieldofKolog",
"ShieldofKolog_mini",
"Solitary_Maze",
"StatueofZora",
"StolenBook",
"SunazarashiRace",
"SunazarashiRace_mini",
"TabantaBridgeMini_Sundial",
"Threebros_giant",
"Thunder_Sword",
"TutorialDungeon",
"TwoWheels",
"UMiiMini_GiveCake",
"UMiiMini_MakeVillage",
"UMiiMini_RichmansHobby",
"UotoriMini_RecipeSea",
"UotoriMini_RecoverBay",
"UotoriMini_SinkTreasure",
"Water_Relic",
"Wind_Relic",
"ZoraMini_DiveChallenge",
"ZoraMini_FlowedWife",
"ZoraMini_HarvestingStone",
"ZoraMini_ReliefSearch",
"Zora_FlogMini",
"100enemy",
"TreasureHunt01",
"TreasureHunt02",
"TreasureHunt_touzoku01",
"TreasureHunt_touzoku02",
"TreasureHunt_touzoku03",
"TreasureHunt_touzoku04",
"bf2_collabo",
"BalladOfHeroes",
"BalladOfHeroGerudo",
"BalladOfHeroGoron",
"BalladOfHeroZora",
"BalladOfHeroRito",
"AoC_hero_memory",
"TreasureHunt03",
"TreasureHunt04",
"TreasureHunt_touzoku05",
"TreasureHunt_touzoku06",
"TreasureHunt_touzoku07",
"TreasureHunt_touzoku08",
};

for (int i = 0, n = std::size(names); i < n; ++i) {
if (names[i] == quest_name) {
return i;
}
}
return 0;
}

void reportQuestStep(const ksys::qst::Quest* quest, int step_index) {
if (quest && step_index >= 0 && step_index < quest->mSteps.size()) {
const sead::SafeString& name = quest->mName;
Expand Down

0 comments on commit 4740104

Please sign in to comment.