mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-09-27 18:30:08 +00:00
Fix quest item drop chances being shared between missions
In our original implementation, quest item drops were rolled on the spot, so the chances of getting two quest items for different missions in a single kill (where both missions have you kill the same mob) were independent of each other. When we made quest item drop chances shared between group members so players doing missions together would progress at the same rate, we accidentally linked the quest item odds of different missions together. This change makes it so that the odds are per-task, so they're shared between different group members doing the same tasks, but distinct for different tasks being done by the same player.
This commit is contained in:
@@ -567,7 +567,7 @@ void Missions::updateFusionMatter(CNSocket* sock, int fusion) {
|
||||
PlayerManager::sendToViewable(sock, (void*)&bcast, P_FE2CL_PC_EVENT, sizeof(sP_FE2CL_PC_EVENT));
|
||||
}
|
||||
|
||||
void Missions::mobKilled(CNSocket *sock, int mobid, int rolledQItem) {
|
||||
void Missions::mobKilled(CNSocket *sock, int mobid, std::map<int, int>& rolls) {
|
||||
Player *plr = PlayerManager::getPlayer(sock);
|
||||
|
||||
bool missionmob = false;
|
||||
@@ -593,7 +593,7 @@ void Missions::mobKilled(CNSocket *sock, int mobid, int rolledQItem) {
|
||||
|
||||
// drop quest item
|
||||
if (task["m_iCSUItemNumNeeded"][j] != 0 && !isQuestItemFull(sock, task["m_iCSUItemID"][j], task["m_iCSUItemNumNeeded"][j]) ) {
|
||||
bool drop = rolledQItem % 100 < task["m_iSTItemDropRate"][j];
|
||||
bool drop = rolls[plr->tasks[i]] % 100 < task["m_iSTItemDropRate"][j];
|
||||
if (drop) {
|
||||
dropQuestItem(sock, plr->tasks[i], 1, task["m_iCSUItemID"][j], mobid);
|
||||
|
||||
|
Reference in New Issue
Block a user