Skip to content

Commit

Permalink
feat: add unrated option
Browse files Browse the repository at this point in the history
  • Loading branch information
Helias committed Sep 10, 2024
1 parent 962d0d6 commit 7ea2c18
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
28 changes: 24 additions & 4 deletions src/solo3v3_sc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ bool NpcSolo3v3::OnGossipHello(Player* player, Creature* creature)
if (player->InBattlegroundQueueForBattlegroundQueueType((BattlegroundQueueTypeId)BATTLEGROUND_QUEUE_3v3_SOLO))
AddGossipItemFor(player, GOSSIP_ICON_INTERACT_1, "|TInterface/ICONS/Achievement_Arena_2v2_7:30|t Leave Solo queue", GOSSIP_SENDER_MAIN, NPC_3v3_ACTION_LEAVE_QUEUE, "Are you sure you want to remove the solo queue?", 0, false);

if (!player->InBattlegroundQueueForBattlegroundQueueType((BattlegroundQueueTypeId)BATTLEGROUND_QUEUE_3v3_SOLO))
AddGossipItemFor(player, GOSSIP_ICON_INTERACT_1, "|TInterface/ICONS/Achievement_Arena_3v3_5:30|t Queue up for 3vs3 Arena Solo (UnRated)\n", GOSSIP_SENDER_MAIN, NPC_3v3_ACTION_JOIN_QUEUE_ARENA_UNRATED);

if (!player->GetArenaTeamId(ARENA_SLOT_SOLO_3v3))
{
uint32 cost = sConfigMgr->GetOption<uint32>("Solo.3v3.Cost", 1);
Expand All @@ -66,8 +69,7 @@ bool NpcSolo3v3::OnGossipHello(Player* player, Creature* creature)
{
if (!player->InBattlegroundQueueForBattlegroundQueueType((BattlegroundQueueTypeId)BATTLEGROUND_QUEUE_3v3_SOLO))
{
//AddGossipItemFor(player,GOSSIP_ICON_INTERACT_1, "Queue up for 1vs1 Wargame\n", GOSSIP_SENDER_MAIN, 20);
AddGossipItemFor(player, GOSSIP_ICON_INTERACT_1, "|TInterface/ICONS/Achievement_Arena_3v3_5:30|t Queue up for 3vs3 Arena Solo\n", GOSSIP_SENDER_MAIN, NPC_3v3_ACTION_JOIN_QUEUE_ARENA_RATED);
AddGossipItemFor(player, GOSSIP_ICON_INTERACT_1, "|TInterface/ICONS/Achievement_Arena_3v3_5:30|t Queue up for 3vs3 Arena Solo (Rated)\n", GOSSIP_SENDER_MAIN, NPC_3v3_ACTION_JOIN_QUEUE_ARENA_RATED);
AddGossipItemFor(player, GOSSIP_ICON_CHAT, "|TInterface/ICONS/Achievement_Arena_2v2_7:30|t Disband Arena team", GOSSIP_SENDER_MAIN, NPC_3v3_ACTION_DISBAND_ARENATEAM, "Are you sure?", 0, false);
}

Expand Down Expand Up @@ -129,6 +131,24 @@ bool NpcSolo3v3::OnGossipSelect(Player* player, Creature* creature, uint32 /*sen
return true;
}


case NPC_3v3_ACTION_JOIN_QUEUE_ARENA_UNRATED:
{
// check Deserter debuff
if (player->HasAura(26013) && (sConfigMgr->GetOption<bool>("Solo.3v3.CastDeserterOnAfk", true) || sConfigMgr->GetOption<bool>("Solo.3v3.CastDeserterOnLeave", true)))
{
WorldPacket data;
sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS);
player->GetSession()->SendPacket(&data);
}
else
if (ArenaCheckFullEquipAndTalents(player) && JoinQueueArena(player, creature, false) == false)
ChatHandler(player->GetSession()).SendSysMessage("Something went wrong while joining queue. Already in another queue?");

CloseGossipMenuFor(player);
return true;
}

case NPC_3v3_ACTION_LEAVE_QUEUE:
{
if (player->InBattlegroundQueueForBattlegroundQueueType((BattlegroundQueueTypeId)BATTLEGROUND_QUEUE_3v3_SOLO))
Expand Down Expand Up @@ -443,10 +463,10 @@ void Solo3v3BG::OnQueueUpdate(BattlegroundQueue* queue, uint32 /*diff*/, Battleg
if (!bracketEntry)
return;

// Solo 3v3
if (sSolo->CheckSolo3v3Arena(queue, bracket_id))
{
Battleground* arena = sBattlegroundMgr->CreateNewBattleground(bgTypeId, bracketEntry, arenaType, true);
const bool _isRated = true;
Battleground* arena = sBattlegroundMgr->CreateNewBattleground(bgTypeId, bracketEntry, arenaType, _isRated);
if (!arena)
return;

Expand Down
1 change: 1 addition & 0 deletions src/solo3v3_sc.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ enum Npc3v3Actions {
NPC_3v3_ACTION_LEAVE_QUEUE = 3,
NPC_3v3_ACTION_GET_STATISTICS = 4,
NPC_3v3_ACTION_DISBAND_ARENATEAM = 5,
NPC_3v3_ACTION_JOIN_QUEUE_ARENA_UNRATED = 6,
NPC_3v3_ACTION_SCRIPT_INFO = 8
};

Expand Down

0 comments on commit 7ea2c18

Please sign in to comment.