aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2017-04-06 23:39:34 +0200
committerShauren <shauren.trinity@gmail.com>2017-04-06 23:39:34 +0200
commitd20dedebd6a322e1204fa911b4a2ddc7e2c3e67a (patch)
tree02f823f14e41a8481dc3d46f94bbca4404988e38 /src/server/game/Spells
parent886e9e839b304b7567dd655e4fa3afb2251c96ca (diff)
Core/DataStores: Updated db2 structures to 7.2.0
Diffstat (limited to 'src/server/game/Spells')
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp16
-rw-r--r--src/server/game/Spells/Spell.cpp4
-rw-r--r--src/server/game/Spells/SpellEffects.cpp5
-rw-r--r--src/server/game/Spells/SpellInfo.cpp18
-rw-r--r--src/server/game/Spells/SpellInfo.h4
-rw-r--r--src/server/game/Spells/SpellMgr.cpp2
6 files changed, 30 insertions, 19 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index f77ba5c3596..fe81c87bede 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -2486,7 +2486,21 @@ void AuraEffect::HandleAuraMounted(AuraApplication const* aurApp, uint8 mode, bo
if (MountEntry const* mountEntry = sDB2Manager.GetMount(GetId()))
{
- displayId = mountEntry->DisplayId;
+ if (DB2Manager::MountXDisplayContainer const* mountDisplays = sDB2Manager.GetMountDisplays(mountEntry->ID))
+ {
+ DB2Manager::MountXDisplayContainer usableDisplays;
+ std::copy_if(mountDisplays->begin(), mountDisplays->end(), std::back_inserter(usableDisplays), [target](MountXDisplayEntry const* mountDisplay)
+ {
+ if (Player* playerTarget = target->ToPlayer())
+ if (PlayerConditionEntry const* playerCondition = sPlayerConditionStore.LookupEntry(mountDisplay->PlayerConditionID))
+ return sConditionMgr->IsPlayerMeetingCondition(playerTarget, playerCondition);
+
+ return true;
+ });
+
+ if (!usableDisplays.empty())
+ displayId = Trinity::Containers::SelectRandomContainerElement(usableDisplays)->DisplayID;
+ }
// TODO: CREATE TABLE mount_vehicle (mountId, vehicleCreatureId) for future mounts that are vehicles (new mounts no longer have proper data in MiscValue)
//if (MountVehicle const* mountVehicle = sObjectMgr->GetMountVehicle(mountEntry->Id))
// creatureEntry = mountVehicle->VehicleCreatureId;
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index e3e2814974d..ba00da86235 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -3680,7 +3680,7 @@ void Spell::finish(bool ok)
// Unsummon statue
uint32 spell = m_caster->GetUInt32Value(UNIT_CREATED_BY_SPELL);
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell);
- if (spellInfo && spellInfo->SpellIconID == 2056)
+ if (spellInfo && spellInfo->IconFileDataId == 134230)
{
TC_LOG_DEBUG("spells", "Statue %s is unsummoned in spell %d finish", m_caster->GetGUID().ToString().c_str(), m_spellInfo->Id);
m_caster->setDeathState(JUST_DIED);
@@ -6275,7 +6275,7 @@ SpellCastResult Spell::CheckItems()
switch (effect->Effect)
{
case SPELL_EFFECT_CREATE_ITEM:
- case SPELL_EFFECT_CREATE_ITEM_2:
+ case SPELL_EFFECT_CREATE_LOOT:
{
if (!IsTriggered() && effect->ItemType)
{
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index d596cbffbc2..032a0050ef2 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -1387,6 +1387,7 @@ void Spell::DoCreateItem(uint32 /*i*/, uint32 itemtype, std::vector<int32> const
num_to_add = pProto->GetMaxStackSize();
/* == gem perfection handling == */
+ // this is bad, should be done using spell_loot_template (and conditions)
// the chance of getting a perfect result
float perfectCreateChance = 0.0f;
@@ -4398,8 +4399,8 @@ void Spell::EffectLeapBack(SpellEffIndex /*effIndex*/)
float speedxy = effectInfo->MiscValue / 10.f;
float speedz = damage / 10.f;
- //1891: Disengage
- unitTarget->JumpTo(speedxy, speedz, m_spellInfo->SpellIconID != 1891);
+ // Disengage
+ unitTarget->JumpTo(speedxy, speedz, m_spellInfo->IconFileDataId != 132572);
}
void Spell::EffectQuestClear(SpellEffIndex /*effIndex*/)
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp
index 0b6d46071e4..826cf0fece3 100644
--- a/src/server/game/Spells/SpellInfo.cpp
+++ b/src/server/game/Spells/SpellInfo.cpp
@@ -1024,8 +1024,8 @@ SpellInfo::SpellInfo(SpellInfoLoadHelper const& data, SpellEffectEntryMap const&
Speed = _misc ? _misc->Speed : 0;
SchoolMask = _misc ? _misc->SchoolMask : 0;
AttributesCu = 0;
- SpellIconID = _misc ? _misc->SpellIconID : 0;
- ActiveIconID = _misc ? _misc->ActiveIconID : 0;
+ IconFileDataId = _misc ? _misc->IconFileDataID : 0;
+ ActiveIconFileDataId = _misc ? _misc->ActiveIconFileDataID : 0;
_visuals = std::move(visuals);
// sort all visuals so that the ones without a condition requirement are last on the list
@@ -1224,18 +1224,14 @@ bool SpellInfo::IsExplicitDiscovery() const
SpellEffectInfo const* effect0 = GetEffect(DIFFICULTY_NONE, EFFECT_0);
SpellEffectInfo const* effect1 = GetEffect(DIFFICULTY_NONE, EFFECT_1);
- return ((effect0 && (effect0->Effect == SPELL_EFFECT_CREATE_RANDOM_ITEM || effect0->Effect == SPELL_EFFECT_CREATE_ITEM_2))
+ return ((effect0 && (effect0->Effect == SPELL_EFFECT_CREATE_RANDOM_ITEM || effect0->Effect == SPELL_EFFECT_CREATE_LOOT))
&& effect1 && effect1->Effect == SPELL_EFFECT_SCRIPT_EFFECT)
|| Id == 64323;
}
bool SpellInfo::IsLootCrafting() const
{
- SpellEffectInfo const* effect0 = GetEffect(DIFFICULTY_NONE, EFFECT_0);
- return effect0 && (effect0->Effect == SPELL_EFFECT_CREATE_RANDOM_ITEM ||
- // different random cards from Inscription (121==Virtuoso Inking Set category) r without explicit item
- (effect0->Effect == SPELL_EFFECT_CREATE_ITEM_2 &&
- ((TotemCategory[0] != 0 || (Totem[0] != 0 && SpellIconID == 1)) || effect0->ItemType == 0)));
+ return HasEffect(SPELL_EFFECT_CREATE_RANDOM_ITEM) || HasEffect(SPELL_EFFECT_CREATE_LOOT);
}
bool SpellInfo::IsQuestTame() const
@@ -3016,10 +3012,10 @@ uint32 SpellInfo::GetSpellVisual(Unit const* caster /*= nullptr*/) const
{
if (SpellXSpellVisualEntry const* visual = sSpellXSpellVisualStore.LookupEntry(GetSpellXSpellVisualId(caster)))
{
- //if (visual->SpellVisualID[1] && forPlayer->GetViolenceLevel() operator 2)
- // return visual->SpellVisualID[1];
+ //if (visual->LowViolenceSpellVisualID && forPlayer->GetViolenceLevel() operator 2)
+ // return visual->LowViolenceSpellVisualID;
- return visual->SpellVisualID[0];
+ return visual->SpellVisualID;
}
return 0;
diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h
index f4861bac64f..2a7a95957cb 100644
--- a/src/server/game/Spells/SpellInfo.h
+++ b/src/server/game/Spells/SpellInfo.h
@@ -386,8 +386,8 @@ public:
int32 EquippedItemSubClassMask;
int32 EquippedItemInventoryTypeMask;
uint32 TotemCategory[MAX_SPELL_TOTEMS];
- uint32 SpellIconID;
- uint32 ActiveIconID;
+ uint32 IconFileDataId;
+ uint32 ActiveIconFileDataId;
LocalizedString const* SpellName;
uint32 MaxTargetLevel;
uint32 MaxAffectedTargets;
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 614cd02bcca..5c11bd4bfb9 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -465,7 +465,7 @@ bool SpellMgr::IsSpellValid(SpellInfo const* spellInfo, Player* player, bool msg
// craft spell for crafting non-existed item (break client recipes list show)
case SPELL_EFFECT_CREATE_ITEM:
- case SPELL_EFFECT_CREATE_ITEM_2:
+ case SPELL_EFFECT_CREATE_LOOT:
{
if (effect->ItemType == 0)
{