aboutsummaryrefslogtreecommitdiff
path: root/src/game/Spell.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2008-10-25 15:46:52 -0500
committermegamage <none@none>2008-10-25 15:46:52 -0500
commit55c25d894ed0eb53b7aac6b15bdddf0927565165 (patch)
treee82dd51823ea72e46ec10a3f27d2b2a2cac5216d /src/game/Spell.cpp
parent6fc23ef45ee2702dd3bba8fdd114e6535e773112 (diff)
[svn] Add SpellExtraInfoMap. Currently support:
Limited-number-of-players spell; shared damage spell; target-in-line cone spell (e.g. dark glare). Change angle of cone spells from 120 degree to 60 degree. --HG-- branch : trunk
Diffstat (limited to 'src/game/Spell.cpp')
-rw-r--r--src/game/Spell.cpp30
1 files changed, 26 insertions, 4 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 716cc7a518e..66bcd898cbf 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -1226,8 +1226,11 @@ void Spell::SearchAreaTarget(std::list<Unit*> &TagUnitMap, float radius, const u
TypeContainerVisitor<Trinity::SpellNotifierCreatureAndPlayer, WorldTypeMapContainer > world_object_notifier(notifier);
cell_lock->Visit(cell_lock, world_object_notifier, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
}
- TypeContainerVisitor<Trinity::SpellNotifierCreatureAndPlayer, GridTypeMapContainer > grid_object_notifier(notifier);
- cell_lock->Visit(cell_lock, grid_object_notifier, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
+ if(!spellmgr.GetSpellExtraInfo(m_spellInfo->Id, SPELL_EXTRA_INFO_MAX_TARGETS))
+ {
+ TypeContainerVisitor<Trinity::SpellNotifierCreatureAndPlayer, GridTypeMapContainer > grid_object_notifier(notifier);
+ cell_lock->Visit(cell_lock, grid_object_notifier, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
+ }
}
Unit* Spell::SearchNearbyTarget(float radius, SpellTargets TargetType, uint32 entry)
@@ -1351,6 +1354,8 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
m_targets.m_targetMask |= TARGET_FLAG_DEST_LOCATION;
case TARGET_ALL_AROUND_CASTER:
{
+ if(!unMaxTargets)
+ unMaxTargets = spellmgr.GetSpellExtraInfo(m_spellInfo->Id, SPELL_EXTRA_INFO_MAX_TARGETS);
m_caster->GetPosition(m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ);
}break;
case TARGET_CURRENT_ENEMY_COORDINATES:
@@ -1413,10 +1418,27 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
}
}break;
case TARGET_IN_FRONT_OF_CASTER:
+ case TARGET_UNIT_CONE_ENEMY_UNKNOWN:
{
- bool inFront = m_spellInfo->SpellVisual != 3879;
- SearchAreaTarget(TagUnitMap, radius, inFront ? PUSH_IN_FRONT : PUSH_IN_BACK,SPELL_TARGETS_AOE_DAMAGE);
+ switch(spellmgr.GetSpellExtraInfo(m_spellInfo->Id, SPELL_EXTRA_INFO_CONE_TYPE))
+ {
+ default:
+ case 0:
+ SearchAreaTarget(TagUnitMap, radius, PUSH_IN_FRONT, SPELL_TARGETS_AOE_DAMAGE);
+ break;
+ case 1:
+ SearchAreaTarget(TagUnitMap, radius, PUSH_IN_BACK, SPELL_TARGETS_AOE_DAMAGE);
+ break;
+ case 2:
+ SearchAreaTarget(TagUnitMap, radius, PUSH_IN_LINE, SPELL_TARGETS_AOE_DAMAGE);
+ break;
+ }
}break;
+ case TARGET_UNIT_CONE_ALLY:
+ {
+ SearchAreaTarget(TagUnitMap, radius, PUSH_IN_FRONT, SPELL_TARGETS_FRIENDLY);
+ }break;
+
// nearby target
case TARGET_UNIT_NEARBY_ALLY: