mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
Lots of cmangos commirs applied
This commit is contained in:
parent
8431568536
commit
18dd18780d
44 changed files with 677 additions and 323 deletions
|
|
@ -259,16 +259,19 @@ bool LootStoreItem::Roll(bool rate) const
|
|||
if (mincountOrRef < 0) // reference case
|
||||
return roll_chance_f(chance * (rate ? sWorld.getConfig(CONFIG_FLOAT_RATE_DROP_ITEM_REFERENCED) : 1.0f));
|
||||
|
||||
if (type == LOOT_ITEM_TYPE_ITEM)
|
||||
if (type == LOOTITEM_TYPE_CURRENCY)
|
||||
return roll_chance_f(chance * (rate ? sWorld.getConfig(CONFIG_FLOAT_RATE_DROP_CURRENCY) : 1.0f));
|
||||
else
|
||||
{
|
||||
if (needs_quest)
|
||||
return roll_chance_f(chance * (rate ? sWorld.getConfig(CONFIG_FLOAT_RATE_DROP_ITEM_QUEST) : 1.0f));
|
||||
|
||||
ItemPrototype const* pProto = ObjectMgr::GetItemPrototype(itemid);
|
||||
|
||||
float qualityModifier = pProto && rate ? sWorld.getConfig(qualityToRate[pProto->Quality]) : 1.0f;
|
||||
|
||||
return roll_chance_f(chance * qualityModifier);
|
||||
}
|
||||
else if (type == LOOT_ITEM_TYPE_CURRENCY)
|
||||
return roll_chance_f(chance * (rate ? sWorld.getConfig(CONFIG_FLOAT_RATE_DROP_CURRENCY) : 1.0f));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue