Core/Vehicles: Correct usage of npc_spellclick_spells instead of blatant hacks for vehicle entry.

Note: This may break a few vehicles, but only due to the absence of proper, non-hackish data.
This commit is contained in:
Machiavelli
2011-02-26 23:00:09 +01:00
parent 8497fb27e9
commit 3ac80ee3a4
9 changed files with 179 additions and 58 deletions
+14 -3
View File
@@ -3129,7 +3129,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
{
float x, y, z;
m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE);
summon = m_caster->GetMap()->SummonCreature(entry, pos, properties, duration, m_caster);
summon = m_originalCaster->GetMap()->SummonCreature(entry, pos, properties, duration, m_caster);
if (!summon || !summon->IsVehicle())
return;
@@ -3137,10 +3137,21 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
{
SpellEntry const *spellProto = sSpellStore.LookupEntry(SpellMgr::CalculateSpellEffectAmount(m_spellInfo, effIndex));
if (spellProto)
m_caster->CastSpell(summon, spellProto, true);
{
m_originalCaster->CastSpell(summon, spellProto, true);
return;
}
}
m_caster->EnterVehicle(summon->GetVehicleKit());
// Hard coded enter vehicle spell
m_originalCaster->CastSpell(summon, 46598, true);
summon->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id);
uint32 faction = properties->Faction;
if (!faction)
faction = m_originalCaster->getFaction();
summon->setFaction(faction);
break;
}
}