Fixed disenchanting rolls being allowed for all items, now works as intended
Renamed Faction to Flags2 in ItemPrototype and added use for some of them yay, my first commit :D --HG-- branch : trunk
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
ALTER TABLE `item_template` CHANGE `Faction` `FlagsExtra` INT(10) UNSIGNED NOT NULL DEFAULT '0';
|
||||||
@@ -732,6 +732,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder)
|
|||||||
{
|
{
|
||||||
//pCurrChar->groupInfo.group->SendInit(this); // useless
|
//pCurrChar->groupInfo.group->SendInit(this); // useless
|
||||||
group->SendUpdate();
|
group->SendUpdate();
|
||||||
|
group->ResetMaxEnchantingLevel();
|
||||||
}
|
}
|
||||||
|
|
||||||
// friend status
|
// friend status
|
||||||
|
|||||||
+28
-1
@@ -46,6 +46,7 @@ Group::Group()
|
|||||||
m_subGroupsCounts = NULL;
|
m_subGroupsCounts = NULL;
|
||||||
m_guid = 0;
|
m_guid = 0;
|
||||||
m_counter = 0;
|
m_counter = 0;
|
||||||
|
m_maxEnchantingLevel= 0;
|
||||||
|
|
||||||
for (uint8 i = 0; i < TARGETICONCOUNT; ++i)
|
for (uint8 i = 0; i < TARGETICONCOUNT; ++i)
|
||||||
m_targetIcons[i] = 0;
|
m_targetIcons[i] = 0;
|
||||||
@@ -332,6 +333,9 @@ bool Group::AddMember(const uint64 &guid, const char* name)
|
|||||||
// quest related GO state dependent from raid memebership
|
// quest related GO state dependent from raid memebership
|
||||||
if (isRaidGroup())
|
if (isRaidGroup())
|
||||||
player->UpdateForQuestWorldObjects();
|
player->UpdateForQuestWorldObjects();
|
||||||
|
|
||||||
|
if (m_maxEnchantingLevel < player->GetSkillValue(SKILL_ENCHANTING))
|
||||||
|
m_maxEnchantingLevel = player->GetSkillValue(SKILL_ENCHANTING);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -384,6 +388,7 @@ uint32 Group::RemoveMember(const uint64 &guid, const uint8 &method)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SendUpdate();
|
SendUpdate();
|
||||||
|
ResetMaxEnchantingLevel();
|
||||||
}
|
}
|
||||||
// if group before remove <= 2 disband it
|
// if group before remove <= 2 disband it
|
||||||
else
|
else
|
||||||
@@ -504,7 +509,7 @@ void Group::SendLootStartRoll(uint32 CountDown, uint32 mapid, const Roll &r)
|
|||||||
data << uint32(r.itemRandomPropId); // item random property ID
|
data << uint32(r.itemRandomPropId); // item random property ID
|
||||||
data << uint32(r.itemCount); // items in stack
|
data << uint32(r.itemCount); // items in stack
|
||||||
data << uint32(CountDown); // the countdown time to choose "need" or "greed"
|
data << uint32(CountDown); // the countdown time to choose "need" or "greed"
|
||||||
data << uint8(ALL_ROLL_TYPE_MASK); // roll type mask
|
data << uint8(r.rollVoteMask); // roll type mask
|
||||||
|
|
||||||
for (Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr != r.playerVote.end(); ++itr)
|
for (Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr != r.playerVote.end(); ++itr)
|
||||||
{
|
{
|
||||||
@@ -655,6 +660,11 @@ void Group::GroupLoot(Loot *loot, WorldObject* pLootedObject)
|
|||||||
{
|
{
|
||||||
r->setLoot(loot);
|
r->setLoot(loot);
|
||||||
r->itemSlot = itemSlot;
|
r->itemSlot = itemSlot;
|
||||||
|
if (item->DisenchantID && m_maxEnchantingLevel >= item->RequiredDisenchantSkill)
|
||||||
|
r->rollVoteMask |= ROLL_FLAG_TYPE_DISENCHANT;
|
||||||
|
|
||||||
|
if (item->Flags2 & ITEM_FLAGS_EXTRA_NEED_ROLL_DISABLED)
|
||||||
|
r->rollVoteMask &= ~ROLL_FLAG_TYPE_NEED;
|
||||||
|
|
||||||
loot->items[itemSlot].is_blocked = true;
|
loot->items[itemSlot].is_blocked = true;
|
||||||
|
|
||||||
@@ -744,6 +754,11 @@ void Group::NeedBeforeGreed(Loot *loot, WorldObject* pLootedObject)
|
|||||||
{
|
{
|
||||||
r->setLoot(loot);
|
r->setLoot(loot);
|
||||||
r->itemSlot = itemSlot;
|
r->itemSlot = itemSlot;
|
||||||
|
if (item->DisenchantID && m_maxEnchantingLevel >= item->RequiredDisenchantSkill)
|
||||||
|
r->rollVoteMask |= ROLL_FLAG_TYPE_DISENCHANT;
|
||||||
|
|
||||||
|
if (item->Flags2 & ITEM_FLAGS_EXTRA_NEED_ROLL_DISABLED)
|
||||||
|
r->rollVoteMask &= ~ROLL_FLAG_TYPE_NEED;
|
||||||
|
|
||||||
loot->items[itemSlot].is_blocked = true;
|
loot->items[itemSlot].is_blocked = true;
|
||||||
|
|
||||||
@@ -1827,3 +1842,15 @@ void Group::BroadcastGroupUpdate(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Group::ResetMaxEnchantingLevel()
|
||||||
|
{
|
||||||
|
m_maxEnchantingLevel = 0;
|
||||||
|
Player *pMember = NULL;
|
||||||
|
for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
|
||||||
|
{
|
||||||
|
if (pMember = objmgr.GetPlayer(citr->guid))
|
||||||
|
if (m_maxEnchantingLevel < pMember->GetSkillValue(SKILL_ENCHANTING))
|
||||||
|
m_maxEnchantingLevel = pMember->GetSkillValue(SKILL_ENCHANTING);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
+6
-1
@@ -115,7 +115,7 @@ class Roll : public LootValidatorRef
|
|||||||
public:
|
public:
|
||||||
Roll(uint64 _guid, LootItem const& li)
|
Roll(uint64 _guid, LootItem const& li)
|
||||||
: itemGUID(_guid), itemid(li.itemid), itemRandomPropId(li.randomPropertyId), itemRandomSuffix(li.randomSuffix), itemCount(li.count),
|
: itemGUID(_guid), itemid(li.itemid), itemRandomPropId(li.randomPropertyId), itemRandomSuffix(li.randomSuffix), itemCount(li.count),
|
||||||
totalPlayersRolling(0), totalNeed(0), totalGreed(0), totalPass(0), itemSlot(0) {}
|
totalPlayersRolling(0), totalNeed(0), totalGreed(0), totalPass(0), itemSlot(0), rollVoteMask(ROLL_ALL_TYPE_NO_DISENCHANT) {}
|
||||||
~Roll() { }
|
~Roll() { }
|
||||||
void setLoot(Loot *pLoot) { link(pLoot, this); }
|
void setLoot(Loot *pLoot) { link(pLoot, this); }
|
||||||
Loot *getLoot() { return getTarget(); }
|
Loot *getLoot() { return getTarget(); }
|
||||||
@@ -133,6 +133,7 @@ class Roll : public LootValidatorRef
|
|||||||
uint8 totalGreed;
|
uint8 totalGreed;
|
||||||
uint8 totalPass;
|
uint8 totalPass;
|
||||||
uint8 itemSlot;
|
uint8 itemSlot;
|
||||||
|
uint8 rollVoteMask;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct InstanceGroupBind
|
struct InstanceGroupBind
|
||||||
@@ -345,6 +346,9 @@ class Group
|
|||||||
void CountRollVote(const uint64& playerGUID, const uint64& Guid, uint32 NumberOfPlayers, uint8 Choise);
|
void CountRollVote(const uint64& playerGUID, const uint64& Guid, uint32 NumberOfPlayers, uint8 Choise);
|
||||||
void EndRoll(Loot *loot);
|
void EndRoll(Loot *loot);
|
||||||
|
|
||||||
|
// related to disenchant rolls
|
||||||
|
void ResetMaxEnchantingLevel();
|
||||||
|
|
||||||
void LinkMember(GroupReference *pRef) { m_memberMgr.insertFirst(pRef); }
|
void LinkMember(GroupReference *pRef) { m_memberMgr.insertFirst(pRef); }
|
||||||
void DelinkMember(GroupReference* /*pRef*/) { }
|
void DelinkMember(GroupReference* /*pRef*/) { }
|
||||||
|
|
||||||
@@ -451,5 +455,6 @@ class Group
|
|||||||
uint8* m_subGroupsCounts;
|
uint8* m_subGroupsCounts;
|
||||||
uint64 m_guid;
|
uint64 m_guid;
|
||||||
uint32 m_counter; // used only in SMSG_GROUP_LIST
|
uint32 m_counter; // used only in SMSG_GROUP_LIST
|
||||||
|
uint32 m_maxEnchantingLevel;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -319,7 +319,7 @@ void WorldSession::HandleItemQuerySingleOpcode(WorldPacket & recv_data)
|
|||||||
data << pProto->DisplayInfoID;
|
data << pProto->DisplayInfoID;
|
||||||
data << pProto->Quality;
|
data << pProto->Quality;
|
||||||
data << pProto->Flags;
|
data << pProto->Flags;
|
||||||
data << pProto->Faction; // 3.2 faction?
|
data << pProto->Flags2;
|
||||||
data << pProto->BuyPrice;
|
data << pProto->BuyPrice;
|
||||||
data << pProto->SellPrice;
|
data << pProto->SellPrice;
|
||||||
data << pProto->InventoryType;
|
data << pProto->InventoryType;
|
||||||
@@ -765,7 +765,7 @@ void WorldSession::SendListInventory(uint64 vendorguid)
|
|||||||
// `item_template`.`Faction` is actually `Team`.
|
// `item_template`.`Faction` is actually `Team`.
|
||||||
// 1 == Horde / 2 == Alliance. Field will be renamed in later
|
// 1 == Horde / 2 == Alliance. Field will be renamed in later
|
||||||
// patch.
|
// patch.
|
||||||
if (pProto->Faction == 1 && _player->GetTeam() == ALLIANCE || pProto->Faction == 2 && _player->GetTeam() == HORDE && !_player->isGameMaster())
|
if (pProto->Flags2 & ITEM_FLAGS_EXTRA_HORDE_ONLY && _player->GetTeam() == ALLIANCE || pProto->Flags2 == ITEM_FLAGS_EXTRA_ALLIANCE_ONLY && _player->GetTeam() == HORDE && !_player->isGameMaster())
|
||||||
continue;
|
continue;
|
||||||
++count;
|
++count;
|
||||||
|
|
||||||
|
|||||||
@@ -131,6 +131,14 @@ enum ITEM_FLAGS
|
|||||||
ITEM_FLAGS_BOP_TRADEABLE = 0x80000000
|
ITEM_FLAGS_BOP_TRADEABLE = 0x80000000
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum ItemFlagsExtra
|
||||||
|
{
|
||||||
|
ITEM_FLAGS_EXTRA_HORDE_ONLY = 0x00000001,
|
||||||
|
ITEM_FLAGS_EXTRA_ALLIANCE_ONLY = 0x00000002,
|
||||||
|
ITEM_FLAGS_EXTRA_REFUNDABLE = 0x00000004,
|
||||||
|
ITEM_FLAGS_EXTRA_NEED_ROLL_DISABLED = 0x00000100
|
||||||
|
};
|
||||||
|
|
||||||
enum BAG_FAMILY_MASK
|
enum BAG_FAMILY_MASK
|
||||||
{
|
{
|
||||||
BAG_FAMILY_MASK_NONE = 0x00000000,
|
BAG_FAMILY_MASK_NONE = 0x00000000,
|
||||||
@@ -524,8 +532,8 @@ struct ItemPrototype
|
|||||||
char* Name1;
|
char* Name1;
|
||||||
uint32 DisplayInfoID; // id from ItemDisplayInfo.dbc
|
uint32 DisplayInfoID; // id from ItemDisplayInfo.dbc
|
||||||
uint32 Quality;
|
uint32 Quality;
|
||||||
int32 Flags;
|
uint32 Flags;
|
||||||
uint32 Faction;
|
uint32 Flags2;
|
||||||
uint32 BuyCount;
|
uint32 BuyCount;
|
||||||
int32 BuyPrice;
|
int32 BuyPrice;
|
||||||
uint32 SellPrice;
|
uint32 SellPrice;
|
||||||
|
|||||||
+10
-1
@@ -38,7 +38,16 @@ enum RollType
|
|||||||
MAX_ROLL_TYPE = 4
|
MAX_ROLL_TYPE = 4
|
||||||
};
|
};
|
||||||
|
|
||||||
#define ALL_ROLL_TYPE_MASK 0x0F
|
enum RollMask
|
||||||
|
{
|
||||||
|
ROLL_FLAG_TYPE_PASS = 0x01,
|
||||||
|
ROLL_FLAG_TYPE_NEED = 0x02,
|
||||||
|
ROLL_FLAG_TYPE_GREED = 0x04,
|
||||||
|
ROLL_FLAG_TYPE_DISENCHANT = 0x08,
|
||||||
|
|
||||||
|
ROLL_ALL_TYPE_NO_DISENCHANT = 0x07,
|
||||||
|
ROLL_ALL_TYPE_MASK = 0x0F
|
||||||
|
};
|
||||||
|
|
||||||
#define MAX_NR_LOOT_ITEMS 16
|
#define MAX_NR_LOOT_ITEMS 16
|
||||||
// note: the client cannot show more than 16 items total
|
// note: the client cannot show more than 16 items total
|
||||||
|
|||||||
@@ -433,9 +433,12 @@ void WorldSession::LogoutPlayer(bool Save)
|
|||||||
if (_player->GetGroup() && !_player->GetGroup()->isRaidGroup() && m_Socket)
|
if (_player->GetGroup() && !_player->GetGroup()->isRaidGroup() && m_Socket)
|
||||||
_player->RemoveFromGroup();
|
_player->RemoveFromGroup();
|
||||||
|
|
||||||
///- Send update to group
|
///- Send update to group and reset stored max enchanting level
|
||||||
if (_player->GetGroup())
|
if (_player->GetGroup())
|
||||||
|
{
|
||||||
_player->GetGroup()->SendUpdate();
|
_player->GetGroup()->SendUpdate();
|
||||||
|
_player->GetGroup()->ResetMaxEnchantingLevel();
|
||||||
|
}
|
||||||
|
|
||||||
///- Broadcast a logout message to the player's friends
|
///- Broadcast a logout message to the player's friends
|
||||||
sSocialMgr.SendFriendStatus(_player, FRIEND_OFFLINE, _player->GetGUIDLow(), true);
|
sSocialMgr.SendFriendStatus(_player, FRIEND_OFFLINE, _player->GetGUIDLow(), true);
|
||||||
|
|||||||
Reference in New Issue
Block a user