From 66371f7bed11fb1f94a74238130f09283a48c48c Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Fri, 6 Feb 2009 06:00:01 +0300 Subject: [PATCH] [7234] Now correct patch version: Use spell_loot_table for item creating in case SPELL_EFFECT_CREATE_ITEM_2 (157) and itemType==0 --- src/game/LootMgr.cpp | 4 ++-- src/game/Player.cpp | 9 ++++++--- src/game/Player.h | 4 ++-- src/game/SpellEffects.cpp | 3 +-- src/shared/revision_nr.h | 2 +- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/game/LootMgr.cpp b/src/game/LootMgr.cpp index 0d9b47a9d..deb9a26bd 100644 --- a/src/game/LootMgr.cpp +++ b/src/game/LootMgr.cpp @@ -1278,9 +1278,9 @@ void LoadLootTemplates_Spell() if(!ids_set.count(spell_id)) { - // not report about not trainable spells (optionally supported by DB) + // not report about not trainable spells (optionally supported by DB) except with SPELL_ATTR_EX2_UNK14 (clams) // 61756 (Northrend Inscription Research (FAST QA VERSION) for example - if(spellInfo->Attributes & SPELL_ATTR_UNK5) + if ((spellInfo->Attributes & SPELL_ATTR_UNK5) || (spellInfo->AttributesEx2 & SPELL_ATTR_EX2_UNK14)) LootTemplates_Spell.ReportNotExistedId(spell_id); } else diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 8f37a13f5..e05d48a12 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -19413,7 +19413,7 @@ void Player::InitRunes() SetFloatValue(PLAYER_RUNE_REGEN_1 + i, 0.1f); } -bool Player::AutoStoreLootItem(uint8 bag, uint8 slot, uint32 loot_id, LootStore const& store) +void Player::AutoStoreLootItem(uint8 bag, uint8 slot, uint32 loot_id, LootStore const& store) { Loot loot; loot.FillLoot (loot_id,store,this); @@ -19428,10 +19428,13 @@ bool Player::AutoStoreLootItem(uint8 bag, uint8 slot, uint32 loot_id, LootStore if( msg != EQUIP_ERR_OK && bag != NULL_BAG) msg = CanStoreNewItem( NULL_BAG, NULL_SLOT,dest,lootItem->itemid,lootItem->count); if(msg != EQUIP_ERR_OK) + { + SendEquipError( msg, NULL, NULL ); return; + } - if(Item* pItem = StoreNewItem (dest,lootItem->itemid,true,lootItem->randomPropertyId)) - SendNewItem(pItem, lootItem->count, true, true); + Item* pItem = StoreNewItem (dest,lootItem->itemid,true,lootItem->randomPropertyId); + SendNewItem(pItem, lootItem->count, true, false); } uint32 Player::CalculateTalentsPoints() const diff --git a/src/game/Player.h b/src/game/Player.h index 67b45e0ea..25def0730 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -1110,8 +1110,8 @@ class MANGOS_DLL_SPEC Player : public Unit Item* EquipItem( uint16 pos, Item *pItem, bool update ); void AutoUnequipOffhandIfNeed(); bool StoreNewItemInBestSlots(uint32 item_id, uint32 item_count); - bool AutoStoreLootItem(uint8 bag, uint8 slot, uint32 loot_id, LootStore const& store); - bool AutoStoreLootItem(uint32 loot_id, LootStore const& store) { return AutoStoreLootItem(NULL_BAG,NULL_SLOT,loot_id,store); } + void AutoStoreLootItem(uint8 bag, uint8 slot, uint32 loot_id, LootStore const& store); + void AutoStoreLootItem(uint32 loot_id, LootStore const& store) { AutoStoreLootItem(NULL_BAG,NULL_SLOT,loot_id,store); } uint8 _CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem, uint32* no_space_count = NULL) const; uint8 _CanStoreItem( uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 entry, uint32 count, Item *pItem = NULL, bool swap = false, uint32* no_space_count = NULL ) const; diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 2ba511802..948a88ec6 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -2691,8 +2691,7 @@ void Spell::EffectCreateItem2(uint32 i) return; // create some random items - if(!((Player*)m_caster)->AutoStoreLootItem(m_spellInfo->Id,LootTemplates_Spell)) - player->SendEquipError( msg, NULL, NULL ); + ((Player*)m_caster)->AutoStoreLootItem(m_spellInfo->Id,LootTemplates_Spell); return; } DoCreateItem(i,m_spellInfo->EffectItemType[i]); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index bc5aa1ba1..039ee980c 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 "7233" + #define REVISION_NR "7234" #endif // __REVISION_NR_H__ -- 2.11.4.GIT