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

chore. Prevent tanks and heals in config #50

Merged
merged 1 commit into from
Mar 17, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
22 changes: 15 additions & 7 deletions conf/1v1arena.conf.dist
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,22 @@ Arena1v1.VendorRating = 0
Arena1v1.ArenaPointsMulti = 0.64

#
# Arena1v1.BlockForbiddenTalents
# Description: If true, healers can't join 1v1 arena, if they invested more than 35 talentpoints in a healing-talenttree.
# You can also block tanks and other talents, if you modify FORBIDDEN_TALENTS_IN_1V1_ARENA in the npc_arena1v1.h file (hardcoding). See TalentTab.dbc for available talents (you will need an DBC-Editor).
# Default: 1 - (true)
# 0 - (false)
# Arena1v1.PreventHealingTalents
# Description: If enabled, it prevents people from having healing talents.
# Default: false
# Value: false
# true

Arena1v1.BlockForbiddenTalents = 1
Arena1v1.PreventHealingTalents = false

#
# Arena1v1.PreventTankTalents
# Description: If enabled, it prevents people from having tank talents.
# Default: false
# Value: false
# true

Arena1v1.PreventTankTalents = false

#
# Arena1v1.ForbiddenTalentsIDs
Expand All @@ -69,7 +78,6 @@ Arena1v1.BlockForbiddenTalents = 1

Arena1v1.ForbiddenTalentsIDs = "0"


#
# Arena1v1.ArenaSlotID
# Description: The slot the 1v1 will be working over. Needs to be bigger or equals then 3 otherwise it will overwrite the 2v2, 3v3 or 5v5 data
Expand Down
27 changes: 5 additions & 22 deletions src/npc_arena1v1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,32 +401,15 @@ class npc_1v1arena : public CreatureScript
if (!player)
return false;

if (sConfigMgr->GetOption<bool>("Arena1v1.BlockForbiddenTalents", true) == false)
return true;

uint32 count = 0;

for (uint32 talentId = 0; talentId < sTalentStore.GetNumRows(); ++talentId)
if (player->HasHealSpec() && (sConfigMgr->GetOption<bool>("Arena1v1.PreventHealingTalents", false)))
{
TalentEntry const* talentInfo = sTalentStore.LookupEntry(talentId);

if (!talentInfo)
continue;

if (std::find(forbiddenTalents.begin(), forbiddenTalents.end(), talentInfo->TalentID) != forbiddenTalents.end())
{
ChatHandler(player->GetSession()).SendSysMessage("You can not join because you have forbidden talents.");
return false;
}

for (int8 rank = MAX_TALENT_RANK - 1; rank >= 0; --rank)
if (talentInfo->RankID[rank] == 0)
continue;
ChatHandler(player->GetSession()).SendSysMessage("You can't join because you have forbidden talents (Heal)");
return false;
}

if (count >= 36)
if (player->HasTankSpec() && (sConfigMgr->GetOption<bool>("Arena1v1.PreventTankTalents", false)))
{
ChatHandler(player->GetSession()).SendSysMessage("You can not join because you have too many talent points in a forbidden tree. (Heal / Tank)");
ChatHandler(player->GetSession()).SendSysMessage("You can't join because you have forbidden talents (Tank)");
return false;
}

Expand Down
Loading