Skip to content

Commit

Permalink
Merge branch 'master' of github.com:azerothcore/mod-arena-3v3-solo-queue
Browse files Browse the repository at this point in the history
  • Loading branch information
Helias committed Sep 29, 2024
2 parents 1efbc92 + 78a93e3 commit ee817a6
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 27 deletions.
28 changes: 1 addition & 27 deletions src/solo3v3_sc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -726,33 +726,6 @@ bool PlayerScript3v3Arena::CanBattleFieldPort(Player* player, uint8 arenaType, B
return true;
}


// class Spell_SC : public SpellSC
// {
// public:
// Spell_SC() : SpellSC("Spell_SC") { }

// bool CanSelectSpecTalent(Spell* spell) override
// {
// if (!spell)
// return false;

// if (spell->GetCaster()->isPlayer())
// {
// Player* plr = spell->GetCaster()->ToPlayer();

// if (plr->InBattlegroundQueueForBattlegroundQueueType((BattlegroundQueueTypeId)BATTLEGROUND_QUEUE_3v3_SOLO) /*||
// plr->InBattlegroundQueueForBattlegroundQueueType((BattlegroundQueueTypeId)BATTLEGROUND_QUEUE_1v1)*/)
// {
// plr->GetSession()->SendAreaTriggerMessage("You can't change your talents while in queue for 3v3."); // or 1v1
// return false;
// }
// }

// return true;
// }
// }

void AddSC_Solo_3v3_Arena()
{
if (!ArenaTeam::ArenaSlotByType.count(ARENA_TEAM_SOLO_3v3))
Expand All @@ -776,4 +749,5 @@ void AddSC_Solo_3v3_Arena()
new ConfigLoader3v3Arena();
new PlayerScript3v3Arena();
new Arena_SC();
new Solo3v3Spell();
}
28 changes: 28 additions & 0 deletions src/solo3v3_sc.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "Config.h"
#include "Battleground.h"
#include "solo3v3.h"
#include "Spell.h"

#define NPC_TEXT_3v3 1000004

Expand Down Expand Up @@ -143,3 +144,30 @@ class Arena_SC : public ArenaScript
return true;
}
};

class Solo3v3Spell : public SpellSC
{
public:
Solo3v3Spell() : SpellSC("Solo3v3Spell") { }


bool CanSelectSpecTalent(Spell* spell) override
{
if (!spell)
return false;

if (spell->GetCaster()->IsPlayer())
{
Player* plr = spell->GetCaster()->ToPlayer();

if (plr->InBattlegroundQueueForBattlegroundQueueType((BattlegroundQueueTypeId)BATTLEGROUND_QUEUE_3v3_SOLO))
{
plr->GetSession()->SendAreaTriggerMessage("You can't change your talents while in queue for solo arena.");
return false;
}
}

return true;
}

};

0 comments on commit ee817a6

Please sign in to comment.