Jump to content

blink patch 2009


Recommended Posts

  • Replies 97
  • Created
  • Last Reply

Top Posters In This Topic

  • 39 years later...

I think there can never be enough blink patches :P, or at least mages deserve one more, so I decided to start working on it.

I will provide multiple patches. Because

1) Someone may prefer only minor fix, whereas someone else would be more happy with complete rewrite. I want to satisfy both :-)

2) I want to provide "step-by-step guide" of how I got to the final patch for those interested.

Patch v1.

What does it change: Moves "target height" check from Spell::CanCast to Spell::EffectMomentMove. That means that only leap effect fails instead of whole spell. Ie. in cases where you get "failed attempt" without this patch, with patch you wil not be teleported, but will be freed from stuns and bonds. This version does not fix blinking in textures, nor does it allow actual blinking (with teleporting) where it was not possible without it.

http://github.com/Tassader/mangos/tree/blink1

Patch v3.

What does it change: Modifies check for target height. Witch V1 as well as without any patch, the locatin checked for height may not be the same as where player actually gets teleported. With this patch the correst location is checked (and check is performed only for players). This version should prevent blinking in texture in some cases, as well as allow blinking at more places. In case of invalid height, player target is teleported to original position (ie. is stopped if moving or falling). I recommend using this version instead of v1 or v2.

http://github.com/Tassader/mangos/tree/blink3

The 2 above versions of patch change only height check. Version 4 with rewritten/modified code or target location selection will be ready soon :)

Note: patch removes check in CanCast for effects

43 SPELL_EFFECT_TELEPORT_UNITS_FACE_CASTER

and

29 SPELL_EFFECT_LEAP

It seems that effect 43 is "summon enemy player" (used by bosses' spells). Used check makes no sense for such effect (and implemented effect is currently wrong in spelleffect.cpp btw.), but is not purpose of this patch to make any further improvements/changes to that effect, only for effect 29.

Link to comment
Share on other sites

This should explain some things. :)

But does not give clear answer to my questions. I know it, because i looked there before posting them. ;)

The fact that wiki does not mention "failed attempt" does not mean it never happens. I'm _guessing_ it does not, but I am not _sure_ about it.

About blinking in midair, it says it teleports you back to where you jumped from (at least that's how understand it) and then it says it just stops horizontal movement. Either these statements either contradict themselves or I have not understood them correctly. I need more info anyway.

Link to comment
Share on other sites

You can avoid some pointy terrain distance shortening by hopping into the air and blinking mid-jump. Blink uses line of sight to calculate your travel distance, jumping gets you over small obstacles that would stop you, such as small trees and rocks, and the rope line at the Stormwind Bank.

If properly timed, Blink can be used to decrease or completely avoid falling damage.

Jump, spin 180 degrees in mid air, and blink when being followed by a hostile player. They'll lose a few seconds trying to find you if you manage to get behind them.

yes, you can blink in the air

Link to comment
Share on other sites

On official server, mage can blink if there's room. that means: no wall, and no rift. i am not shure about jumping and falling, but i will ask around.

I know that, but what exactly happens if there's no room? Does it just blink for shorter or even zero distance, but still free caster from stuns&bonds (that's what I think), or may an error message pop up?

yes, you can blink in the air

I know that, but what exactly happens if you DO blink in the air (and I repeat: when not near the ground)? Does it just stop you (that's what i think), move you forward or somewhere else?

Link to comment
Share on other sites

I know that, but what exactly happens if there's no room? Does it just blink for shorter or even zero distance, but still free caster from stuns&bonds (that's what I think), or may an error message pop up?
blink for shorter
I know that, but what exactly happens if you DO blink in the air (and I repeat: when not near the ground)? Does it just stop you (that's what i think), move you forward or somewhere else?
just move you forward, if you blink in the air then you will in the air but 20yards in the direction you are facing
Link to comment
Share on other sites

althought plopy is right if you have been falling from a very high distance, if you just jumped off a ledge, and then about ~2 seconds or less later press blink you will show up where you jumped from instead of falling

also if you are in mid air (more tahn ~2 seconds after jumping / falling) and blink you not only move forward the proper amount but also are stopped for a second in mid air and i BELIEVE fall damage is recalculated from that point instead of from the original distance (ie you blink just before you hit the ground and take no damage)

Link to comment
Share on other sites

I don't understand the slightest bit what patterns there are in the blinking in the video so as to understand how blink works on offi. Only thing I've managed to see is that it lets you do a blink even though the terrain is a bit higher or lower than you, but not if there's a cliff or something similar.

Link to comment
Share on other sites

Hi, I'll try to resume:

On official server, Blink never fails like it does on MaNGOS: it'll always teleport you as far as your character's LOS to the ground allows (maxing at 20 ft. (25 with Glyph) with some restrictions on areas' ends. That means:

a) If you're face up to a wall you'll blink, but still be at the same place, stuns and roots removed.

b) Your character doesn't have a LOS to the ground under objects (chests, pillars, etc.) and you can't blink ON objects. You either blink up to them or blink pass them (depends if you see the ground on the other side).

