aboutsummaryrefslogtreecommitdiff
path: root/src/game/SpellEffects.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-03-09 19:17:12 -0600
committermegamage <none@none>2009-03-09 19:17:12 -0600
commitf71dff82c68a2b2f50a63db471f8bd9a2bc2a966 (patch)
tree5ec93d54ca9155d33d2d061c9b8e3073da89db58 /src/game/SpellEffects.cpp
parentaeefdeb8db194e4216ba82d15af2477c9ff40503 (diff)
*Fix build.
--HG-- branch : trunk
Diffstat (limited to 'src/game/SpellEffects.cpp')
-rw-r--r--src/game/SpellEffects.cpp108
1 files changed, 21 insertions, 87 deletions
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 8215d18d8a2..2e4e6cdecb4 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -663,7 +663,7 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
damage += count * int32(averange * IN_MILISECONDS) / m_caster->GetAttackTime(BASE_ATTACK);
}
// Shield of Righteousness
- else if(m_spellInfo->SpellFamilyFlags&0x0010000000000000LL)
+ else if(m_spellInfo->SpellFamilyFlags[1]&0x00100000)
{
damage+=int32(m_caster->GetShieldBlockValue());
}
@@ -2173,86 +2173,27 @@ void Spell::EffectTeleportUnits(uint32 i)
// If not exist data for dest location - return
if(!m_targets.HasDest())
{
- case TARGET_INNKEEPER_COORDINATES:
- {
- // Only players can teleport to innkeeper
- if (unitTarget->GetTypeId() != TYPEID_PLAYER)
- return;
-
- ((Player*)unitTarget)->TeleportTo(((Player*)unitTarget)->m_homebindMapId,((Player*)unitTarget)->m_homebindX,((Player*)unitTarget)->m_homebindY,((Player*)unitTarget)->m_homebindZ,unitTarget->GetOrientation(),unitTarget==m_caster ? TELE_TO_SPELL : 0);
- return;
- }
- case TARGET_TABLE_X_Y_Z_COORDINATES:
- {
- // TODO: Only players can teleport?
- if (unitTarget->GetTypeId() != TYPEID_PLAYER)
- return;
- SpellTargetPosition const* st = spellmgr.GetSpellTargetPosition(m_spellInfo->Id);
- if(!st)
- {
- sLog.outError( "Spell::EffectTeleportUnits - unknown Teleport coordinates for spell ID %u", m_spellInfo->Id );
- return;
- }
- ((Player*)unitTarget)->TeleportTo(st->target_mapId,st->target_X,st->target_Y,st->target_Z,st->target_Orientation,unitTarget==m_caster ? TELE_TO_SPELL : 0);
- break;
- }
- case TARGET_BEHIND_VICTIM:
- {
- // Get selected target for player (or victim for units)
- Unit *pTarget = NULL;
- if(m_caster->GetTypeId() == TYPEID_PLAYER)
- pTarget = ObjectAccessor::GetUnit(*m_caster, ((Player*)m_caster)->GetSelection());
- else
- pTarget = m_caster->getVictim();
- // No target present - return
- if (!pTarget)
- return;
- // Init dest coordinates
- uint32 mapid = m_caster->GetMapId();
- float x = m_targets.m_destX;
- float y = m_targets.m_destY;
- float z = m_targets.m_destZ;
- float orientation = pTarget->GetOrientation();
- // Teleport
- if(unitTarget->GetTypeId() == TYPEID_PLAYER)
- ((Player*)unitTarget)->TeleportTo(mapid, x, y, z, orientation, TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET | (unitTarget==m_caster ? TELE_TO_SPELL : 0));
- else
- {
- m_caster->GetMap()->CreatureRelocation((Creature*)unitTarget, x, y, z, orientation);
- WorldPacket data;
- unitTarget->BuildTeleportAckMsg(&data, x, y, z, orientation);
- unitTarget->SendMessageToSet(&data, false);
- }
- return;
- }
- default:
- {
- // If not exist data for dest location - return
- if(!(m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION))
- {
- sLog.outError( "Spell::EffectTeleportUnits - unknown EffectImplicitTargetB[%u] = %u for spell ID %u", i, m_spellInfo->EffectImplicitTargetB[i], m_spellInfo->Id );
- return;
- }
- // Init dest coordinates
- uint32 mapid = m_caster->GetMapId();
- float x = m_targets.m_destX;
- float y = m_targets.m_destY;
- float z = m_targets.m_destZ;
- float orientation = unitTarget->GetOrientation();
- // Teleport
- if(unitTarget->GetTypeId() == TYPEID_PLAYER)
- ((Player*)unitTarget)->TeleportTo(mapid, x, y, z, orientation, TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET | (unitTarget==m_caster ? TELE_TO_SPELL : 0));
- else
- {
- m_caster->GetMap()->CreatureRelocation((Creature*)unitTarget, x, y, z, orientation);
- WorldPacket data;
- unitTarget->BuildTeleportAckMsg(&data, x, y, z, orientation);
- unitTarget->SendMessageToSet(&data, false);
- }
- return;
- }
->>>>>>> 49353326cacc281efc169f4e4e8ccb517157ff23:src/game/SpellEffects.cpp
+ sLog.outError( "Spell::EffectTeleportUnits - does not have destination for spell ID %u\n", m_spellInfo->Id );
+ return;
}
+ // Init dest coordinates
+ int32 mapid = m_targets.m_mapId;
+ if(mapid < 0) mapid = (int32)unitTarget->GetMapId();
+ float x = m_targets.m_destX;
+ float y = m_targets.m_destY;
+ float z = m_targets.m_destZ;
+ float orientation = m_targets.getUnitTarget() ? m_targets.getUnitTarget()->GetOrientation() : unitTarget->GetOrientation();
+ sLog.outDebug("Spell::EffectTeleportUnits - teleport unit to %u %f %f %f\n", mapid, x, y, z);
+ // Teleport
+ if(unitTarget->GetTypeId() == TYPEID_PLAYER)
+ ((Player*)unitTarget)->TeleportTo(mapid, x, y, z, orientation, TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET | (unitTarget==m_caster ? TELE_TO_SPELL : 0));
+ else
+ {
+ MapManager::Instance().GetMap(mapid, m_caster)->CreatureRelocation((Creature*)unitTarget, x, y, z, orientation);
+ WorldPacket data;
+ unitTarget->BuildTeleportAckMsg(&data, x, y, z, orientation);
+ unitTarget->SendMessageToSet(&data, false);
+ }
// post effects for TARGET_TABLE_X_Y_Z_COORDINATES
switch ( m_spellInfo->Id )
@@ -4880,13 +4821,6 @@ void Spell::EffectScriptEffect(uint32 effIndex)
// Escape artist
case 20589:
{
- m_caster->RemoveSpellsCausingAura(SPELL_AURA_MOD_ROOT);
- m_caster->RemoveSpellsCausingAura(SPELL_AURA_MOD_DECREASE_SPEED);
- return;
- }
- // Escape artist
- case 20589:
- {
if(!unitTarget)
return;
// It is said that removing effects by script should include dispel resist mods