Skip to content

Commit

Permalink
feat: add reward data for ZA
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyeriah committed Nov 10, 2024
1 parent 23ab5aa commit 9758407
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 33 deletions.
14 changes: 14 additions & 0 deletions data/sql/db-world/zone_difficulty_mythicmode_instance_data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,20 @@ INSERT INTO `zone_difficulty_mythicmode_instance_data` (`MapID`, `SourceEntry`,
(544, 17257, 0, 9), -- Magtheridon, Magtheridon's Lair
(565, 18831, 0, 9), -- High King Maulgar, Gruul's Lair
(565, 19044, 0, 9), -- Gruul, Gruul's Lair
-- Black Temple
(564, 22887, 0, 11), -- Najentus
(564, 22898, 0, 11), -- Supremus
(564, 22841, 0, 11), -- Akama
(564, 22871, 0, 11), -- Teron
(564, 22947, 0, 11), -- Mother Shahraz
(564, 22948, 0, 11), -- Gurtogg
(564, 22917, 0, 11), -- Illidan
-- ZA
(568, 23578, 0, 12), -- Janalai
(568, 24239, 0, 12), -- Hexlord
(568, 23577, 0, 12), -- Halazzi
(568, 23576, 0, 12), -- Narolakk
(568, 23863, 0, 12), -- Zuljin
-- TBC 5man Heroics
(269, 17881, 0, 8), -- Aeonus, The Black Morass
(540, 16808, 0, 8), -- Warchief Kargath Bladefist, Shattered Halls
Expand Down
10 changes: 0 additions & 10 deletions data/sql/db-world/zone_difficulty_mythicmode_instance_data_bt.sql

This file was deleted.

14 changes: 8 additions & 6 deletions src/ZoneDifficulty.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,18 @@ enum ZoneDifficultySettings
TYPE_RAID_T4 = 9,
TYPE_RAID_T5 = 10,
TYPE_RAID_T6 = 11,
TYPE_HEROIC_WOTLK = 12,
TYPE_RAID_T7 = 13,
TYPE_RAID_T8 = 14,
TYPE_RAID_T9 = 15,
TYPE_RAID_T10 = 16,
TYPE_RAID_ZA = 12,
TYPE_HEROIC_WOTLK = 13,
TYPE_RAID_T7 = 14,
TYPE_RAID_T8 = 15,
TYPE_RAID_T9 = 16,
TYPE_RAID_T10 = 17,

TYPE_MAX_TIERS,

// Completed tiers settings
SETTING_BLACK_TEMPLE = 0
SETTING_BLACK_TEMPLE = 0,
SETTING_ZULAMAN = 1
};

enum Misc
Expand Down
50 changes: 33 additions & 17 deletions src/mod_zone_difficulty_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,9 @@ std::string ZoneDifficulty::GetContentTypeString(uint32 type)
case TYPE_RAID_T6:
typestring = "for T6 Raids.";
break;
case TYPE_RAID_ZA:
typestring = "for Zul'Aman.";
break;
case TYPE_HEROIC_WOTLK:
typestring = "for Heroic WotLK dungeons.";
break;
Expand Down Expand Up @@ -974,6 +977,9 @@ bool ZoneDifficulty::HasCompletedFullTier(uint32 category, uint32 playerGuid)
case TYPE_RAID_T6:
MapList = { 564 };
break;
case TYPE_RAID_ZA:
MapList = { 568 };
break;
default:
LOG_ERROR("module", "MOD-ZONE-DIFFICULTY: Category without data requested in ZoneDifficulty::HasCompletedFullTier {}", category);
return false;
Expand Down Expand Up @@ -1021,6 +1027,14 @@ void ZoneDifficulty::RewardItem(Player* player, uint8 category, uint8 itemType,
LANG_UNIVERSAL, player);
return;
}
} else if (category == TYPE_RAID_ZA)
{
if (!player->GetPlayerSetting(ModZoneDifficultyString + "ct", SETTING_ZULAMAN).value)
{
creature->Whisper("Ah, hero! The threads of fate bring you to me. To claim the rewards you desire, you must first confront Zul'jin on Mythic difficulty.",
LANG_UNIVERSAL, player);
return;
}
}

if (availableScore < reward.Price)
Expand Down Expand Up @@ -1056,26 +1070,28 @@ void ZoneDifficulty::RewardItem(Player* player, uint8 category, uint8 itemType,

void ZoneDifficulty::LogAndAnnounceKill(Unit* source, bool isMythic)
{
// Just black temple supported for the time being
if (sZoneDifficulty->IsBlackTempleDone)
return;
if (source->GetMap()->GetId() == 564)
{
if (sZoneDifficulty->IsBlackTempleDone)
return;

sZoneDifficulty->IsBlackTempleDone = true;
sZoneDifficulty->IsBlackTempleDone = true;

ChatHandler(nullptr).SendWorldText("Congrats on conquering Black Temple ({}) and defeating Illidan Stormrage! Well done, champions!", isMythic ? "Mythic" : "Normal");
ChatHandler(nullptr).SendWorldText("Congrats on conquering Black Temple ({}) and defeating Illidan Stormrage! Well done, champions!", isMythic ? "Mythic" : "Normal");

std::string names = "Realm first group: ";
std::string names = "Realm first group: ";

if (Map* map = source->GetMap())
{
map->DoForAllPlayers([&](Player* mapPlayer) {
if (!mapPlayer->IsGameMaster())
{
names.append(mapPlayer->GetName() + ", ");
CharacterDatabase.Execute("INSERT INTO zone_difficulty_completion_logs (guid, type, mode) VALUES ({}, {}, {})", mapPlayer->GetGUID().GetCounter(), TYPE_RAID_T6, 1);
}
});
}
if (Map* map = source->GetMap())
{
map->DoForAllPlayers([&](Player* mapPlayer) {
if (!mapPlayer->IsGameMaster())
{
names.append(mapPlayer->GetName() + ", ");
CharacterDatabase.Execute("INSERT INTO zone_difficulty_completion_logs (guid, type, mode) VALUES ({}, {}, {})", mapPlayer->GetGUID().GetCounter(), TYPE_RAID_T6, 1);
}
});
}

ChatHandler(nullptr).SendWorldText(names.c_str());
ChatHandler(nullptr).SendWorldText(names.c_str());
}
};

0 comments on commit 9758407

Please sign in to comment.