c) When you jump, your character is considered "jumping" as long as its altitude is equal or higher to its starting point's : he is considered "falling" afterward (try jumping a cliff with Slow Fall on...you'll understand). "Jumping" only rises up your LOS source, allowing you to see pass objects or terrain you wouldn't have otherwise.

d) Changes in the area's texture will block your blinking if you can't see and blink pass them. That's why you stop at cliffs when you jump-n'-blink (as long as you're not considered "falling") and why you stop at buildings' edges.

e) When falling, Blink will take you 20/25 feet in front of you, keeping the same altitude (z).

f) Blink always stop your horizontal and vertical mouvement momentum. It also resets the fall-off distance.

g) Blinking in water is like blinking in mid-air while "falling": you can't gain "altitude" by blinking while swimming.

Here. With these rules, you should have everything to code a good patch. =)

Tell me if I forgot anything...

Link to comment
Share on other sites

I've been searching for a patch to fix blink for some time, and I found one in KAPATEJIb's cumulative patches. I've got to say that patch is really good.

Blink never fails, always removes stun, will never teleport you under the map, and in 99% teleports forward. Why 99%? Because it doesn't work in tunnels, such as Stormwind tunnels that connect districts. My guess is in that zone maps or vmaps are not generated correct, because at the orgrimmar entrace(tunnel), blink works normally. In other zones, works perfect, including arenas and BGs. Doesn't teleport through objects, brings you up to them. Works only if there are vmaps on.

Here are the changes:

Spell.cpp

            case SPELL_EFFECT_LEAP:
            case SPELL_EFFECT_TELEPORT_UNITS_FACE_CASTER:
            {
-                float dis = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
-                float fx = m_caster->GetPositionX() + dis * cos(m_caster->GetOrientation());
-                float fy = m_caster->GetPositionY() + dis * sin(m_caster->GetOrientation());
-                // teleport a bit above terrain level to avoid falling below it
-                float fz = MapManager::Instance().GetBaseMap(m_caster->GetMapId())->GetHeight(fx,fy,m_caster->GetPositionZ(),true);
-                if(fz <= INVALID_HEIGHT)                    // note: this also will prevent use effect in instances without vmaps height enabled
-                    return SPELL_FAILED_TRY_AGAIN;
-
-                float caster_pos_z = m_caster->GetPositionZ();
-                // Control the caster to not climb or drop when +-fz > 8
-                if(!(fz<=caster_pos_z+8 && fz>=caster_pos_z-8))
-                    return SPELL_FAILED_TRY_AGAIN;
-
                // not allow use this effect at battleground until battleground start
                if(m_caster->GetTypeId()==TYPEID_PLAYER)
                    if(BattleGround const *bg = ((Player*)m_caster)->GetBattleGround())

SpellEffects.cpp

void Spell::EffectMomentMove(uint32 i)
{
   if(unitTarget->isInFlight())
       return;

   if( m_spellInfo->rangeIndex== 1)                        //self range
   {
       uint32 mapid = m_caster->GetMapId();
       float dis = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));

       // Start Info //
           float cx,cy,cz;
           float dx,dy,dz;
           float angle = unitTarget->GetOrientation();
           unitTarget->GetPosition(cx,cy,cz);

           //Check use of vamps//
           bool useVmap = false;
           bool swapZone = true;
           if( MapManager::Instance().GetMap(mapid, unitTarget)->GetHeight(cx, cy, cz, false) <  MapManager::Instance().GetMap(mapid, unitTarget)->GetHeight(cx, cy, cz, true) )
               useVmap = true;

           const int itr = int(dis/0.5f);
           const float _dx = 0.5f * cos(angle);
           const float _dy = 0.5f * sin(angle);
           dx = cx;
           dy = cy;

           //Going foward 0.5f until max distance
           for(float i=0.5f; i<dis; i+=0.5f)
           {
               //unitTarget->GetNearPoint2D(dx,dy,i,angle);
               dx += _dx;
               dy += _dy;
               MaNGOS::NormalizeMapCoord(dx);
               MaNGOS::NormalizeMapCoord(dy);
               dz = MapManager::Instance().GetMap(mapid, unitTarget)->GetHeight(dx, dy, cz, useVmap);

               //Prevent climbing and go around object maybe 2.0f is to small? use 3.0f?
               if( (dz-cz) < 2.0f && (dz-cz) > -2.0f && (unitTarget->IsWithinLOS(dx, dy, dz)))
               {
                   //No climb, the z differenze between this and prev step is ok. Store this destination for future use or check.
                   cx = dx;
                   cy = dy;
                   cz = dz;
               }
               else
               {
                   //Something wrong with los or z differenze... maybe we are going from outer world inside a building or viceversa
                   if(swapZone)
                   {
                       //so... change use of vamp and go back 1 step backward and recheck again.
                       swapZone = false;
                       useVmap = !useVmap;
                       //i-=0.5f;
                       --i;
                       dx -= _dx;
                       dy -= _dy;
                   }
                   else
                   {
                       //bad recheck result... so break this and use last good coord for teleport player...
                       dz += 0.5f;
                       break;
                   }
               }
           }

           //Prevent Falling during swap building/outerspace
           unitTarget->UpdateGroundPositionZ(cx, cy, cz);

       if(unitTarget->GetTypeId() == TYPEID_PLAYER)
           ((Player*)unitTarget)->TeleportTo(mapid, cx, cy, cz, unitTarget->GetOrientation(), TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET | (unitTarget==m_caster ? TELE_TO_SPELL : 0));
       else
           MapManager::Instance().GetMap(mapid, unitTarget)->CreatureRelocation((Creature*)unitTarget, cx, cy, cz, unitTarget->GetOrientation());
   }
}

