*Allow spells to summon vehicles.

--HG--
branch : trunk
This commit is contained in:
megamage committed 2009-03-18 21:39:09 -06:00
1 parent 886b2a51e9
commit 281d20be0d
6 files changed
+79 -13

No files matched your search

+15
View File
@@ -60,6 +60,7 @@
#include "GridNotifiersImpl.h"
#include "SkillDiscovery.h"
#include "Formulas.h"
#include "Vehicle.h"
pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
{
@@ -3366,6 +3367,7 @@ void Spell::EffectSummonType(uint32 i)
EffectSummonPossessed(i);
break;
case SUMMON_TYPE_VEHICLE:
EffectSummonVehicle(i);
break;
}
break;
@@ -6776,6 +6778,19 @@ void Spell::EffectSummonPossessed(uint32 i)
pet->SetCharmedOrPossessedBy(m_caster, true);
}
void Spell::EffectSummonVehicle(uint32 i)
{
uint32 entry = m_spellInfo->EffectMiscValue[i];
if(!entry)
return;
float x, y, z;
m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE);
Vehicle *vehicle = m_caster->SummonVehicle(entry, x, y, z, m_caster->GetOrientation());
vehicle->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id);
}
void Spell::EffectRenamePet(uint32 /*eff_idx*/)
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT ||