mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-20 09:11:30 +00:00
Fix for avg_coin
This commit is contained in:
parent
ef082b9144
commit
725c5633f6
@ -47,8 +47,10 @@ void ZoneDatabase::AddLootTableToNPC(NPC* npc,uint32 loottable_id, ItemList* ite
|
|||||||
|
|
||||||
uint32 cash = 0;
|
uint32 cash = 0;
|
||||||
if(max_cash > 0 && EQEmu::ValueWithin(lts->avgcoin, min_cash, max_cash)) {
|
if(max_cash > 0 && EQEmu::ValueWithin(lts->avgcoin, min_cash, max_cash)) {
|
||||||
int avg_cash_roll = MakeRandomInt(1, 100);
|
float upper_chance = (float)(lts->avgcoin - min_cash) / (float)(max_cash - min_cash);
|
||||||
if(avg_cash_roll > 50) {
|
float avg_cash_roll = (float)MakeRandomFloat(0.0, 1.0);
|
||||||
|
|
||||||
|
if(avg_cash_roll <= upper_chance) {
|
||||||
cash = MakeRandomInt(lts->avgcoin, max_cash);
|
cash = MakeRandomInt(lts->avgcoin, max_cash);
|
||||||
} else {
|
} else {
|
||||||
cash = MakeRandomInt(min_cash, lts->avgcoin);
|
cash = MakeRandomInt(min_cash, lts->avgcoin);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user