Implement group loot for chest having GroupLootRules (go type=3, data15=1).

Implement round robin loot.
Implement round robin for underthreshold items (group loot and need befor greed).
Fix "all players pass" bug on creature.
Add SMSG_LOOT_LIST message to indicate looter (round robin or master).
And some other minor loot bugs.

Fixes issue #167.
Fixes issue #247.

--HG--
branch : trunk
This commit is contained in:
Trazom62
2010-03-11 22:55:02 +01:00
parent d9f257a18c
commit ed8c5ef6ff
10 changed files with 578 additions and 257 deletions

View File

@@ -61,6 +61,9 @@ GameObject::GameObject() : WorldObject(), m_goValue(new GameObjectValue)
m_DBTableGuid = 0;
m_rotation = 0;
m_groupLootTimer = 0;
lootingGroupLeaderGUID = 0;
ResetLootMode(); // restore default loot mode
}
@@ -210,7 +213,7 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMa
return true;
}
void GameObject::Update(uint32 /*p_time*/)
void GameObject::Update(uint32 diff)
{
if (IS_MO_TRANSPORT(GetGUID()))
{
@@ -432,6 +435,19 @@ void GameObject::Update(uint32 /*p_time*/)
m_cooldownTime = 0;
}
break;
case GAMEOBJECT_TYPE_CHEST:
if (m_groupLootTimer)
{
if (m_groupLootTimer <= diff)
{
Group* group = objmgr.GetGroupByLeader(lootingGroupLeaderGUID);
if (group)
group->EndRoll(&loot);
m_groupLootTimer = 0;
lootingGroupLeaderGUID = 0;
}
else m_groupLootTimer -= diff;
}
default:
break;
}
@@ -1111,7 +1127,7 @@ void GameObject::Use(Unit* user)
data << GetGUID();
player->GetSession()->SendPacket(&data);
}
else if (info->questgiver.gossipID)
else if (info->goober.gossipID)
{
player->PrepareGossipMenu(this, info->goober.gossipID);
player->SendPreparedGossip(this);