aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormegamage <none@none>2009-02-27 12:24:09 -0600
committermegamage <none@none>2009-02-27 12:24:09 -0600
commit14a3f5f923103c64fe7eb7ce3a9fcee741dacb5e (patch)
treea98b6aad43b1a2089f0a42b929ec456599ca35d1
parent2d5f3150ab411b2e118f923fc77ee68381c53e90 (diff)
[7344] Ignore drop rate multipliers in loot groups. Author: Velorien
For grouped loot use rates create problems with impossibility loot some items including quest items. --HG-- branch : trunk
-rw-r--r--src/game/LootMgr.cpp18
-rw-r--r--src/shared/revision_nr.h2
2 files changed, 9 insertions, 11 deletions
diff --git a/src/game/LootMgr.cpp b/src/game/LootMgr.cpp
index 95a641862c4..77d8c780e1e 100644
--- a/src/game/LootMgr.cpp
+++ b/src/game/LootMgr.cpp
@@ -58,7 +58,7 @@ class LootTemplate::LootGroup // A set of loot def
bool HasQuestDrop() const; // True if group includes at least 1 quest drop entry
bool HasQuestDropForPlayer(Player const * player) const;
// The same for active quests of the player
- void Process(Loot& loot, bool rate) const; // Rolls an item from the group (if any) and adds the item to the loot
+ void Process(Loot& loot) const; // Rolls an item from the group (if any) and adds the item to the loot
float RawTotalChance() const; // Overall chance for the group (without equal chanced items)
float TotalChance() const; // Overall chance for the group
@@ -69,7 +69,7 @@ class LootTemplate::LootGroup // A set of loot def
LootStoreItemList ExplicitlyChanced; // Entries with chances defined in DB
LootStoreItemList EqualChanced; // Zero chances - every entry takes the same chance
- LootStoreItem const * Roll(bool rate) const; // Rolls an item from the group, returns NULL if all miss their chances
+ LootStoreItem const * Roll() const; // Rolls an item from the group, returns NULL if all miss their chances
};
//Remove all data and free all memory
@@ -792,7 +792,7 @@ void LootTemplate::LootGroup::AddEntry(LootStoreItem& item)
}
// Rolls an item from the group, returns NULL if all miss their chances
-LootStoreItem const * LootTemplate::LootGroup::Roll(bool rate) const
+LootStoreItem const * LootTemplate::LootGroup::Roll() const
{
if (!ExplicitlyChanced.empty()) // First explicitly chanced entries are checked
{
@@ -803,9 +803,7 @@ LootStoreItem const * LootTemplate::LootGroup::Roll(bool rate) const
if(ExplicitlyChanced[i].chance>=100.f)
return &ExplicitlyChanced[i];
- ItemPrototype const *pProto = objmgr.GetItemPrototype(ExplicitlyChanced[i].itemid);
- //float qualityMultiplier = pProto && rate ? sWorld.getRate(qualityToRate[pProto->Quality]) : 1.0f;
- Roll -= ExplicitlyChanced[i].chance;// * qualityMultiplier;
+ Roll -= ExplicitlyChanced[i].chance;
if (Roll < 0)
return &ExplicitlyChanced[i];
}
@@ -841,9 +839,9 @@ bool LootTemplate::LootGroup::HasQuestDropForPlayer(Player const * player) const
}
// Rolls an item from the group (if any takes its chance) and adds the item to the loot
-void LootTemplate::LootGroup::Process(Loot& loot, bool rate) const
+void LootTemplate::LootGroup::Process(Loot& loot) const
{
- LootStoreItem const * item = Roll(rate);
+ LootStoreItem const * item = Roll();
if (item != NULL)
loot.AddItem(*item);
}
@@ -935,7 +933,7 @@ void LootTemplate::Process(Loot& loot, LootStore const& store, bool rate, uint8
if (groupId > Groups.size())
return; // Error message already printed at loading stage
- Groups[groupId-1].Process(loot,rate);
+ Groups[groupId-1].Process(loot);
return;
}
@@ -961,7 +959,7 @@ void LootTemplate::Process(Loot& loot, LootStore const& store, bool rate, uint8
// Now processing groups
for (LootGroups::const_iterator i = Groups.begin( ) ; i != Groups.end( ) ; ++i )
- i->Process(loot,rate);
+ i->Process(loot);
}
// True if template includes at least 1 quest drop entry
diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h
index 69bc7ff5a3d..85c3c3d3bb6 100644
--- a/src/shared/revision_nr.h
+++ b/src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
- #define REVISION_NR "7342"
+ #define REVISION_NR "7344"
#endif // __REVISION_NR_H__