Skip to content

Commit

Permalink
Prevent reseting talents while in queue
Browse files Browse the repository at this point in the history
  • Loading branch information
laasker committed Sep 20, 2024
1 parent 4c8d6a5 commit 4f72be8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 27 deletions.
27 changes: 0 additions & 27 deletions src/solo3v3_sc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -717,30 +717,3 @@ 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;
// }
// }
26 changes: 26 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 @@ -288,6 +289,30 @@ class CommandJoinSolo : public CommandScript
}
};

class SpellSolo3v3_SC : public SpellSC
{
public:
SpellSolo3v3_SC() : SpellSC("SpellSolo3v3_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 solo arena.");
return false;
}
}

return true;
}
};

void AddSC_Solo_3v3_Arena()
{
if (!ArenaTeam::ArenaSlotByType.count(ARENA_TEAM_SOLO_3v3))
Expand All @@ -312,4 +337,5 @@ void AddSC_Solo_3v3_Arena()
new PlayerScript3v3Arena();
new Arena_SC();
new CommandJoinSolo();
new SpellSolo3v3_SC();
}

0 comments on commit 4f72be8

Please sign in to comment.