aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellEffects.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Spells/SpellEffects.cpp')
-rwxr-xr-xsrc/server/game/Spells/SpellEffects.cpp49
1 files changed, 15 insertions, 34 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 70fbd92849c..45ba65252a6 100755
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -3014,45 +3014,28 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
// Summons a vehicle, but doesn't force anyone to enter it (see SUMMON_CATEGORY_VEHICLE)
case SUMMON_TYPE_VEHICLE:
case SUMMON_TYPE_VEHICLE2:
- summon = m_caster->GetMap()->SummonCreature(entry, pos, properties, duration, m_originalCaster);
+ summon = m_caster->GetMap()->SummonCreature(entry, pos, properties, duration, m_originalCaster, m_spellInfo->Id);
break;
case SUMMON_TYPE_TOTEM:
{
- summon = m_caster->GetMap()->SummonCreature(entry, pos, properties, duration, m_originalCaster, 0, false);
- if (summon && summon->isTotem())
- {
-
- // Mana Tide Totem
- if (m_spellInfo->Id == 16190)
- damage = m_caster->CountPctFromMaxHealth(10);
+ summon = m_caster->GetMap()->SummonCreature(entry, pos, properties, duration, m_originalCaster, m_spellInfo->Id);
+ if (!summon || !summon->isTotem())
+ return;
- if (damage) // if not spell info, DB values used
- {
- summon->SetMaxHealth(damage);
- summon->SetHealth(damage);
- }
+ // Mana Tide Totem
+ if (m_spellInfo->Id == 16190)
+ damage = m_caster->CountPctFromMaxHealth(10);
- if (m_originalCaster->GetTypeId() == TYPEID_PLAYER
- && properties->Slot >= SUMMON_SLOT_TOTEM
- && properties->Slot < MAX_TOTEM_SLOT)
- {
- WorldPacket data(SMSG_TOTEM_CREATED, 1 + 8 + 4 + 4);
- data << uint8(properties->Slot - 1);
- data << uint64(summon->GetGUID());
- data << uint32(duration);
- data << uint32(m_spellInfo->Id);
- m_originalCaster->ToPlayer()->SendDirectMessage(&data);
- }
+ if (damage) // if not spell info, DB values used
+ {
+ summon->SetMaxHealth(damage);
+ summon->SetHealth(damage);
}
- // client requires SMSG_TOTEM_CREATED to be sent before CreateObject and at the same time
- // expects the summon's GUID so adding to world must be delayed
- if (summon)
- m_caster->GetMap()->Add(summon->ToCreature());
break;
}
case SUMMON_TYPE_MINIPET:
{
- summon = m_caster->GetMap()->SummonCreature(entry, pos, properties, duration, m_originalCaster);
+ summon = m_caster->GetMap()->SummonCreature(entry, pos, properties, duration, m_originalCaster, m_spellInfo->Id);
if (!summon || !summon->HasUnitTypeMask(UNIT_MASK_MINION))
return;
@@ -3105,14 +3088,14 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
SummonGuardian(effIndex, entry, properties);
break;
case SUMMON_CATEGORY_PUPPET:
- summon = m_caster->GetMap()->SummonCreature(entry, pos, properties, duration, m_originalCaster);
+ summon = m_caster->GetMap()->SummonCreature(entry, pos, properties, duration, m_originalCaster, m_spellInfo->Id);
break;
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;
m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE);
- summon = m_originalCaster->GetMap()->SummonCreature(entry, pos, properties, duration, m_caster);
+ summon = m_originalCaster->GetMap()->SummonCreature(entry, pos, properties, duration, m_caster, m_spellInfo->Id);
if (!summon || !summon->IsVehicle())
return;
@@ -3134,7 +3117,6 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
if (summon)
{
- summon->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id);
summon->SetCreatorGUID(m_originalCaster->GetGUID());
ExecuteLogEffectSummonObject(effIndex, summon);
}
@@ -6882,7 +6864,7 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const *
Position pos;
GetSummonPosition(i, pos, radius, count);
- TempSummon *summon = map->SummonCreature(entry, pos, properties, duration, caster);
+ TempSummon *summon = map->SummonCreature(entry, pos, properties, duration, caster, m_spellInfo->Id);
if (!summon)
return;
if (summon->HasUnitTypeMask(UNIT_MASK_GUARDIAN))
@@ -6891,7 +6873,6 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const *
if (properties && properties->Category == SUMMON_CATEGORY_ALLY)
summon->setFaction(caster->getFaction());
- summon->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id);
if (summon->HasUnitTypeMask(UNIT_MASK_MINION) && m_targets.HasDst())
((Minion*)summon)->SetFollowAngle(m_caster->GetAngle(summon));