aboutsummaryrefslogtreecommitdiff
path: root/src/server/game
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2018-12-31 21:35:55 +0100
committerShauren <shauren.trinity@gmail.com>2018-12-31 21:41:25 +0100
commit3b5014fdae1b57add7fd204a9f9f10f3c2092b83 (patch)
tree9701a11c976afb47e0db62d8e0657d54840da1c3 /src/server/game
parent6ec338eb9aa96b2ef85a7800d5fefe426341082a (diff)
Core/Spells: Fixed ErrorCube spell missiles
Diffstat (limited to 'src/server/game')
-rw-r--r--src/server/game/DataStores/DBCStores.cpp2
-rw-r--r--src/server/game/DataStores/DBCStores.h1
-rw-r--r--src/server/game/Spells/Spell.cpp12
-rw-r--r--src/server/game/Spells/SpellMgr.cpp7
4 files changed, 22 insertions, 0 deletions
diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp
index 018e7ffd784..6916737fce2 100644
--- a/src/server/game/DataStores/DBCStores.cpp
+++ b/src/server/game/DataStores/DBCStores.cpp
@@ -173,6 +173,7 @@ DBCStorage <SpellRadiusEntry> sSpellRadiusStore(SpellRadiusfmt);
DBCStorage <SpellRangeEntry> sSpellRangeStore(SpellRangefmt);
DBCStorage <SpellRuneCostEntry> sSpellRuneCostStore(SpellRuneCostfmt);
DBCStorage <SpellShapeshiftEntry> sSpellShapeshiftStore(SpellShapeshiftfmt);
+DBCStorage <SpellVisualEntry> sSpellVisualStore(SpellVisualfmt);
DBCStorage <StableSlotPricesEntry> sStableSlotPricesStore(StableSlotPricesfmt);
DBCStorage <SummonPropertiesEntry> sSummonPropertiesStore(SummonPropertiesfmt);
DBCStorage <TalentEntry> sTalentStore(TalentEntryfmt);
@@ -371,6 +372,7 @@ void LoadDBCStores(const std::string& dataPath)
LOAD_DBC(sSpellRangeStore, "SpellRange.dbc");
LOAD_DBC(sSpellRuneCostStore, "SpellRuneCost.dbc");
LOAD_DBC(sSpellShapeshiftStore, "SpellShapeshiftForm.dbc");
+ LOAD_DBC(sSpellVisualStore, "SpellVisual.dbc");
LOAD_DBC(sStableSlotPricesStore, "StableSlotPrices.dbc");
LOAD_DBC(sSummonPropertiesStore, "SummonProperties.dbc");
LOAD_DBC(sTalentStore, "Talent.dbc");
diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h
index 8bcc9c5ac24..51af3ab39af 100644
--- a/src/server/game/DataStores/DBCStores.h
+++ b/src/server/game/DataStores/DBCStores.h
@@ -182,6 +182,7 @@ TC_GAME_API extern DBCStorage <SpellRangeEntry> sSpellRangeStore;
TC_GAME_API extern DBCStorage <SpellRuneCostEntry> sSpellRuneCostStore;
TC_GAME_API extern DBCStorage <SpellShapeshiftEntry> sSpellShapeshiftStore;
TC_GAME_API extern DBCStorage <SpellEntry> sSpellStore;
+TC_GAME_API extern DBCStorage <SpellVisualEntry> sSpellVisualStore;
TC_GAME_API extern DBCStorage <StableSlotPricesEntry> sStableSlotPricesStore;
TC_GAME_API extern DBCStorage <SummonPropertiesEntry> sSummonPropertiesStore;
TC_GAME_API extern DBCStorage <TalentEntry> sTalentStore;
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 6150dbb4228..c49e340250b 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -4291,6 +4291,8 @@ void Spell::UpdateSpellCastDataAmmo(WorldPackets::Spells::SpellAmmo& ammo)
}
else if (m_caster->GetTypeId() == TYPEID_UNIT)
{
+ uint32 nonRangedAmmoDisplayID = 0;
+ uint32 nonRangedAmmoInventoryType = 0;
for (uint8 i = BASE_ATTACK; i < MAX_ATTACK; ++i)
{
if (uint32 item_id = m_caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + i))
@@ -4314,6 +4316,10 @@ void Spell::UpdateSpellCastDataAmmo(WorldPackets::Spells::SpellAmmo& ammo)
ammoDisplayID = 5998; // is this need fixing?
ammoInventoryType = INVTYPE_AMMO;
break;
+ default:
+ nonRangedAmmoDisplayID = itemEntry->DisplayId;
+ nonRangedAmmoInventoryType = itemEntry->InventoryType;
+ break;
}
if (ammoDisplayID)
@@ -4322,6 +4328,12 @@ void Spell::UpdateSpellCastDataAmmo(WorldPackets::Spells::SpellAmmo& ammo)
}
}
}
+
+ if (!ammoDisplayID && !ammoInventoryType)
+ {
+ ammoDisplayID = nonRangedAmmoDisplayID;
+ ammoInventoryType = nonRangedAmmoInventoryType;
+ }
}
ammo.DisplayID = ammoDisplayID;
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 9fe210e493b..edc6f1b4be3 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -2876,6 +2876,13 @@ void SpellMgr::LoadSpellInfoCustomAttributes()
}
spellInfo->_InitializeExplicitTargetMask();
+
+ if (spellInfo->Speed > 0.0f)
+ if (SpellVisualEntry const* spellVisual = sSpellVisualStore.LookupEntry(spellInfo->SpellVisual[0]))
+ if (spellVisual->HasMissile)
+ if (spellVisual->MissileModel == -4 || spellVisual->MissileModel == -5)
+ spellInfo->AttributesCu |= SPELL_ATTR0_CU_NEEDS_AMMO_DATA;
+
}
// addition for binary spells, omit spells triggering other spells