aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/Creature.h4
-rw-r--r--src/game/GameObject.h4
-rw-r--r--src/game/LootMgr.cpp2
-rw-r--r--src/game/LootMgr.h2
-rw-r--r--src/game/SharedDefines.h11
-rw-r--r--src/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp12
6 files changed, 21 insertions, 14 deletions
diff --git a/src/game/Creature.h b/src/game/Creature.h
index ad8dfc2b01c..58974fe0c83 100644
--- a/src/game/Creature.h
+++ b/src/game/Creature.h
@@ -551,7 +551,7 @@ class TRINITY_DLL_SPEC Creature : public Unit, public GridObject<Creature>
void SetLootMode(uint16 lootMode) { m_LootMode = lootMode; }
void AddLootMode(uint16 lootMode) { m_LootMode |= lootMode; }
void RemoveLootMode(uint16 lootMode) { m_LootMode &= ~lootMode; }
- void ResetLootMode() { m_LootMode = DEFAULT_LOOT_MODE; }
+ void ResetLootMode() { m_LootMode = LOOT_MODE_DEFAULT; }
SpellEntry const *reachWithSpellAttack(Unit *pVictim);
SpellEntry const *reachWithSpellCure(Unit *pVictim);
@@ -709,7 +709,7 @@ class TRINITY_DLL_SPEC Creature : public Unit, public GridObject<Creature>
CreatureInfo const* m_creatureInfo; // in difficulty mode > 0 can different from ObjMgr::GetCreatureTemplate(GetEntry())
CreatureData const* m_creatureData;
- uint16 m_LootMode; // bitmask, default DEFAULT_LOOT_MODE, determines what loot will be lootable
+ uint16 m_LootMode; // bitmask, default LOOT_MODE_DEFAULT, determines what loot will be lootable
private:
//WaypointMovementGenerator vars
diff --git a/src/game/GameObject.h b/src/game/GameObject.h
index dd0b3508b36..104263154db 100644
--- a/src/game/GameObject.h
+++ b/src/game/GameObject.h
@@ -687,7 +687,7 @@ class TRINITY_DLL_SPEC GameObject : public WorldObject, public GridObject<GameOb
void SetLootMode(uint16 lootMode) { m_LootMode = lootMode; }
void AddLootMode(uint16 lootMode) { m_LootMode |= lootMode; }
void RemoveLootMode(uint16 lootMode) { m_LootMode &= ~lootMode; }
- void ResetLootMode() { m_LootMode = DEFAULT_LOOT_MODE; }
+ void ResetLootMode() { m_LootMode = LOOT_MODE_DEFAULT; }
void AddToSkillupList(uint32 PlayerGuidLow) { m_SkillupList.push_back(PlayerGuidLow); }
bool IsInSkillupList(uint32 PlayerGuidLow) const
@@ -754,7 +754,7 @@ class TRINITY_DLL_SPEC GameObject : public WorldObject, public GridObject<GameOb
uint64 m_rotation;
- uint16 m_LootMode; // bitmask, default DEFAULT_LOOT_MODE, determines what loot will be lootable
+ uint16 m_LootMode; // bitmask, default LOOT_MODE_DEFAULT, determines what loot will be lootable
private:
void SwitchDoorOrButton(bool activate, bool alternative = false);
};
diff --git a/src/game/LootMgr.cpp b/src/game/LootMgr.cpp
index 502b552fbf8..d7e2cde320d 100644
--- a/src/game/LootMgr.cpp
+++ b/src/game/LootMgr.cpp
@@ -386,7 +386,7 @@ void Loot::AddItem(LootStoreItem const & item)
}
// Calls processor of corresponding LootTemplate (which handles everything including references)
-bool Loot::FillLoot(uint32 loot_id, LootStore const& store, Player* loot_owner, bool personal, bool noEmptyError, uint16 lootMode /*= DEFAULT_LOOT_MODE*/)
+bool Loot::FillLoot(uint32 loot_id, LootStore const& store, Player* loot_owner, bool personal, bool noEmptyError, uint16 lootMode /*= LOOT_MODE_DEFAULT*/)
{
// Must be provided
if (!loot_owner)
diff --git a/src/game/LootMgr.h b/src/game/LootMgr.h
index 41ae0cc4be8..f03d0b9056f 100644
--- a/src/game/LootMgr.h
+++ b/src/game/LootMgr.h
@@ -289,7 +289,7 @@ struct Loot
void RemoveLooter(uint64 GUID) { PlayersLooting.erase(GUID); }
void generateMoneyLoot(uint32 minAmount, uint32 maxAmount);
- bool FillLoot(uint32 loot_id, LootStore const& store, Player* loot_owner, bool personal, bool noEmptyError = false, uint16 lootMode = DEFAULT_LOOT_MODE);
+ bool FillLoot(uint32 loot_id, LootStore const& store, Player* loot_owner, bool personal, bool noEmptyError = false, uint16 lootMode = LOOT_MODE_DEFAULT);
// Inserts the item into the loot (called by LootTemplate processors)
void AddItem(LootStoreItem const & item);
diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h
index 5724261c9b8..23b7cf20f91 100644
--- a/src/game/SharedDefines.h
+++ b/src/game/SharedDefines.h
@@ -24,8 +24,15 @@
#include "Platform/Define.h"
#include <cassert>
-// default loot mode for creatures and gameobjects
-#define DEFAULT_LOOT_MODE 1
+// loot modes for creatures and gameobjects, bitmask!
+enum LootModes
+{
+ LOOT_MODE_DEFAULT = 1,
+ LOOT_MODE_HARD_MODE_1 = 2,
+ LOOT_MODE_HARD_MODE_2 = 4,
+ LOOT_MODE_HARD_MODE_3 = 8,
+ LOOT_MODE_HARD_MODE_4 = 16
+};
enum Gender
{
diff --git a/src/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp b/src/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp
index 13d7502606f..01c13b84f83 100644
--- a/src/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp
+++ b/src/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp
@@ -274,12 +274,12 @@ struct TRINITY_DLL_DECL boss_sartharionAI : public ScriptedAI
// AddDrakeLootMode() should only ever be called from FetchDragons(), which is called from Aggro()
void AddDrakeLootMode()
{
- if (m_creature->HasLootMode(4)) // Has two Drake loot modes
- m_creature->AddLootMode(8); // Add 3rd Drake loot mode
- else if (m_creature->HasLootMode(2)) // Has one Drake loot mode
- m_creature->AddLootMode(4); // Add 2nd Drake loot mode
- else // Has no Drake loot modes
- m_creature->AddLootMode(2); // Add 1st Drake loot mode
+ if (m_creature->HasLootMode(LOOT_MODE_HARD_MODE_2)) // Has two Drake loot modes
+ m_creature->AddLootMode(LOOT_MODE_HARD_MODE_3); // Add 3rd Drake loot mode
+ else if (m_creature->HasLootMode(LOOT_MODE_HARD_MODE_1)) // Has one Drake loot mode
+ m_creature->AddLootMode(LOOT_MODE_HARD_MODE_2); // Add 2nd Drake loot mode
+ else // Has no Drake loot modes
+ m_creature->AddLootMode(LOOT_MODE_HARD_MODE_1); // Add 1st Drake loot mode
}
void FetchDragons()