aboutsummaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/game')
-rw-r--r--src/game/AchievementMgr.cpp2
-rw-r--r--src/game/LootMgr.cpp10
-rw-r--r--src/game/SharedDefines.h2
-rw-r--r--src/game/Spell.cpp1
-rw-r--r--src/game/Spell.h2
-rw-r--r--src/game/SpellEffects.cpp35
-rw-r--r--src/game/SpellMgr.cpp3
-rw-r--r--src/game/SpellMgr.h9
8 files changed, 33 insertions, 31 deletions
diff --git a/src/game/AchievementMgr.cpp b/src/game/AchievementMgr.cpp
index 1a546a0d737..c6861735906 100644
--- a/src/game/AchievementMgr.cpp
+++ b/src/game/AchievementMgr.cpp
@@ -220,7 +220,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
if(drunk.state >= MAX_DRUNKEN)
{
sLog.outErrorDb( "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_DRUNK (%u) have unknown drunken state in value1 (%u), ignore.",
- criteria->ID, criteria->requiredType,dataType,drunk.state);
+ criteria->ID, criteria->requiredType,dataType,holiday.id);
return false;
}
return true;
diff --git a/src/game/LootMgr.cpp b/src/game/LootMgr.cpp
index 5654f540da1..adba36fd301 100644
--- a/src/game/LootMgr.cpp
+++ b/src/game/LootMgr.cpp
@@ -1323,10 +1323,12 @@ void LoadLootTemplates_Spell()
if(!ids_set.count(spell_id))
{
- // 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) || (spellInfo->AttributesEx2 & SPELL_ATTR_EX2_UNK14))
- LootTemplates_Spell.ReportNotExistedId(spell_id);
+ // not report about not trainable spells (optionally supported by DB)
+ // ignore 61756 (Northrend Inscription Research (FAST QA VERSION) for example
+ if (!(spellInfo->Attributes & SPELL_ATTR_NOT_SHAPESHIFT) || (spellInfo->Attributes & SPELL_ATTR_UNK5))
+ {
+ LootTemplates_Spell.ReportNotExistedId(spell_id);
+ }
}
else
ids_set.erase(spell_id);
diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h
index e958f911440..e63f96e8875 100644
--- a/src/game/SharedDefines.h
+++ b/src/game/SharedDefines.h
@@ -593,7 +593,7 @@ enum SpellEffects
SPELL_EFFECT_SUMMON_PET = 56,
SPELL_EFFECT_LEARN_PET_SPELL = 57,
SPELL_EFFECT_WEAPON_DAMAGE = 58,
- SPELL_EFFECT_OPEN_LOCK_ITEM = 59,
+ SPELL_EFFECT_CREATE_RANDOM_ITEM = 59,
SPELL_EFFECT_PROFICIENCY = 60,
SPELL_EFFECT_SEND_EVENT = 61,
SPELL_EFFECT_POWER_BURN = 62,
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index c2f17009554..fbd13bb6ea0 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -4630,7 +4630,6 @@ SpellCastResult Spell::CheckCast(bool strict)
break;
}
- case SPELL_EFFECT_OPEN_LOCK_ITEM:
case SPELL_EFFECT_OPEN_LOCK:
{
if( m_spellInfo->EffectImplicitTargetA[i] != TARGET_GAMEOBJECT &&
diff --git a/src/game/Spell.h b/src/game/Spell.h
index 6aa539808df..adb884d8688 100644
--- a/src/game/Spell.h
+++ b/src/game/Spell.h
@@ -263,11 +263,11 @@ class Spell
void EffectQuestComplete(uint32 i);
void EffectCreateItem(uint32 i);
void EffectCreateItem2(uint32 i);
+ void EffectCreateRandomItem(uint32 i);
void EffectPersistentAA(uint32 i);
void EffectEnergize(uint32 i);
void EffectOpenLock(uint32 i);
void EffectSummonChangeItem(uint32 i);
- void EffectOpenSecretSafe(uint32 i);
void EffectProficiency(uint32 i);
void EffectApplyAreaAura(uint32 i);
void EffectSummonType(uint32 i);
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index a53cf65898e..6b453a3a6c9 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -123,7 +123,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
&Spell::EffectSummonPet, // 56 SPELL_EFFECT_SUMMON_PET
&Spell::EffectLearnPetSpell, // 57 SPELL_EFFECT_LEARN_PET_SPELL
&Spell::EffectWeaponDmg, // 58 SPELL_EFFECT_WEAPON_DAMAGE
- &Spell::EffectOpenSecretSafe, // 59 SPELL_EFFECT_OPEN_LOCK_ITEM
+ &Spell::EffectCreateRandomItem, // 59 SPELL_EFFECT_CREATE_RANDOM_ITEM create item base at spell specific loot
&Spell::EffectProficiency, // 60 SPELL_EFFECT_PROFICIENCY
&Spell::EffectSendEvent, // 61 SPELL_EFFECT_SEND_EVENT
&Spell::EffectPowerBurn, // 62 SPELL_EFFECT_POWER_BURN
@@ -221,7 +221,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
&Spell::EffectNULL, //154 unused
&Spell::EffectTitanGrip, //155 SPELL_EFFECT_TITAN_GRIP Allows you to equip two-handed axes, maces and swords in one hand, but you attack $49152s1% slower than normal.
&Spell::EffectEnchantItemPrismatic, //156 SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC
- &Spell::EffectCreateItem2, //157 SPELL_EFFECT_CREATE_ITEM_2 create/learn item/spell for profession
+ &Spell::EffectCreateItem2, //157 SPELL_EFFECT_CREATE_ITEM_2 create item or create item template and replace by some randon spell loot item
&Spell::EffectMilling, //158 SPELL_EFFECT_MILLING milling
&Spell::EffectRenamePet, //159 SPELL_EFFECT_ALLOW_RENAME_PET allow rename pet once again
&Spell::EffectNULL, //160 SPELL_EFFECT_160 unused
@@ -2864,27 +2864,33 @@ void Spell::EffectCreateItem2(uint32 i)
Player* player = (Player*)m_caster;
uint32 item_id = m_spellInfo->EffectItemType[i];
- if(item_id)
- DoCreateItem(i, item_id);
+ DoCreateItem(i, item_id);
// special case: fake item replaced by generate using spell_loot_template
if(IsLootCraftingSpell(m_spellInfo))
{
- if(item_id)
- {
- if(!player->HasItemCount(item_id, 1))
- return;
+ if(!player->HasItemCount(item_id, 1))
+ return;
- // remove reagent
- uint32 count = 1;
- player->DestroyItemCount(item_id, count, true);
- }
+ // remove reagent
+ uint32 count = 1;
+ player->DestroyItemCount(item_id, count, true);
// create some random items
player->AutoStoreLoot(m_spellInfo->Id, LootTemplates_Spell);
}
}
+void Spell::EffectCreateRandomItem(uint32 i)
+{
+ if(m_caster->GetTypeId()!=TYPEID_PLAYER)
+ return;
+ Player* player = (Player*)m_caster;
+
+ // create some random items
+ player->AutoStoreLoot(m_spellInfo->Id, LootTemplates_Spell);
+}
+
void Spell::EffectPersistentAA(uint32 i)
{
float radius = GetSpellRadiusForFriend(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
@@ -3292,11 +3298,6 @@ void Spell::EffectSummonChangeItem(uint32 i)
delete pNewItem;
}
-void Spell::EffectOpenSecretSafe(uint32 i)
-{
- EffectOpenLock(i); //no difference for now
-}
-
void Spell::EffectProficiency(uint32 /*i*/)
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index 8c34e243103..9ff422c124b 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -2155,8 +2155,9 @@ bool SpellMgr::IsSpellValid(SpellEntry const* spellInfo, Player* pl, bool msg)
case 0:
continue;
- // craft spell for crafting non-existed item (break client recipes list show)
+ // craft spell for crafting non-existed item (break client recipes list show)
case SPELL_EFFECT_CREATE_ITEM:
+ case SPELL_EFFECT_CREATE_ITEM_2:
{
if(!ObjectMgr::GetItemPrototype( spellInfo->EffectItemType[i] ))
{
diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h
index b6f2c5d4eca..3616e52e07c 100644
--- a/src/game/SpellMgr.h
+++ b/src/game/SpellMgr.h
@@ -213,15 +213,14 @@ inline bool IsElementalShield(SpellEntry const *spellInfo)
inline bool IsExplicitDiscoverySpell(SpellEntry const *spellInfo)
{
- return spellInfo->Effect[0]==SPELL_EFFECT_CREATE_ITEM_2 && spellInfo->Effect[1]==SPELL_EFFECT_SCRIPT_EFFECT;
+ return spellInfo->Effect[0]==SPELL_EFFECT_CREATE_RANDOM_ITEM && spellInfo->Effect[1]==SPELL_EFFECT_SCRIPT_EFFECT;
}
inline bool IsLootCraftingSpell(SpellEntry const *spellInfo)
{
- return spellInfo->Effect[0]==SPELL_EFFECT_CREATE_ITEM_2 && (
- spellInfo->Effect[1]==SPELL_EFFECT_SCRIPT_EFFECT || // see IsExplicitDiscoverySpell
- !spellInfo->EffectItemType[0] || // result item not provided
- spellInfo->TotemCategory[0] == 121); // different random cards from Inscription (121==Virtuoso Inking Set category)
+ return spellInfo->Effect[0]==SPELL_EFFECT_CREATE_RANDOM_ITEM ||
+ // different random cards from Inscription (121==Virtuoso Inking Set category)
+ spellInfo->Effect[0]==SPELL_EFFECT_CREATE_ITEM_2 && spellInfo->TotemCategory[0] == 121;
}
bool IsHigherHankOfSpell(uint32 spellId_1,uint32 spellId_2);