Skip to content

Commit 72c06d9

Browse files
committed
Implement KJ completion event
1 parent 9878d76 commit 72c06d9

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed

data/sql/db-world/zone_difficulty_mythicmode_instance_data.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ INSERT INTO `zone_difficulty_mythicmode_instance_data` (`MapID`, `SourceEntry`,
6565
(580, 24882, 0, 19), -- Brutallus
6666
(580, 25038, 0, 19), -- Felmyst
6767
(580, 25840, 0, 19), -- Muru
68+
(580, 25315, 0, 19), -- Kiljaeden
6869
-- TBC 5man Heroics
6970
(269, 17881, 0, 8), -- Aeonus, The Black Morass
7071
(540, 16808, 0, 8), -- Warchief Kargath Bladefist, Shattered Halls

src/ZoneDifficulty.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ enum Misc
152152
NPC_LADY_VASHJ = 21212,
153153
NPC_ARCHIMONDE = 17968,
154154
NPC_ZULJIN = 23863,
155+
NPC_KILJAEDEN = 25315,
155156
NPC_REWARD_CHROMIE = 1128002,
156157
};
157158

@@ -194,6 +195,7 @@ class ZoneDifficulty
194195
bool MythicmodeInNormalDungeons{ false };
195196
bool UseVendorInterface{ false };
196197
bool IsBlackTempleDone{ false };
198+
bool IsSunwellPlateauDone{ false };
197199
std::vector<uint32> DailyHeroicQuests;
198200
std::map<uint32, uint32> HeroicTBCQuestMapList;
199201
std::map<uint32, uint8> EncounterCounter;

src/mod_zone_difficulty_handler.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,6 +1062,26 @@ void ZoneDifficulty::LogAndAnnounceKill(Map* map, bool isMythic)
10621062
}
10631063
});
10641064

1065+
ChatHandler(nullptr).SendWorldText(names.c_str());
1066+
} else if (map->GetId() == 580)
1067+
{
1068+
if (sZoneDifficulty->IsSunwellPlateauDone)
1069+
return;
1070+
1071+
sZoneDifficulty->IsSunwellPlateauDone = true;
1072+
1073+
ChatHandler(nullptr).SendWorldText("Congrats on conquering Sunwell Plateau ({}) and defeating Kil'jaeden! Well done, champions!", isMythic ? "Mythic" : "Normal");
1074+
1075+
std::string names = "Realm first group: ";
1076+
1077+
map->DoForAllPlayers([&](Player* mapPlayer) {
1078+
if (!mapPlayer->IsGameMaster())
1079+
{
1080+
names.append(mapPlayer->GetName() + ", ");
1081+
CharacterDatabase.Execute("INSERT INTO zone_difficulty_completion_logs (guid, type, mode) VALUES ({}, {}, {})", mapPlayer->GetGUID().GetCounter(), TYPE_RAID_SWP, 1);
1082+
}
1083+
});
1084+
10651085
ChatHandler(nullptr).SendWorldText(names.c_str());
10661086
}
10671087
};
@@ -1151,5 +1171,13 @@ void ZoneDifficulty::ProcessCreatureDeath(Map* map, uint32 entry)
11511171
});
11521172
sZoneDifficulty->LogAndAnnounceKill(map, true);
11531173
break;
1174+
case NPC_KILJAEDEN:
1175+
map->DoForAllPlayers([&](Player* player)
1176+
{
1177+
player->UpdatePlayerSetting(ModZoneDifficultyString + "ct", SETTING_SWP, 1);
1178+
player->SendSystemMessage("Congratulations on completing Sunwell Plateau!");
1179+
});
1180+
sZoneDifficulty->LogAndAnnounceKill(map, true);
1181+
break;
11541182
}
11551183
}

src/mod_zone_difficulty_scripts.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,9 @@ class mod_zone_difficulty_worldscript : public WorldScript
455455

456456
if (CharacterDatabase.Query("SELECT 1 FROM zone_difficulty_completion_logs WHERE type = {}", TYPE_RAID_T6))
457457
sZoneDifficulty->IsBlackTempleDone = true;
458+
459+
if (CharacterDatabase.Query("SELECT 1 FROM zone_difficulty_completion_logs WHERE type = {}", TYPE_RAID_SWP))
460+
sZoneDifficulty->IsSunwellPlateauDone = true;
458461
}
459462

460463
void OnStartup() override

0 commit comments

Comments
 (0)