Jump to content

[patch] Allow disenchant roll if someone has skill in group

Guest Toinan67

Recommended Posts

  • * What bug does the patch fix? What features does the patch add?
    In this commit has been implemented the ROLL_VOTE_DISENCHANT disable mask.
    The player can't roll disenchant if he has not required skill in enchant, but he should be able to roll if someone in his group has enough skill; and that's what the patch adds.
    * For which repository revision was the patch created?
    * Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread.
    * Who has been writing this patch? Please include either forum user names or email addresses.
    porteyoplait (=me)

diff --git a/src/game/Group.cpp b/src/game/Group.cpp
index b38cf9f..48eb75d 100644
--- a/src/game/Group.cpp
+++ b/src/game/Group.cpp
@@ -636,7 +636,19 @@ RollVoteMask Group::GetVoteMaskFor( ItemPrototype const* itemProto, Player* play
    if (itemProto->Flags2 & ITEM_FLAGS2_NEED_ROLL_DISABLED)
        mask = RollVoteMask(mask & ~ROLL_VOTE_MASK_NEED);

-    if (!itemProto->DisenchantID || uint32(itemProto->RequiredDisenchantSkill) > player->GetSkillValue(SKILL_ENCHANTING))
+    //Player can loot disenchant if someone in the group has required skill
+    bool groupMemberHasEnchantSkill = false;
+    for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
+    {
+        Player* pGroupMember = itr->getSource();
+        if (pGroupMember && pGroupMember->GetSkillValue(SKILL_ENCHANTING) >= uint32(itemProto->RequiredDisenchantSkill))
+        {
+            groupMemberHasEnchantSkill = true;
+            break;
+        }
+    }
+    if (!itemProto->DisenchantID || !groupMemberHasEnchantSkill)
        mask = RollVoteMask(mask & ~ROLL_VOTE_MASK_DISENCHANT);

    return mask;

It may not be the best way however...

Link to comment
Share on other sites


1) i already test own patch

2) your version will scan group members for each roll player for each roll item, this too slow algo for raid * big loot list

3) i not so sure that this real group enchanters in comparison echanters in roll players (so mostly in meaning near stay group members only).

Because in roll player can be not only group members but also member who leave group after creature has been tapped for example.

Link to comment
Share on other sites

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use