Core/Spells: Cast proper vehicle spells on vehicle summon

This commit is contained in:
Shauren
2011-04-24 10:22:58 +02:00
parent 3407d58468
commit aa91187e97
2 changed files with 6 additions and 3 deletions

View File

@@ -2700,6 +2700,8 @@ enum SummonCategory
SUMMON_CATEGORY_PET = 2,
SUMMON_CATEGORY_PUPPET = 3,
SUMMON_CATEGORY_VEHICLE = 4,
SUMMON_CATEGORY_UNK = 5, // as of patch 3.3.5a only Bone Spike in Icecrown Citadel
// uses this category
};
enum SummonType

View File

@@ -3006,6 +3006,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
{
case SUMMON_CATEGORY_WILD:
case SUMMON_CATEGORY_ALLY:
case SUMMON_CATEGORY_UNK:
if (properties->Flags & 512)
{
SummonGuardian(effIndex, entry, properties);
@@ -3113,7 +3114,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
case SUMMON_CATEGORY_PUPPET:
summon = m_caster->GetMap()->SummonCreature(entry, pos, properties, duration, m_originalCaster);
break;
case SUMMON_CATEGORY_VEHICLE:
case SUMMON_CATEGORY_VEHICLE:
// Summoning spells (usually triggered by npc_spellclick) that spawn a vehicle and that cause the clicker
// to cast a ride vehicle spell on the summoned unit.
float x, y, z;
@@ -3123,10 +3124,10 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
return;
// The spell that this effect will trigger. It has SPELL_AURA_CONTROL_VEHICLE
uint32 spell = m_spellInfo->EffectBasePoints[effIndex];
uint32 spell = SpellMgr::CalculateSpellEffectAmount(m_spellInfo, effIndex);
if (spell)
{
SpellEntry const *spellProto = sSpellStore.LookupEntry(SpellMgr::CalculateSpellEffectAmount(m_spellInfo, effIndex));
SpellEntry const *spellProto = sSpellStore.LookupEntry(spell);
if (!spellProto)
spell = VEHICLE_SPELL_RIDE_HARDCODED;
}