Permalink
Browse files

Merge branch 'master' of http://github.com/mangos/mangos into world_pvp

  • Loading branch information...
2 parents be83cbd + 3bfe995 commit 3698593bd2a5d0f6f4e7d96bcc6748e8b56dcff8 @stfx stfx committed Apr 12, 2012
Showing with 25 additions and 17 deletions.
  1. +3 −3 src/game/Creature.cpp
  2. +4 −3 src/game/GameObject.cpp
  3. +7 −7 src/game/Group.cpp
  4. +1 −1 src/game/Group.h
  5. +9 −2 src/game/SpellAuras.cpp
  6. +1 −1 src/shared/revision_nr.h
View
@@ -542,10 +542,10 @@ void Creature::Update(uint32 update_diff, uint32 diff)
m_corpseDecayTimer -= update_diff;
if (m_groupLootId)
{
- if(update_diff < m_groupLootTimer)
- m_groupLootTimer -= update_diff;
- else
+ if (m_groupLootTimer <= update_diff)
StopGroupLoot();
+ else
+ m_groupLootTimer -= update_diff;
}
}
View
@@ -1796,13 +1796,14 @@ void GameObject::SetDisplayId(uint32 modelId)
void GameObject::StartGroupLoot(Group* group, uint32 timer)
{
m_groupLootId = group->GetId();
-
- if (m_groupLootId)
- m_groupLootTimer = timer;
+ m_groupLootTimer = timer;
}
void GameObject::StopGroupLoot()
{
+ if (!m_groupLootId)
+ return;
+
if (Group* group = sObjectMgr.GetGroupById(m_groupLootId))
group->EndRoll();
View
@@ -601,7 +601,7 @@ void Group::GroupLoot(WorldObject* pSource, Loot* loot)
//roll for over-threshold item if it's one-player loot
if (itemProto->Quality >= uint32(m_lootThreshold) && !lootItem.freeforall)
- StartLootRool(pSource, GROUP_LOOT, loot, itemSlot, maxEnchantingSkill);
+ StartLootRoll(pSource, GROUP_LOOT, loot, itemSlot, maxEnchantingSkill);
else
lootItem.is_underthreshold = 1;
}
@@ -623,7 +623,7 @@ void Group::NeedBeforeGreed(WorldObject* pSource, Loot* loot)
//only roll for one-player items, not for ones everyone can get
if (itemProto->Quality >= uint32(m_lootThreshold) && !lootItem.freeforall)
- StartLootRool(pSource, NEED_BEFORE_GREED, loot, itemSlot, maxEnchantingSkill);
+ StartLootRoll(pSource, NEED_BEFORE_GREED, loot, itemSlot, maxEnchantingSkill);
else
lootItem.is_underthreshold = 1;
}
@@ -743,20 +743,20 @@ bool Group::CountRollVote(ObjectGuid const& playerGUID, Rolls::iterator& rollI,
return false;
}
-void Group::StartLootRool(WorldObject* lootTarget, LootMethod method, Loot* loot, uint8 itemSlot, uint32 maxEnchantingSkill)
+void Group::StartLootRoll(WorldObject* lootTarget, LootMethod method, Loot* loot, uint8 itemSlot, uint32 maxEnchantingSkill)
{
if (itemSlot >= loot->items.size())
return;
- LootItem const& lootItem = loot->items[itemSlot];
+ LootItem const& lootItem = loot->items[itemSlot];
Roll* r = new Roll(lootTarget->GetObjectGuid(), method, lootItem);
//a vector is filled with only near party members
- for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
+ for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
{
- Player *playerToRoll = itr->getSource();
- if(!playerToRoll || !playerToRoll->GetSession())
+ Player* playerToRoll = itr->getSource();
+ if (!playerToRoll || !playerToRoll->GetSession())
continue;
if (lootItem.AllowedForPlayer(playerToRoll))
View
@@ -353,7 +353,7 @@ class MANGOS_DLL_SPEC Group
void NeedBeforeGreed(WorldObject* pSource, Loot* loot);
void MasterLoot(WorldObject* pSource, Loot* loot);
bool CountRollVote(Player* player, ObjectGuid const& lootedTarget, uint32 itemSlot, RollVote vote);
- void StartLootRool(WorldObject* lootTarget, LootMethod method, Loot* loot, uint8 itemSlot, uint32 maxEnchantingSkill);
+ void StartLootRoll(WorldObject* lootTarget, LootMethod method, Loot* loot, uint8 itemSlot, uint32 maxEnchantingSkill);
void EndRoll();
void LinkMember(GroupReference *pRef) { m_memberMgr.insertFirst(pRef); }
View
@@ -1255,8 +1255,15 @@ void Aura::TriggerSpell()
triggerTarget->CastCustomSpell(triggerTarget, 29879, &bpDamage, NULL, NULL, true, NULL, this, casterGUID);
return;
}
-// // Detonate Mana
-// case 27819: break;
+ // Detonate Mana
+ case 27819:
+ {
+ // 33% Mana Burn on normal mode, 50% on heroic mode
+ int32 bpDamage = (int32)triggerTarget->GetPower(POWER_MANA) / (triggerTarget->GetMap()->GetDifficulty() ? 2 : 3);
+ triggerTarget->ModifyPower(POWER_MANA, -bpDamage);
+ triggerTarget->CastCustomSpell(triggerTarget, 27820, &bpDamage, NULL, NULL, true, NULL, this, triggerTarget->GetObjectGuid());
+ return;
+ }
// // Controller Timer
// case 28095: break;
// Stalagg Chain and Feugen Chain
View
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
- #define REVISION_NR "11949"
+ #define REVISION_NR "11951"
#endif // __REVISION_NR_H__

0 comments on commit 3698593

Please sign in to comment.