Adds new column to 'merchantlist' table.

Adds 'probability' after 'classes_required', valid values are 0 to 100.
This commit is contained in:
Kinglykrab
2014-08-20 23:41:47 -04:00
parent 5946af88a6
commit 8b19c76e89
10 changed files with 80 additions and 7 deletions
+5 -4
View File
@@ -983,17 +983,18 @@ void Client::BulkSendMerchantInventory(int merchant_id, int npcid) {
uint8 handychance = 0;
for (itr = merlist.begin(); itr != merlist.end() && i < numItemSlots; ++itr) {
MerchantList ml = *itr;
if(GetLevel() < ml.level_required) {
if (merch->CastToNPC()->GetMerchantProbability() > ml.probability)
continue;
if(GetLevel() < ml.level_required)
continue;
}
if (!(ml.classes_required & (1 << (GetClass() - 1))))
continue;
int32 fac = merch ? merch->GetPrimaryFaction() : 0;
if(fac != 0 && GetModCharacterFactionLevel(fac) < ml.faction_required) {
if(fac != 0 && GetModCharacterFactionLevel(fac) < ml.faction_required)
continue;
}
handychance = MakeRandomInt(0, merlist.size() + tmp_merlist.size() - 1 );