Skip to content

Commit

Permalink
Update npc_arena1v1.cpp
Browse files Browse the repository at this point in the history
block heal and tank talent tree
  • Loading branch information
Tony931023 committed Jul 20, 2023
1 parent f463db2 commit b12c15d
Showing 1 changed file with 13 additions and 24 deletions.
37 changes: 13 additions & 24 deletions src/npc_arena1v1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,32 +403,21 @@ class npc_1v1arena : public CreatureScript

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

bool healspec = player->HasHealSpec();
bool tankspec = player->HasTankSpec();

uint32 count = 0;

for (uint32 talentId = 0; talentId < sTalentStore.GetNumRows(); ++talentId)
{
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;
}

if (count >= 36)
{
ChatHandler(player->GetSession()).SendSysMessage("You can not join because you have too many talent points in a forbidden tree. (Heal / Tank)");
if (healspec == true)
{
ChatHandler(player->GetSession()).SendSysMessage("You can't join because you have forbidden talents (Heal)");
return false;
}
}

if (tankspec == true)
{
ChatHandler(player->GetSession()).SendSysMessage("You can't join because you have forbidden talents (Tank)");
return false;
}

return true;
}
Expand Down

0 comments on commit b12c15d

Please sign in to comment.