Jump to content

Spell::EffectPlayerPull


Guest Tassader2

Recommended Posts

from Spell::EffectPlayerPull

                                                            // Horizontal speed
   data << float(damage ? damage : unitTarget->GetDistance2d(m_caster));
   data << float(m_spellInfo->EffectMiscValue[i])/-10;     // Z Movement speed

So horizontal speed is calculated from distance, z-speed (height) fom effect value. The results are not correct - sometimes players are pulled too high and fall far behind caster, instead of in front of him.

According to what I've read and seen on youtube videos, it should be other way round: distance from caster affects height (z-speed) and effeft the speed of the pull (horizontal speed.

In order to target to land in front of the caster, either z or horizontal speed must be affected by both distance and effect value.

So it can be something like this

                                                            
   data << float(m_spellInfo->EffectMiscValue[i]) * const1;    // Horizontal speed
                                                                                      // Z Movement speed
   data << float((damage ? damage : unitTarget->GetDistance2d(m_caster))/m_spellInfo->EffectMiscValue[i]) * const2;

const1 and const2 are to be found.

Do you agree with this concept?

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use