mangosR2 / mangos

Production (stable and testing) versions of current mangosR2 v2 server (World of Warcraft: Wrath of the Lich King, 3.3.5a client).
http://mangosr2.2x2forum.com/
GNU General Public License v2.0
175 stars 77 forks source link

Spell Targets TARGET_AREAEFFECT_INSTANT #933

Closed Romman closed 12 years ago

Romman commented 12 years ago

Describe an example of one spell with this Target.

Spell ID = 39844 (by item 32406) for quest 11008 ("Fires Over Skettis"):

m_targets = 32 (TARGET_FLAG_SOURCE_LOCATION) EffectImplicitTargetA = 7 (TARGET_AREAEFFECT_INSTANT)

TARGET_FLAG_SOURCE_LOCATION means that in SpellCastTargets::read( ByteBuffer& data, Unit *caster ) we get coords, sent by client and define m_src Coords

When we try to fill targets: Spell::SetTargetMap { ... switch (targetMode) { ... case TARGET_AREAEFFECT_INSTANT: { .... // fill real target list if no spell script target defined FillAreaTargets(bounds.first != bounds.second ? tempTargetUnitMap : targetUnitMap, radius, PUSH_DEST_CENTER, bounds.first != bounds.second ? SPELL_TARGETS_ALL : targetB); with PUSH_DEST_CENTER we use m_dest Coords which are (0,0,0) by default (not defined)

As Result the core doesnt know the correct point for searching targets

Maybe need apply m_targets.setDestination(m_srcX, m_srcY, m_srcZ); somewhere?

Reamer commented 12 years ago

The right spell target fill is very hard. Try be self

rsa commented 12 years ago

as i think, need check target flag before fill map, if exist dst - fill by dst, else fill by src.

Reamer commented 12 years ago

I think this commit should fix it and we can revert our code back to master https://github.com/mangos/mangos/commit/534a25dd675267a4a36717b61916feb06b6a2773

rsa commented 12 years ago

no. code from Shmoo only partially solve this problem. as well, that our solutions do not interfere with each other.