Changeset 142 for trunk/src/game/Spell.cpp
- Timestamp:
- 11/19/08 13:40:02 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/Spell.cpp
r141 r142 95 95 } 96 96 97 void SpellCastTargets::setDestination(float x, float y, float z, bool send )97 void SpellCastTargets::setDestination(float x, float y, float z, bool send, uint32 mapId) 98 98 { 99 99 m_destX = x; … … 103 103 if(send) 104 104 m_targetMask |= TARGET_FLAG_DEST_LOCATION; 105 if(mapId) 106 m_mapId = mapId; 105 107 } 106 108 … … 1007 1009 //if(!IsPositiveSpell(m_spellInfo->Id)) 1008 1010 { 1009 unit->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); 1011 //do not remove feign death 1012 unit->RemoveInterruptableAura(AURA_INTERRUPT_FLAG_STEALTH + AURA_INTERRUPT_FLAG_DAMAGE); 1010 1013 } 1011 1014 } … … 1013 1016 { 1014 1017 // for delayed spells ignore negative spells (after duel end) for friendly targets 1018 // TODO: this cause soul transfer bugged 1015 1019 if(m_spellInfo->speed > 0.0f && !IsPositiveSpell(m_spellInfo->Id)) 1016 1020 { … … 1250 1254 void Spell::SearchAreaTarget(std::list<Unit*> &TagUnitMap, float radius, const uint32 &type, SpellTargets TargetType, uint32 entry) 1251 1255 { 1252 if(type == PUSH_DEST_CENTER && !m_targets.HasDest()) 1253 { 1254 sLog.outError( "SPELL: cannot find destination for spell ID %u\n", m_spellInfo->Id ); 1255 return; 1256 } 1257 1258 CellPair p(Trinity::ComputeCellPair(m_targets.m_destX, m_targets.m_destY)); 1256 float x, y; 1257 if(type == PUSH_DEST_CENTER) 1258 { 1259 if(!m_targets.HasDest()) 1260 { 1261 sLog.outError( "SPELL: cannot find destination for spell ID %u\n", m_spellInfo->Id ); 1262 return; 1263 } 1264 x = m_targets.m_destX; 1265 y = m_targets.m_destY; 1266 } 1267 else 1268 { 1269 x = m_caster->GetPositionX(); 1270 y = m_caster->GetPositionY(); 1271 } 1272 1273 CellPair p(Trinity::ComputeCellPair(x, y)); 1259 1274 Cell cell(p); 1260 1275 cell.data.Part.reserved = ALL_DISTRICT; … … 1436 1451 if(SpellTargetPosition const* st = spellmgr.GetSpellTargetPosition(m_spellInfo->Id)) 1437 1452 { 1438 if (st->target_mapId == m_caster->GetMapId()) 1453 //TODO: fix this check 1454 if(m_spellInfo->Effect[0] == SPELL_EFFECT_TELEPORT_UNITS 1455 || m_spellInfo->Effect[1] == SPELL_EFFECT_TELEPORT_UNITS 1456 || m_spellInfo->Effect[2] == SPELL_EFFECT_TELEPORT_UNITS) 1457 m_targets.setDestination(st->target_X, st->target_Y, st->target_Z, true, st->target_mapId); 1458 else if(st->target_mapId == m_caster->GetMapId()) 1439 1459 m_targets.setDestination(st->target_X, st->target_Y, st->target_Z); 1440 1460 } 1441 1461 else 1442 1462 sLog.outError( "SPELL: unknown target coordinates for spell ID %u\n", m_spellInfo->Id ); 1463 break; 1464 case TARGET_INNKEEPER_COORDINATES: 1465 if(m_caster->GetTypeId() == TYPEID_PLAYER) 1466 m_targets.setDestination(((Player*)m_caster)->m_homebindX,((Player*)m_caster)->m_homebindY,((Player*)m_caster)->m_homebindZ, true, ((Player*)m_caster)->m_homebindMapId); 1443 1467 break; 1444 1468 … … 1481 1505 case TARGET_IN_FRONT_OF_CASTER: 1482 1506 case TARGET_UNIT_CONE_ENEMY_UNKNOWN: 1483 {1484 1507 switch(spellmgr.GetSpellExtraAttr(m_spellInfo->Id, SPELL_EXTRA_ATTR_CONE_TYPE)) 1485 1508 { … … 1494 1517 SearchAreaTarget(TagUnitMap, radius, PUSH_IN_LINE, SPELL_TARGETS_AOE_DAMAGE); 1495 1518 break; 1496 } 1497 }break; 1519 }break; 1498 1520 case TARGET_UNIT_CONE_ALLY: 1499 {1500 1521 SearchAreaTarget(TagUnitMap, radius, PUSH_IN_FRONT, SPELL_TARGETS_FRIENDLY); 1501 }break;1522 break; 1502 1523 1503 1524 // nearby target … … 2000 2021 case TARGET_DEST_DEST_RANDOM: 2001 2022 { 2002 if(! (m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION))2023 if(!m_targets.HasDest()) 2003 2024 { 2004 2025 sLog.outError("SPELL: no destination for spell ID %u\n", m_spellInfo->Id); … … 2014 2035 }break; 2015 2036 case TARGET_SELF2: 2016 m_targets.m_hasDest = true; 2037 if(!m_targets.HasDest()) 2038 { 2039 sLog.outError("SPELL: no destination for spell ID %u\n", m_spellInfo->Id); 2040 break; 2041 } 2017 2042 break; 2018 2043 default: … … 2124 2149 if ( !m_IsTriggeredSpell && isSpellBreakStealth(m_spellInfo) ) 2125 2150 { 2126 m_caster->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); 2127 m_caster->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH); 2151 m_caster->RemoveInterruptableAura(AURA_INTERRUPT_FLAG_STEALTH); 2128 2152 } 2129 2153