Skip to content

Commit

Permalink
Merge pull request #2 from dongkui555/TN奖励
Browse files Browse the repository at this point in the history
Tn奖励
  • Loading branch information
dongkui555 authored Jan 15, 2024
2 parents a5cd23f + af96847 commit a4a43e2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
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

0 comments on commit a4a43e2

Please sign in to comment.