aboutsummaryrefslogtreecommitdiff
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
parent6ec338eb9aa96b2ef85a7800d5fefe426341082a (diff)
Core/Spells: Fixed ErrorCube spell missiles
-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
-rw-r--r--src/server/shared/DataStores/DBCStructure.h32
-rw-r--r--src/server/shared/DataStores/DBCfmt.h1
6 files changed, 55 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
diff --git a/src/server/shared/DataStores/DBCStructure.h b/src/server/shared/DataStores/DBCStructure.h
index cf43e5bc01f..c110b71838f 100644
--- a/src/server/shared/DataStores/DBCStructure.h
+++ b/src/server/shared/DataStores/DBCStructure.h
@@ -1555,6 +1555,38 @@ struct SpellItemEnchantmentConditionEntry
//uint8 Logic[5] // 25-30 m_logic[5]
};
+struct SpellVisualEntry
+{
+ //uint32 Id;
+ //uint32 PrecastKit;
+ //uint32 CastingKit;
+ //uint32 ImpactKit;
+ //uint32 StateKit;
+ //uint32 StateDoneKit;
+ //uint32 ChannelKit;
+ uint32 HasMissile;
+ int32 MissileModel;
+ //uint32 MissilePathType;
+ //uint32 MissileDestinationAttachment;
+ //uint32 MissileSound;
+ //uint32 AnimEventSoundID;
+ //uint32 Flags;
+ //uint32 CasterImpactKit;
+ //uint32 TargetImpactKit;
+ //int32 MissileAttachment;
+ //uint32 MissileFollowGroundHeight;
+ //uint32 MissileFollowGroundDropSpeed;
+ //uint32 MissileFollowGroundApprach;
+ //uint32 MissileFollowGroundFlags;
+ //uint32 MissileMotionId;
+ //uint32 MissileTargetingKit;
+ //uint32 InstantAreaKit;
+ //uint32 ImpactAreaKit;
+ //uint32 PersistentAreaKit;
+ //DBCPosition3D MissileCastOffset;
+ //DBCPosition3D MissileImpactOffset;
+};
+
struct StableSlotPricesEntry
{
uint32 Slot;
diff --git a/src/server/shared/DataStores/DBCfmt.h b/src/server/shared/DataStores/DBCfmt.h
index d72524ba87b..945ef9e037f 100644
--- a/src/server/shared/DataStores/DBCfmt.h
+++ b/src/server/shared/DataStores/DBCfmt.h
@@ -123,6 +123,7 @@ char constexpr SpellRadiusfmt[] = "nfff";
char constexpr SpellRangefmt[] = "nffffixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
char constexpr SpellRuneCostfmt[] = "niiii";
char constexpr SpellShapeshiftfmt[] = "nxxxxxxxxxxxxxxxxxxiixiiixxiiiiiiii";
+char constexpr SpellVisualfmt[] = "dxxxxxxiixxxxxxxxxxxxxxxxxxxxxxx";
char constexpr StableSlotPricesfmt[] = "ni";
char constexpr SummonPropertiesfmt[] = "niiiii";
char constexpr TalentEntryfmt[] = "niiiiiiiixxxxixxixxxxxx";