Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent switching spec while in queue for Solo Arena #20

Merged
merged 3 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 1 addition & 27 deletions src/solo3v3_sc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -721,33 +721,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 @@ -771,4 +744,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"

enum Npc3v3Actions {
NPC_3v3_ACTION_CREATE_ARENA_TEAM = 1,
Expand Down Expand Up @@ -140,3 +141,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->InBattlegroundQueueForBattlegroundQueueType((BattlegroundQueueTypeId)BATTLEGROUND_QUEUE_1v1))
Helias marked this conversation as resolved.
Show resolved Hide resolved
{
plr->GetSession()->SendAreaTriggerMessage("You can't change your talents while in queue for solo arena.");
return false;
}
}

return true;
}

};