* Add support for RewSpellCast=-1. If -1 remove all auras applied to player at
* quest start. * Patch by Kudlaty -- THANK YOU! --HG-- branch : trunk
This commit is contained in:
@@ -673,7 +673,7 @@ bool AuctionEntry::BuildAuctionInfo(WorldPacket & data) const
|
||||
data << uint32(pItem->GetEnchantmentCharges(EnchantmentSlot(i)));
|
||||
}
|
||||
|
||||
data << uint32(pItem->GetItemRandomPropertyId()); //random item property id
|
||||
data << int32(pItem->GetItemRandomPropertyId()); //random item property id
|
||||
data << uint32(pItem->GetItemSuffixFactor()); //SuffixFactor
|
||||
data << uint32(pItem->GetCount()); //item->count
|
||||
data << uint32(pItem->GetSpellCharges()); //item->charge FFFFFFF
|
||||
|
||||
@@ -2238,7 +2238,7 @@ uint32 Creature::UpdateVendorItemCurrentCount(VendorItem const* vItem, uint32 us
|
||||
|
||||
if(itr == m_vendorItemCounts.end())
|
||||
{
|
||||
uint32 new_count = vItem->maxcount > used_count ? vItem->maxcount-used_count : 0;
|
||||
int32 new_count = vItem->maxcount > used_count ? vItem->maxcount-used_count : 0;
|
||||
m_vendorItemCounts.push_back(VendorItemCount(vItem->item,new_count));
|
||||
return new_count;
|
||||
}
|
||||
|
||||
+3
-3
@@ -309,11 +309,11 @@ enum AttackingTarget
|
||||
// Vendors
|
||||
struct VendorItem
|
||||
{
|
||||
VendorItem(uint32 _item, uint32 _maxcount, uint32 _incrtime, uint32 _ExtendedCost)
|
||||
VendorItem(uint32 _item, int32 _maxcount, uint32 _incrtime, uint32 _ExtendedCost)
|
||||
: item(_item), maxcount(_maxcount), incrtime(_incrtime), ExtendedCost(_ExtendedCost) {}
|
||||
|
||||
uint32 item;
|
||||
uint32 maxcount; // 0 for infinity item amount
|
||||
int32 maxcount; // 0 for infinity item amount
|
||||
uint32 incrtime; // time for restore items amount if maxcount != 0
|
||||
uint32 ExtendedCost;
|
||||
};
|
||||
@@ -330,7 +330,7 @@ struct VendorItemData
|
||||
}
|
||||
bool Empty() const { return m_items.empty(); }
|
||||
uint8 GetItemCount() const { return m_items.size(); }
|
||||
void AddItem( uint32 item, uint32 maxcount, uint32 ptime, uint32 ExtendedCost)
|
||||
void AddItem( uint32 item, int32 maxcount, uint32 ptime, uint32 ExtendedCost)
|
||||
{
|
||||
m_items.push_back(new VendorItem(item, maxcount, ptime, ExtendedCost));
|
||||
}
|
||||
|
||||
@@ -832,7 +832,7 @@ void GameEventMgr::LoadFromDB()
|
||||
NPCVendorEntry newEntry;
|
||||
uint32 guid = fields[1].GetUInt32();
|
||||
newEntry.item = fields[2].GetUInt32();
|
||||
newEntry.maxcount = fields[3].GetUInt32();
|
||||
newEntry.maxcount = fields[3].GetInt32();
|
||||
newEntry.incrtime = fields[4].GetUInt32();
|
||||
newEntry.ExtendedCost = fields[5].GetUInt32();
|
||||
// get the event npc flag for checking if the npc will be vendor during the event or not
|
||||
|
||||
@@ -82,7 +82,7 @@ struct NPCVendorEntry
|
||||
{
|
||||
uint32 entry; // creature entry
|
||||
uint32 item; // item id
|
||||
uint32 maxcount; // 0 for infinite
|
||||
int32 maxcount; // 0 for infinite
|
||||
uint32 incrtime; // time for restore items amount if maxcount != 0
|
||||
uint32 ExtendedCost;
|
||||
};
|
||||
|
||||
@@ -511,7 +511,7 @@ void PlayerMenu::SendQuestGiverQuestDetails( Quest const *pQuest, uint64 npcGUID
|
||||
// rewarded honor points. Multiply with 10 to satisfy client
|
||||
data << uint32(10*Trinity::Honor::hk_honor_at_level(pSession->GetPlayer()->getLevel(), pQuest->GetRewHonorableKills()));
|
||||
data << uint32(pQuest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast==0)
|
||||
data << uint32(pQuest->GetRewSpellCast()); // casted spell
|
||||
data << int32(pQuest->GetRewSpellCast()); // casted spell
|
||||
data << uint32(pQuest->GetCharTitleId()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles)
|
||||
data << uint32(pQuest->GetBonusTalents()); // bonus talents
|
||||
|
||||
@@ -583,7 +583,7 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest )
|
||||
|
||||
data << uint32(pQuest->GetRewMoneyMaxLevel()); // used in XP calculation at client
|
||||
data << uint32(pQuest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast==0)
|
||||
data << uint32(pQuest->GetRewSpellCast()); // casted spell
|
||||
data << int32(pQuest->GetRewSpellCast()); // casted spell
|
||||
|
||||
// rewarded honor points
|
||||
data << uint32(Trinity::Honor::hk_honor_at_level(pSession->GetPlayer()->getLevel(), pQuest->GetRewHonorableKills()));
|
||||
@@ -732,7 +732,7 @@ void PlayerMenu::SendQuestGiverOfferReward( Quest const* pQuest, uint64 npcGUID,
|
||||
data << uint32(10*Trinity::Honor::hk_honor_at_level(pSession->GetPlayer()->getLevel(), pQuest->GetRewHonorableKills()));
|
||||
data << uint32(0x08); // unused by client?
|
||||
data << uint32(pQuest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast==0)
|
||||
data << uint32(pQuest->GetRewSpellCast()); // casted spell
|
||||
data << int32(pQuest->GetRewSpellCast()); // casted spell
|
||||
data << uint32(0); // unknown
|
||||
data << uint32(pQuest->GetBonusTalents()); // bonus talents
|
||||
pSession->SendPacket( &data );
|
||||
|
||||
+1
-1
@@ -1695,7 +1695,7 @@ void Guild::AppendDisplayGuildBankSlot( WorldPacket& data, GuildBankTab const *t
|
||||
data << uint32(entry);
|
||||
if (entry)
|
||||
{
|
||||
data << (uint32) pItem->GetItemRandomPropertyId(); // random item property id +8
|
||||
data << (int32) pItem->GetItemRandomPropertyId(); // random item property id +8
|
||||
if (pItem->GetItemRandomPropertyId())
|
||||
data << (uint32) pItem->GetItemSuffixFactor(); // SuffixFactor +4
|
||||
|
||||
|
||||
+1
-1
@@ -552,7 +552,7 @@ int32 Item::GenerateItemRandomPropertyId(uint32 item_id)
|
||||
// RandomProperty case
|
||||
if(itemProto->RandomProperty)
|
||||
{
|
||||
uint32 randomPropId = GetItemEnchantMod(itemProto->RandomProperty);
|
||||
int32 randomPropId = GetItemEnchantMod(itemProto->RandomProperty);
|
||||
ItemRandomPropertiesEntry const *random_id = sItemRandomPropertiesStore.LookupEntry(randomPropId);
|
||||
if(!random_id)
|
||||
{
|
||||
|
||||
@@ -750,12 +750,12 @@ void WorldSession::SendListInventory( uint64 vendorguid )
|
||||
++count;
|
||||
|
||||
// reputation discount
|
||||
uint32 price = uint32(floor(pProto->BuyPrice * discountMod));
|
||||
int32 price = uint32(floor(pProto->BuyPrice * discountMod));
|
||||
|
||||
data << uint32(count);
|
||||
data << uint32(crItem->item);
|
||||
data << uint32(pProto->DisplayInfoID);
|
||||
data << uint32(crItem->maxcount <= 0 ? 0xFFFFFFFF : pCreature->GetVendorItemCurrentCount(crItem));
|
||||
data << int32(crItem->maxcount <= 0 ? 0xFFFFFFFF : pCreature->GetVendorItemCurrentCount(crItem));
|
||||
data << uint32(price);
|
||||
data << uint32(pProto->MaxDurability);
|
||||
data << uint32(pProto->BuyCount);
|
||||
|
||||
@@ -523,10 +523,10 @@ struct ItemPrototype
|
||||
char* Name1;
|
||||
uint32 DisplayInfoID; // id from ItemDisplayInfo.dbc
|
||||
uint32 Quality;
|
||||
uint32 Flags;
|
||||
int32 Flags;
|
||||
uint32 Faction;
|
||||
uint32 BuyCount;
|
||||
uint32 BuyPrice;
|
||||
int32 BuyPrice;
|
||||
uint32 SellPrice;
|
||||
uint32 InventoryType;
|
||||
uint32 AllowableClass;
|
||||
@@ -568,7 +568,7 @@ struct ItemPrototype
|
||||
uint32 LockID;
|
||||
int32 Material; // id from Material.dbc
|
||||
uint32 Sheath;
|
||||
uint32 RandomProperty; // id from ItemRandomProperties.dbc
|
||||
int32 RandomProperty; // id from ItemRandomProperties.dbc
|
||||
uint32 RandomSuffix; // id from ItemRandomSuffix.dbc
|
||||
uint32 Block;
|
||||
uint32 ItemSet; // id from ItemSet.dbc
|
||||
|
||||
@@ -117,7 +117,7 @@ void LootStore::LoadLootTable()
|
||||
uint16 lootmode = fields[3].GetUInt16();
|
||||
uint8 group = fields[4].GetUInt8();
|
||||
int32 mincountOrRef = fields[5].GetInt32();
|
||||
uint32 maxcount = fields[6].GetUInt32();
|
||||
int32 maxcount = fields[6].GetInt32();
|
||||
ConditionType condition = (ConditionType)fields[7].GetUInt8();
|
||||
uint32 cond_value1 = fields[8].GetUInt32();
|
||||
uint32 cond_value2 = fields[9].GetUInt32();
|
||||
@@ -293,7 +293,7 @@ bool LootStoreItem::IsValid(LootStore const& store, uint32 entry) const
|
||||
|
||||
if( maxcount < mincountOrRef) // wrong max count
|
||||
{
|
||||
sLog.outErrorDb("Table '%s' entry %d item %d: max count (%u) less that min count (%i) - skipped", store.GetName(), entry, itemid, uint32(maxcount), mincountOrRef);
|
||||
sLog.outErrorDb("Table '%s' entry %d item %d: max count (%u) less that min count (%i) - skipped", store.GetName(), entry, itemid, int32(maxcount), mincountOrRef);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -612,7 +612,7 @@ void WorldSession::HandleGetMailList(WorldPacket & recv_data )
|
||||
data << uint32((item ? item->GetEnchantmentId((EnchantmentSlot)j) : 0));
|
||||
}
|
||||
// can be negative
|
||||
data << uint32((item ? item->GetItemRandomPropertyId() : 0));
|
||||
data << int32((item ? item->GetItemRandomPropertyId() : 0));
|
||||
// unk
|
||||
data << uint32((item ? item->GetItemSuffixFactor() : 0));
|
||||
// stack count
|
||||
|
||||
@@ -8238,7 +8238,7 @@ void ObjectMgr::LoadVendors()
|
||||
|
||||
uint32 entry = fields[0].GetUInt32();
|
||||
uint32 item_id = fields[1].GetUInt32();
|
||||
uint32 maxcount = fields[2].GetUInt32();
|
||||
int32 maxcount = fields[2].GetInt32();
|
||||
uint32 incrtime = fields[3].GetUInt32();
|
||||
uint32 ExtendedCost = fields[4].GetUInt32();
|
||||
|
||||
@@ -8515,7 +8515,7 @@ void ObjectMgr::LoadGossipMenuItems()
|
||||
sLog.outString(">> Loaded %u gossip_menu_option entries", count);
|
||||
}
|
||||
|
||||
void ObjectMgr::AddVendorItem( uint32 entry,uint32 item, uint32 maxcount, uint32 incrtime, uint32 extendedcost, bool savetodb)
|
||||
void ObjectMgr::AddVendorItem( uint32 entry,uint32 item, int32 maxcount, uint32 incrtime, uint32 extendedcost, bool savetodb)
|
||||
{
|
||||
VendorItemData& vList = m_mCacheVendorItemMap[entry];
|
||||
vList.AddItem(item,maxcount,incrtime,extendedcost);
|
||||
@@ -8537,7 +8537,7 @@ bool ObjectMgr::RemoveVendorItem( uint32 entry,uint32 item, bool savetodb)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ObjectMgr::IsVendorItemValid( uint32 vendor_entry, uint32 item_id, uint32 maxcount, uint32 incrtime, uint32 ExtendedCost, Player* pl, std::set<uint32>* skip_vendors, uint32 ORnpcflag ) const
|
||||
bool ObjectMgr::IsVendorItemValid( uint32 vendor_entry, uint32 item_id, int32 maxcount, uint32 incrtime, uint32 ExtendedCost, Player* pl, std::set<uint32>* skip_vendors, uint32 ORnpcflag ) const
|
||||
{
|
||||
CreatureInfo const* cInfo = GetCreatureTemplate(vendor_entry);
|
||||
if(!cInfo)
|
||||
|
||||
@@ -870,9 +870,9 @@ class ObjectMgr
|
||||
|
||||
return &iter->second;
|
||||
}
|
||||
void AddVendorItem(uint32 entry,uint32 item, uint32 maxcount, uint32 incrtime, uint32 ExtendedCost, bool savetodb = true); // for event
|
||||
void AddVendorItem(uint32 entry,uint32 item, int32 maxcount, uint32 incrtime, uint32 ExtendedCost, bool savetodb = true); // for event
|
||||
bool RemoveVendorItem(uint32 entry,uint32 item, bool savetodb = true); // for event
|
||||
bool IsVendorItemValid( uint32 vendor_entry, uint32 item, uint32 maxcount, uint32 ptime, uint32 ExtendedCost, Player* pl = NULL, std::set<uint32>* skip_vendors = NULL, uint32 ORnpcflag = 0 ) const;
|
||||
bool IsVendorItemValid( uint32 vendor_entry, uint32 item, int32 maxcount, uint32 ptime, uint32 ExtendedCost, Player* pl = NULL, std::set<uint32>* skip_vendors = NULL, uint32 ORnpcflag = 0 ) const;
|
||||
|
||||
void LoadScriptNames();
|
||||
ScriptNameMap &GetScriptNames() { return m_scriptNames; }
|
||||
|
||||
+13
-5
@@ -12719,7 +12719,7 @@ void Player::SendNewItem(Item *item, uint32 count, bool received, bool created,
|
||||
data << uint32((item->GetCount() == count) ? item->GetSlot() : -1);
|
||||
data << uint32(item->GetEntry()); // item id
|
||||
data << uint32(item->GetItemSuffixFactor()); // SuffixFactor
|
||||
data << uint32(item->GetItemRandomPropertyId()); // random item property id
|
||||
data << int32(item->GetItemRandomPropertyId()); // random item property id
|
||||
data << uint32(count); // count of items
|
||||
data << uint32(GetItemCount(item->GetEntry())); // count of items in inventory
|
||||
|
||||
@@ -18847,7 +18847,7 @@ bool Player::BuyItemFromVendor(uint64 vendorguid, uint32 item, uint8 count, uint
|
||||
}
|
||||
}
|
||||
|
||||
uint32 price = pProto->BuyPrice * count;
|
||||
int32 price = pProto->BuyPrice * count;
|
||||
|
||||
// reputation discount
|
||||
price = uint32(floor(price * GetReputationPriceDiscount(pCreature)));
|
||||
@@ -18905,7 +18905,7 @@ bool Player::BuyItemFromVendor(uint64 vendorguid, uint32 item, uint8 count, uint
|
||||
WorldPacket data(SMSG_BUY_ITEM, (8+4+4+4));
|
||||
data << uint64(pCreature->GetGUID());
|
||||
data << uint32(vendor_slot+1); // numbered from 1 at client
|
||||
data << uint32(crItem->maxcount > 0 ? new_count : 0xFFFFFFFF);
|
||||
data << int32(crItem->maxcount > 0 ? new_count : 0xFFFFFFFF);
|
||||
data << uint32(count);
|
||||
GetSession()->SendPacket(&data);
|
||||
SendNewItem(it, pProto->BuyCount*count, true, false, false);
|
||||
@@ -18959,7 +18959,7 @@ bool Player::BuyItemFromVendor(uint64 vendorguid, uint32 item, uint8 count, uint
|
||||
WorldPacket data(SMSG_BUY_ITEM, (8+4+4+4));
|
||||
data << uint64(pCreature->GetGUID());
|
||||
data << uint32(vendor_slot + 1); // numbered from 1 at client
|
||||
data << uint32(crItem->maxcount > 0 ? new_count : 0xFFFFFFFF);
|
||||
data << int32(crItem->maxcount > 0 ? new_count : 0xFFFFFFFF);
|
||||
data << uint32(count);
|
||||
GetSession()->SendPacket(&data);
|
||||
|
||||
@@ -20197,12 +20197,20 @@ void Player::learnDefaultSpells()
|
||||
|
||||
void Player::learnQuestRewardedSpells(Quest const* quest)
|
||||
{
|
||||
uint32 spell_id = quest->GetRewSpellCast();
|
||||
int32 spell_id = quest->GetRewSpellCast();
|
||||
uint32 src_spell_id = quest->GetSrcSpell();
|
||||
|
||||
// skip quests without rewarded spell
|
||||
if( !spell_id )
|
||||
return;
|
||||
|
||||
// if RewSpellCast = -1 we remove aura do to SrcSpell from player.
|
||||
if (spell_id == -1 && src_spell_id)
|
||||
{
|
||||
this->RemoveAurasDueToSpell(src_spell_id);
|
||||
return;
|
||||
}
|
||||
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spell_id);
|
||||
if(!spellInfo)
|
||||
return;
|
||||
|
||||
@@ -108,7 +108,7 @@ Quest::Quest(Field * questRecord)
|
||||
RewOrReqMoney = questRecord[104].GetInt32();
|
||||
RewMoneyMaxLevel = questRecord[105].GetUInt32();
|
||||
RewSpell = questRecord[106].GetUInt32();
|
||||
RewSpellCast = questRecord[107].GetUInt32();
|
||||
RewSpellCast = questRecord[107].GetInt32();
|
||||
RewMailTemplateId = questRecord[108].GetUInt32();
|
||||
RewMailDelaySecs = questRecord[109].GetUInt32();
|
||||
PointMapId = questRecord[110].GetUInt32();
|
||||
|
||||
+2
-2
@@ -216,7 +216,7 @@ class Quest
|
||||
uint32 GetRewMoneyMaxLevel() const { return RewMoneyMaxLevel; }
|
||||
// use in XP calculation at client
|
||||
uint32 GetRewSpell() const { return RewSpell; }
|
||||
uint32 GetRewSpellCast() const { return RewSpellCast; }
|
||||
int32 GetRewSpellCast() const { return RewSpellCast; }
|
||||
uint32 GetRewMailTemplateId() const { return RewMailTemplateId; }
|
||||
uint32 GetRewMailDelaySecs() const { return RewMailDelaySecs; }
|
||||
uint32 GetPointMapId() const { return PointMapId; }
|
||||
@@ -311,7 +311,7 @@ class Quest
|
||||
int32 RewOrReqMoney;
|
||||
uint32 RewMoneyMaxLevel;
|
||||
uint32 RewSpell;
|
||||
uint32 RewSpellCast;
|
||||
int32 RewSpellCast;
|
||||
uint32 RewMailTemplateId;
|
||||
uint32 RewMailDelaySecs;
|
||||
uint32 PointMapId;
|
||||
|
||||
@@ -158,7 +158,7 @@ void WorldSession::SendUpdateTrade()
|
||||
data << (uint32) item->GetSpellCharges(); // charges
|
||||
data << (uint32) item->GetItemSuffixFactor(); // SuffixFactor
|
||||
// random properties id
|
||||
data << (uint32) item->GetItemRandomPropertyId();
|
||||
data << (int32) item->GetItemRandomPropertyId();
|
||||
data << (uint32) item->GetProto()->LockID; // lock id
|
||||
// max durability
|
||||
data << (uint32) item->GetUInt32Value(ITEM_FIELD_MAXDURABILITY);
|
||||
|
||||
Reference in New Issue
Block a user