aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellEffects.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2011-05-19 18:50:57 +0200
committerShauren <shauren.trinity@gmail.com>2011-05-19 18:50:57 +0200
commit49a81557fabdb888916c41b5f0c67ca9f6e795b2 (patch)
treeaaa685f8e381a3f74e620fd0744d75b7dcd97e1a /src/server/game/Spells/SpellEffects.cpp
parent69376d0e1ce027f3abaf8e1c8757d786789b379e (diff)
Core/Units: Fixed totem timer UI
Closes #298 Closes #1595
Diffstat (limited to 'src/server/game/Spells/SpellEffects.cpp')
-rwxr-xr-xsrc/server/game/Spells/SpellEffects.cpp53
1 files changed, 26 insertions, 27 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 3b96476878c..70fbd92849c 100755
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -3018,37 +3018,36 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
break;
case SUMMON_TYPE_TOTEM:
{
- summon = m_caster->GetMap()->SummonCreature(entry, pos, properties, duration, m_originalCaster);
- if (!summon || !summon->isTotem())
- return;
+ 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);
+ // Mana Tide Totem
+ if (m_spellInfo->Id == 16190)
+ damage = m_caster->CountPctFromMaxHealth(10);
- if (damage) // if not spell info, DB values used
- {
- summon->SetMaxHealth(damage);
- summon->SetHealth(damage);
- }
+ if (damage) // if not spell info, DB values used
+ {
+ summon->SetMaxHealth(damage);
+ summon->SetHealth(damage);
+ }
- if (m_originalCaster->GetTypeId() == TYPEID_PLAYER
- && properties->Slot >= SUMMON_SLOT_TOTEM
- && properties->Slot < MAX_TOTEM_SLOT)
- {
- // set display id depending on race
- uint32 displayId = m_originalCaster->GetModelForTotem(PlayerTotemType(properties->Id));
- summon->SetNativeDisplayId(displayId);
- summon->SetDisplayId(displayId);
-
- //summon->SendUpdateToPlayerm_originalCaster->ToPlayer();
- WorldPacket data(SMSG_TOTEM_CREATED, 1+8+4+4);
- data << uint8(properties->Slot-1);
- data << uint64(m_originalCaster->GetGUID());
- data << uint32(duration);
- data << uint32(m_spellInfo->Id);
- m_originalCaster->ToPlayer()->SendDirectMessage(&data);
+ 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);
+ }
}
+ // 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: