aboutsummaryrefslogtreecommitdiff
path: root/src/game/GameObject.cpp
diff options
context:
space:
mode:
authorTrazom62 <none@none>2010-03-11 22:55:02 +0100
committerTrazom62 <none@none>2010-03-11 22:55:02 +0100
commited8c5ef6ffdbeadb600990fe683f5e20e8f31759 (patch)
treea9628a30089fae19083326d8f38aa2b45f11b8cd /src/game/GameObject.cpp
parentd9f257a18c8e7984168d52b2d89b8e1582e27925 (diff)
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
Diffstat (limited to 'src/game/GameObject.cpp')
-rw-r--r--src/game/GameObject.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp
index 8f47aa83a2a..aa8e6ca9cec 100644
--- a/src/game/GameObject.cpp
+++ b/src/game/GameObject.cpp
@@ -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);