Skip to content

Commit

Permalink
fix: Implement requirement of clearing BT to access T6 items
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyeriah committed Sep 19, 2024
1 parent 9fcb820 commit c6340b9
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/ZoneDifficulty.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,15 @@ enum ZoneDifficultySettings
TYPE_RAID_T7 = 13,
TYPE_RAID_T8 = 14,
TYPE_RAID_T9 = 15,
TYPE_RAID_T10 = 16
TYPE_RAID_T10 = 16,

// Completed tiers settings
SETTING_BLACK_TEMPLE = 0
};

enum Misc
{
NPC_ILLIDAN_STORMRAGE = 22917
};

class ZoneDifficulty
Expand Down
20 changes: 20 additions & 0 deletions src/mod_zone_difficulty_scripts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,15 @@ class mod_zone_difficulty_globalscript : public GlobalScript
else if (map->IsRaid())
{
sZoneDifficulty->AddMythicmodeScore(map, sZoneDifficulty->Expansion[mapId], score);

if (source->GetEntry() == NPC_ILLIDAN_STORMRAGE)
{
map->DoForAllPlayers([&](Player* player)
{
player->UpdatePlayerSetting(ModZoneDifficultyString + "ct", SETTING_BLACK_TEMPLE, 1);
ChatHandler(player->GetSession()).PSendSysMessage("Congratulations on completing the Black Temple!");
});
}
}
/* debug
* else
Expand Down Expand Up @@ -769,6 +778,17 @@ class mod_zone_difficulty_rewardnpc : public CreatureScript
//LOG_INFO("module", "MOD-ZONE-DIFFICULTY: Handling item with category {}, itemType {}, counter {}", category, itemType, counter);

// Check if the player has enough score in the respective category.

if (category == TYPE_RAID_T6)
{
if (!player->GetPlayerSetting(ModZoneDifficultyString + "ct", SETTING_BLACK_TEMPLE).value)
{
creature->Whisper("Ah, hero! The threads of fate bring you to me. To claim the rewards you desire, you must first confront Illidan Stormrage on Mythic difficulty.",
LANG_UNIVERSAL, player);
return true;
}
}

uint32 availableScore = player->GetPlayerSetting(ModZoneDifficultyString + "score", category).value;

if (availableScore < sZoneDifficulty->Rewards[category][itemType][counter].Price)
Expand Down

0 comments on commit c6340b9

Please sign in to comment.