aboutsummaryrefslogtreecommitdiff
path: root/src/game/Creature.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/Creature.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/Creature.cpp')
-rw-r--r--src/game/Creature.cpp35
1 files changed, 17 insertions, 18 deletions
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp
index 4b31668db62..9b4332a579f 100644
--- a/src/game/Creature.cpp
+++ b/src/game/Creature.cpp
@@ -485,7 +485,22 @@ void Creature::Update(uint32 diff)
if (m_isDeadByDefault)
break;
- if( m_deathTimer <= diff )
+ if (m_groupLootTimer && lootingGroupLeaderGUID)
+ {
+ // for delayed spells
+ m_Events.Update(diff);
+
+ if (m_groupLootTimer <= diff)
+ {
+ Group* group = objmgr.GetGroupByLeader(lootingGroupLeaderGUID);
+ if (group)
+ group->EndRoll(&loot);
+ m_groupLootTimer = 0;
+ lootingGroupLeaderGUID = 0;
+ }
+ else m_groupLootTimer -= diff;
+ }
+ else if (m_deathTimer <= diff)
{
RemoveCorpse();
DEBUG_LOG("Removing corpse... %u ", GetUInt32Value(OBJECT_FIELD_ENTRY));
@@ -493,24 +508,8 @@ void Creature::Update(uint32 diff)
else
{
// for delayed spells
- m_Events.Update( diff );
-
+ m_Events.Update(diff);
m_deathTimer -= diff;
- if (m_groupLootTimer && lootingGroupLeaderGUID)
- {
- if(diff <= m_groupLootTimer)
- {
- m_groupLootTimer -= diff;
- }
- else
- {
- Group* group = objmgr.GetGroupByLeader(lootingGroupLeaderGUID);
- if (group)
- group->EndRoll();
- m_groupLootTimer = 0;
- lootingGroupLeaderGUID = 0;
- }
- }
}
break;