diff options
author | megamage <none@none> | 2009-03-18 21:39:09 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-03-18 21:39:09 -0600 |
commit | 281d20be0d1c342f01798b1254fccb3b5a202bcd (patch) | |
tree | f2edf7a2f81a625d72f4beacb4523747ee004aad /src/game/SpellEffects.cpp | |
parent | 886b2a51e9f3fdbb8f6353e47701be825f8cf4b3 (diff) |
*Allow spells to summon vehicles.
--HG--
branch : trunk
Diffstat (limited to 'src/game/SpellEffects.cpp')
-rw-r--r-- | src/game/SpellEffects.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index ee0ca2784b4..4c717ba924c 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -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 || |