In SpellEffects.cpp, the MomentMove function is completely replaced by this one. This function is a modified version of KAPATEJIb's patch, dx, dy coords are computed in other way.

I tested this patch only for 2.4.3. For 3.0.x I'm not sure if it will work. However it should.

P.S. I hope it will help finish your work, Tassader2.

Link to comment
Share on other sites

I'm currently using the patch Arclite posted, but it has quite some flaws:

Blink doesn't work on non-map surface (as mentioned above)

If you can figgure the potential range right you can blink up mountains (i.e. the Warsong graveyard mountains)

It still makes people fall under the map once in a while.

If you need help with improving the current situation of blink - let us know. ;)

Link to comment
Share on other sites

The patch I posted, is in my opinion the best that has been developed so far. It is not perfect, but is close to blizzlike. Anyone who can improve it, please do.

2 Henhouse, I tested the patch for 2.4.3, so it is compatible for mango- 0.12.

2 leak, I blinked maybe 100 times and only once I have fallen under the map, it is still much better than the one it is now in svn, or repo, if we talk about git.

Link to comment
Share on other sites

The patch I posted, is in my opinion the best that has been developed so far. It is not perfect, but is close to blizzlike. Anyone who can improve it, please do.

2 Henhouse, I tested the patch for 2.4.3, so it is compatible for mango- 0.12.

2 leak, I blinked maybe 100 times and only once I have fallen under the map, it is still much better than the one it is now in svn, or repo, if we talk about git.

that is a mod of an old version of my patch. and in this version there's a problem as you said in the connection between gameobject and maps where GO intersect map. In this zone blink will teleport you on the maps and not on the GO. (try this in the way that lead you to the lake of stormwind in the interesecition between the bridge and the ground). But now with the new map calculation i dont know if the problem still exist.

Link to comment
Share on other sites

this should work better...

this need vmap on too. I cant test it beacuse i dont have vmaps on my pc u.u.

void Spell::EffectMomentMove(uint32 i)
{
   if(unitTarget->isInFlight())
       return;

   if( m_spellInfo->rangeIndex== 1)                        //self range
   {
       uint32 mapid = m_caster->GetMapId();
       float dis = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));

       // Start Info //
           float cx,cy,cz;
           float dx,dy,dz;
           float angle = unitTarget->GetOrientation();
           unitTarget->GetPosition(cx,cy,cz);

           const int itr = int(dis/0.5f);
           const float _dx = 0.5f * cos(angle);
           const float _dy = 0.5f * sin(angle);
           dx = cx;
           dy = cy;

           //Going foward 0.5f until max distance
           for(float i=0.5f; i<dis; i+=0.5f)
           {
               dx += _dx;
               dy += _dy;
               MaNGOS::NormalizeMapCoord(dx);
               MaNGOS::NormalizeMapCoord(dy);
               dz = MapManager::Instance().GetMap(mapid, unitTarget)->GetHeight(dx, dy, cz);

               //Prevent climbing and go around object maybe 2.0f is to small? use 3.0f?
               if( (dz-cz) < 2.0f && (dz-cz) > -2.0f && (unitTarget->IsWithinLOS(dx, dy, dz)))
               {
                   //No climb, the z differenze between this and prev step is ok. Store this destination for future use or check.
                   cx = dx;
                   cy = dy;
                   cz = dz;
               }
               else
               {
                   break;
               }
           }

           //Prevent Falling during swap building/outerspace
           unitTarget->UpdateGroundPositionZ(cx, cy, cz);

       if(unitTarget->GetTypeId() == TYPEID_PLAYER)
           ((Player*)unitTarget)->TeleportTo(mapid, cx, cy, cz, unitTarget->GetOrientation(), TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET | (unitTarget==m_caster ? TELE_TO_SPELL : 0));
       else
           MapManager::Instance().GetMap(mapid, unitTarget)->CreatureRelocation((Creature*)unitTarget, cx, cy, cz, unitTarget->GetOrientation());
   }
}

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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