@@ -106,7 +106,7 @@ bool NpcSolo3v3::OnGossipSelect(Player* player, Creature* creature, uint32 /*sen
106
106
}
107
107
else
108
108
{
109
- ChatHandler (player->GetSession ()).PSendSysMessage (" You need level %u + to create an arena team." , sConfigMgr ->GetOption <uint32>(" Solo.3v3.MinLevel" , 80 ));
109
+ ChatHandler (player->GetSession ()).PSendSysMessage (" You need level {} + to create an arena team." , sConfigMgr ->GetOption <uint32>(" Solo.3v3.MinLevel" , 80 ));
110
110
}
111
111
112
112
CloseGossipMenuFor (player);
@@ -180,6 +180,19 @@ bool NpcSolo3v3::OnGossipSelect(Player* player, Creature* creature, uint32 /*sen
180
180
181
181
ChatHandler (player->GetSession ()).PSendSysMessage (" {}" , s.str ().c_str ());
182
182
CloseGossipMenuFor (player);
183
+
184
+ ArenaTeam::MemberList::iterator itr;
185
+ for (itr = at->GetMembers ().begin (); itr != at->GetMembers ().end (); ++itr)
186
+ {
187
+ if (itr->Guid == player->GetGUID ())
188
+ {
189
+ std::stringstream s;
190
+ s << " \n Solo MMR: " << itr->MatchMakerRating ;
191
+
192
+ ChatHandler (player->GetSession ()).PSendSysMessage (" {}" , s.str ().c_str ());
193
+ break ;
194
+ }
195
+ }
183
196
}
184
197
185
198
return true ;
@@ -519,14 +532,6 @@ bool Solo3v3BG::OnQueueUpdateValidity(BattlegroundQueue* /* queue */, uint32 /*d
519
532
return true ;
520
533
}
521
534
522
- void Solo3v3BG::OnBattlegroundUpdate (Battleground* bg, uint32 /* diff*/ )
523
- {
524
- if (bg->GetStatus () != STATUS_IN_PROGRESS || !bg->isArena ())
525
- return ;
526
-
527
- sSolo ->CheckStartSolo3v3Arena (bg);
528
- }
529
-
530
535
void Solo3v3BG::OnBattlegroundDestroy (Battleground* bg)
531
536
{
532
537
sSolo ->CleanUp3v3SoloQ (bg);
@@ -536,7 +541,8 @@ void Solo3v3BG::OnBattlegroundEndReward(Battleground* bg, Player* player, TeamId
536
541
{
537
542
if (bg->isRated () && bg->GetArenaType () == ARENA_TYPE_3v3_SOLO)
538
543
{
539
- ArenaTeam* plrArenaTeam = sArenaTeamMgr ->GetArenaTeamByCaptain (player->GetGUID (), ARENA_TYPE_3v3_SOLO);
544
+ // this way we always get the correct solo team (sometimes when using GetArenaTeamByCaptain inside solo arena it can return a teamID >= 4293918720)
545
+ ArenaTeam* plrArenaTeam = sArenaTeamMgr ->GetArenaTeamById (player->GetArenaTeamId (ARENA_SLOT_SOLO_3v3));
540
546
541
547
if (!plrArenaTeam)
542
548
return ;
@@ -572,13 +578,10 @@ void Solo3v3BG::OnBattlegroundEndReward(Battleground* bg, Player* player, TeamId
572
578
atStats.Rank = 1 ;
573
579
ArenaTeamMgr::ArenaTeamContainer::const_iterator i = sArenaTeamMgr ->GetArenaTeamMapBegin ();
574
580
for (; i != sArenaTeamMgr ->GetArenaTeamMapEnd (); ++i) {
575
- if (i->second ->GetType () == ARENA_TYPE_3v3_SOLO && i->second ->GetStats ().Rating > atStats.Rating )
581
+ if (i->second ->GetType () == ARENA_TEAM_SOLO_3v3 && i->second ->GetStats ().Rating > atStats.Rating )
576
582
++atStats.Rank ;
577
583
}
578
584
579
- plrArenaTeam->SetArenaTeamStats (atStats);
580
- plrArenaTeam->NotifyStatsChanged ();
581
-
582
585
for (ArenaTeam::MemberList::iterator itr = plrArenaTeam->GetMembers ().begin (); itr != plrArenaTeam->GetMembers ().end (); ++itr)
583
586
{
584
587
if (itr->Guid == player->GetGUID ())
@@ -607,6 +610,8 @@ void Solo3v3BG::OnBattlegroundEndReward(Battleground* bg, Player* player, TeamId
607
610
608
611
}
609
612
613
+ plrArenaTeam->SetArenaTeamStats (atStats);
614
+ plrArenaTeam->NotifyStatsChanged ();
610
615
plrArenaTeam->SaveToDB (true );
611
616
}
612
617
}
@@ -653,9 +658,94 @@ void Team3v3arena::OnQueueIdToArenaType(const BattlegroundQueueTypeId _bgQueueTy
653
658
}
654
659
}
655
660
661
+ void Arena_SC::OnArenaStart (Battleground* bg)
662
+ {
663
+ if (bg->GetArenaType () != ARENA_TYPE_3v3_SOLO)
664
+ return ;
665
+
666
+ sSolo ->CheckStartSolo3v3Arena (bg);
667
+ }
668
+
669
+ void PlayerScript3v3Arena::OnBattlegroundDesertion (Player* player, const BattlegroundDesertionType type)
670
+ {
671
+ Battleground* bg = ((BattlegroundMap*)player->FindMap ())->GetBG ();
672
+
673
+ switch (type)
674
+ {
675
+ case ARENA_DESERTION_TYPE_LEAVE_BG:
676
+
677
+ if (bg->GetArenaType () == ARENA_TYPE_3v3_SOLO)
678
+ {
679
+ if (bg->GetStatus () == STATUS_WAIT_JOIN)
680
+ {
681
+ if (sConfigMgr ->GetOption <bool >(" Solo.3v3.CastDeserterOnAfk" , true ) || sConfigMgr ->GetOption <bool >(" Solo.3v3.CastDeserterOnLeave" , true ))
682
+ player->CastSpell (player, 26013 , true );
683
+
684
+ // end arena if a player leaves while in preparation
685
+ if (sConfigMgr ->GetOption <bool >(" Solo.3v3.StopGameIncomplete" , true ))
686
+ {
687
+ bg->SetRated (false );
688
+ bg->EndBattleground (TEAM_NEUTRAL);
689
+ }
690
+
691
+ sSolo ->CountAsLoss (player, false );
692
+ }
693
+
694
+ if (bg->GetStatus () == STATUS_IN_PROGRESS)
695
+ sSolo ->CountAsLoss (player, true );
696
+ }
697
+ break ;
698
+
699
+ case ARENA_DESERTION_TYPE_NO_ENTER_BUTTON: // called if player doesn't click 'enter arena' for solo 3v3
700
+
701
+ if (player->IsInvitedForBattlegroundQueueType ((BattlegroundQueueTypeId)BATTLEGROUND_QUEUE_3v3_SOLO))
702
+ {
703
+ if (sConfigMgr ->GetOption <bool >(" Solo.3v3.CastDeserterOnAfk" , true ))
704
+ player->CastSpell (player, 26013 , true );
705
+
706
+ sSolo ->CountAsLoss (player, false );
707
+ }
708
+ break ;
709
+
710
+ case ARENA_DESERTION_TYPE_INVITE_LOGOUT: // called if player logout when solo 3v3 queue pops (it removes the queue)
711
+
712
+ if (player->IsInvitedForBattlegroundQueueType ((BattlegroundQueueTypeId)BATTLEGROUND_QUEUE_3v3_SOLO))
713
+ {
714
+ if (sConfigMgr ->GetOption <bool >(" Solo.3v3.CastDeserterOnAfk" , true ) || sConfigMgr ->GetOption <bool >(" Solo.3v3.CastDeserterOnLeave" , true ))
715
+ player->CastSpell (player, 26013 , true );
716
+
717
+ sSolo ->CountAsLoss (player, false );
718
+ }
719
+ break ;
720
+
721
+ /*
722
+ case ARENA_DESERTION_TYPE_LEAVE_QUEUE: // called if player uses macro to leave queue when it pops. /run AcceptBattlefieldPort(1, 0);
723
+
724
+ // I believe these are being called AFTER the player removes the queue, so we can't know his queue
725
+ if (player->IsInvitedForBattlegroundQueueType((BattlegroundQueueTypeId)BATTLEGROUND_QUEUE_3v3_SOLO))
726
+ {
727
+ LOG_ERROR("solo3v3", "IsInvitedForBattlegroundQueueType BATTLEGROUND_QUEUE_3v3_SOLO");
728
+ sSolo->CountAsLoss(player, false);
729
+
730
+ }
731
+ else if (player->InBattlegroundQueueForBattlegroundQueueType((BattlegroundQueueTypeId)BATTLEGROUND_QUEUE_3v3_SOLO))
732
+ {
733
+ LOG_ERROR("solo3v3", "InBattlegroundQueueForBattlegroundQueueType BATTLEGROUND_QUEUE_3v3_SOLO");
734
+ }
735
+ else
736
+ {
737
+ LOG_ERROR("solo3v3", "ARENA_DESERTION_TYPE_LEAVE_QUEUE - else");
738
+ }
739
+ */
740
+
741
+ default :
742
+ break ;
743
+ }
744
+ }
745
+
656
746
void PlayerScript3v3Arena::OnLogin (Player* pPlayer)
657
747
{
658
- if (sConfigMgr ->GetOption <bool >(" Solo.3v3.Enable " , false )) {
748
+ if (sConfigMgr ->GetOption <bool >(" Solo.3v3.ShowMessageOnLogin " , false )) {
659
749
ChatHandler (pPlayer->GetSession ()).SendSysMessage (" This server is running the |cff4CFF00Arena solo Q 3v3 |rmodule." );
660
750
}
661
751
}
@@ -709,7 +799,6 @@ bool PlayerScript3v3Arena::NotSetArenaTeamInfoField(Player* player, uint8 slot,
709
799
return true ;
710
800
}
711
801
712
-
713
802
bool PlayerScript3v3Arena::CanBattleFieldPort (Player* player, uint8 arenaType, BattlegroundTypeId BGTypeID, uint8 /* action*/ )
714
803
{
715
804
if (!player)
0 commit comments