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

Tn奖励 #2

Merged
merged 2 commits into from
Jan 15, 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
19 changes: 18 additions & 1 deletion src/server/game/DungeonFinding/LFGMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1674,7 +1674,11 @@ namespace lfg
//else // some cleanup? LeaveLFG?
// ;
}

//grp->SetLfgRoles(pguid, proposal.players.find(pguid)->second.role);
//随机副本设置职业
uint32 roles = proposal.players.find(pguid)->second.role;
player->roles = roles;
grp->SetLfgRoles(pguid, roles);
grp->SetLfgRoles(pguid, proposal.players.find(pguid)->second.role);
}

Expand Down Expand Up @@ -2282,14 +2286,27 @@ namespace lfg

// if we can take the quest, means that we haven't done this kind of "run", IE: First Heroic Random of Day.
if (player->CanRewardQuest(quest, false))
if (player->roles == PLAYER_ROLE_TANK || player->roles == PLAYER_ROLE_HEALER)
// 如果玩家选择了坦克或奶妈角色,执行奖励逻辑
{
player->AddItem(62453, 1);//T/N奖励额外兰德鲁的礼物盒
//player->AddItem(49426, 1);//T/N奖励额外兰德鲁的礼物盒
player->SendSystemMessage("坦克奶妈额外奖励已发放-TN宝箱*1");
}
player->RewardQuest(quest, 0, nullptr, false, true);
}
else
{
done = true;
quest = sObjectMgr->GetQuestTemplate(reward->otherQuest);
if (!quest)
continue;
// we give reward without informing client (retail does this)
if (player->roles == PLAYER_ROLE_TANK || player->roles == PLAYER_ROLE_HEALER)
{
player->AddItem(62453, 1);//T/N奖励额外牌子
player->SendSystemMessage("坦克奶妈额外奖励已发放-TN宝箱*1");
}
player->RewardQuest(quest, 0, nullptr, false, true);
}

Expand Down
4 changes: 4 additions & 0 deletions src/server/game/Entities/Player/Player.h
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,10 @@ class Player : public Unit, public GridObject<Player>
explicit Player(WorldSession* session);
~Player() override;

public:
//随机本职业
uint32 roles;

void CleanupsBeforeDelete(bool finalCleanup = true) override;

void AddToWorld() override;
Expand Down