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

feat. block heal and tank talent tree #49

Closed
wants to merge 1 commit into from
Closed
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
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