{"action":"created","comment":{"url":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/comments/54406782","id":54406782,"diff_hunk":"@@ -1283,6 +1283,187 @@ void Spell::SelectImplicitCasterDestTargets(SpellEffIndex effIndex, SpellImplici\n             dest = SpellDestination(x, y, liquidLevel, m_caster->GetOrientation());\n             break;\n         }\n+        case TARGET_DEST_CASTER_FRONT_LEAP:\n+        {\n+            float distance = m_spellInfo->Effects[effIndex].CalcRadius(m_caster);\n+            Map* map = m_caster->GetMap();\n+            uint32 mapid = m_caster->GetMapId();\n+            uint32 phasemask = m_caster->GetPhaseMask();\n+            float destx, desty, destz, ground;\n+\n+            Position pos;\n+            Position lastpos;\n+            pos = m_caster->GetPosition();\n+            destx = pos.GetPositionX() + distance * cos(pos.GetOrientation());\n+            desty = pos.GetPositionY() + distance * sin(pos.GetOrientation());\n+\n+            ground = map->GetHeight(phasemask, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ());\n+\n+            if (!m_caster->HasUnitMovementFlag(MOVEMENTFLAG_FALLING) || (pos.GetPositionZ() - ground < 25.0f))\n+            {\n+                float tstX, tstY, tstZ, prevX, prevY, prevZ;\n+                float tstZ1, tstZ2, tstZ3, destz1, destz2, destz3, srange, srange1, srange2, srange3;\n+                float maxtravelDistZ = 2.65f;\n+                float overdistance = 0.0f;\n+                float totalpath = 0.0f;\n+                float beforewaterz = 0.0f;\n+                const float  step = 2.0f;\n+                const uint8 numChecks = ceil(fabs(distance / step));\n+                const float DELTA_X = (destx - pos.GetPositionX()) / numChecks;\n+                const float DELTA_Y = (desty - pos.GetPositionY()) / numChecks;\n+                int j = 1;\n+                for (; j < (numChecks + 1); j++)\n+                {\n+                    prevX = pos.GetPositionX() + (float(j - 1)*DELTA_X);\n+                    prevY = pos.GetPositionY() + (float(j - 1)*DELTA_Y);\n+                    tstX = pos.GetPositionX() + (float(j)*DELTA_X);\n+                    tstY = pos.GetPositionY() + (float(j)*DELTA_Y);\n+\n+                    if (j < 2)\n+                    {\n+                        prevZ = pos.GetPositionZ();\n+                    }\n+                    else\n+                    {\n+                        prevZ = tstZ;\n+                    }\n+\n+                    tstZ = map->GetHeight(phasemask, tstX, tstY, prevZ + maxtravelDistZ, true);\n+                    ground = tstZ;\n+\n+                    if (!map->IsInWater(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ()))\n+                    {\n+                        if (map->IsInWater(tstX, tstY, tstZ))\n+                        {\n+                            if (!(beforewaterz != 0.0f))\n+                                beforewaterz = prevZ;\n+                            tstZ = beforewaterz;\n+                            srange = sqrt((tstY - prevY)*(tstY - prevY) + (tstX - prevX)*(tstX - prevX));\n+                            //TC_LOG_ERROR(\"server\", \"(start was from land) step in water , number of cycle = %i , distance of step = %f, total path = %f, Z = %f\", j, srange, totalpath, tstZ);\n+                        }\n+                    }\n+                    else if (map->IsInWater(tstX, tstY, tstZ))\n+                    {\n+                        prevZ = pos.GetPositionZ();\n+                        tstZ = pos.GetPositionZ();\n+                        srange = sqrt((tstY - prevY)*(tstY - prevY) + (tstX - prevX)*(tstX - prevX));\n+                        //TC_LOG_ERROR(\"server\", \"(start in water) step in water, number of cycle = %i , distance of step = %f, total path = %f\", j, srange, totalpath);\n+                    }\n+\n+                    if (!map->IsInWater(tstX, tstY, tstZ) && tstZ != beforewaterz)  // second safety check z for blink way if on the ground\n+                    {\n+                        // highest available point\n+                        tstZ1 = map->GetHeight(phasemask, tstX, tstY, prevZ + maxtravelDistZ, true, 25.0f);\n+                        // upper or floor\n+                        tstZ2 = map->GetHeight(phasemask, tstX, tstY, prevZ, true, 25.0f);\n+                        //lower than floor\n+                        tstZ3 = map->GetHeight(phasemask, tstX, tstY, prevZ - maxtravelDistZ / 2, true, 25.0f);\n+\n+                        //distance of rays, will select the shortest in 3D\n+                        srange1 = sqrt((tstY - prevY)*(tstY - prevY) + (tstX - prevX)*(tstX - prevX) + (tstZ1 - prevZ)*(tstZ1 - prevZ));\n+                        //TC_LOG_ERROR(\"server\", \"step = %i, distance of ray1 = %f\", j, srange1);\n+                        srange2 = sqrt((tstY - prevY)*(tstY - prevY) + (tstX - prevX)*(tstX - prevX) + (tstZ2 - prevZ)*(tstZ2 - prevZ));\n+                        //TC_LOG_ERROR(\"server\", \"step = %i, distance of ray2 = %f\", j, srange2);\n+                        srange3 = sqrt((tstY - prevY)*(tstY - prevY) + (tstX - prevX)*(tstX - prevX) + (tstZ3 - prevZ)*(tstZ3 - prevZ));\n+                        //TC_LOG_ERROR(\"server\", \"step = %i, distance of ray3 = %f\", j, srange3);\n+\n+                        if (srange1 < srange2)\n+                            tstZ = tstZ1;\n+                        else if (srange3 < srange2)\n+                            tstZ = tstZ3;\n+                        else\n+                            tstZ = tstZ2;\n+\n+                        srange = sqrt((tstY - prevY)*(tstY - prevY) + (tstX - prevX)*(tstX - prevX) + (tstZ - prevZ)*(tstZ - prevZ));\n+                        //TC_LOG_ERROR(\"server\", \"step on ground, number of cycle = %i , distance of step = %f, total path = %f\", j, srange, totalpath);\n+                    }\n+\n+                    destx = tstX;\n+                    desty = tstY;\n+                    destz = tstZ;\n+\n+                    totalpath += srange;\n+\n+                    if (totalpath > distance)\n+                    {\n+                        overdistance = totalpath - distance;\n+                        //TC_LOG_ERROR(\"server\", \"total path > than distance in 3D , need to move back a bit for save distance, total path = %f, overdistance = %f\", totalpath, overdistance);\n+                    }\n+\n+                    bool col = VMAP::VMapFactory::createOrGetVMapManager()->getObjectHitPos(mapid, prevX, prevY, prevZ + 0.5f, tstX, tstY, tstZ + 0.5f, tstX, tstY, tstZ, -0.5f);\n+                    // check dynamic collision\n+                    bool dcol = m_caster->GetMap()->getObjectHitPos(phasemask, prevX, prevY, prevZ + 0.5f, tstX, tstY, tstZ + 0.5f, tstX, tstY, tstZ, -0.5f);\n+\n+                    // collision occured\n+                    if (col || dcol || (overdistance > 0.0f && !map->IsInWater(tstX, tstY, ground)) || (fabs(prevZ - tstZ) > maxtravelDistZ && (tstZ > prevZ)))\n+                    {\n+                        if ((overdistance > 0.0f) && (overdistance < step))\n+                        {\n+                            destx = prevX + overdistance * cos(pos.GetOrientation());\n+                            desty = prevY + overdistance * sin(pos.GetOrientation());\n+                            //TC_LOG_ERROR(\"server\", \"(collision) collision occured 1\");\n+                        }\n+                        else\n+                        {\n+                            // move back a bit\n+                            destx = tstX - (0.6 * cos(pos.GetOrientation()));\n+                            desty = tstY - (0.6 * sin(pos.GetOrientation()));\n+                            //TC_LOG_ERROR(\"server\", \"(collision) collision occured 2\");\n+                        }\n+\n+                        // highest available point\n+                        destz1 = map->GetHeight(phasemask, destx, desty, prevZ + maxtravelDistZ, true, 25.0f);\n+                        // upper or floor\n+                        destz2 = map->GetHeight(phasemask, destx, desty, prevZ, true, 25.0f);\n+                        //lower than floor\n+                        destz3 = map->GetHeight(phasemask, destx, desty, prevZ - maxtravelDistZ / 2, true, 25.0f);","path":"src/server/game/Spells/Spell.cpp","position":137,"original_position":137,"commit_id":"8a67973e928eb13fafa216f2bc54317857c1652c","original_commit_id":"8a67973e928eb13fafa216f2bc54317857c1652c","user":{"login":"r00ty-tc","id":173349,"avatar_url":"https://avatars.githubusercontent.com/u/173349?v=3","gravatar_id":"","url":"https://api.github.com/users/r00ty-tc","html_url":"https://github.com/r00ty-tc","followers_url":"https://api.github.com/users/r00ty-tc/followers","following_url":"https://api.github.com/users/r00ty-tc/following{/other_user}","gists_url":"https://api.github.com/users/r00ty-tc/gists{/gist_id}","starred_url":"https://api.github.com/users/r00ty-tc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r00ty-tc/subscriptions","organizations_url":"https://api.github.com/users/r00ty-tc/orgs","repos_url":"https://api.github.com/users/r00ty-tc/repos","events_url":"https://api.github.com/users/r00ty-tc/events{/privacy}","received_events_url":"https://api.github.com/users/r00ty-tc/received_events","type":"User","site_admin":false},"body":"Yep I know, and it can only do that due to the way textures are in game. I wrote a whole post this morning on TC forum about it\r\n\r\nhttps://community.trinitycore.org/topic/12397-unit-z-position-and-creatureinvoluntary-player-movement/","created_at":"2016-02-29T13:08:39Z","updated_at":"2016-02-29T13:08:39Z","html_url":"https://github.com/TrinityCore/TrinityCore/pull/15796#discussion_r54406782","pull_request_url":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/15796","_links":{"self":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/comments/54406782"},"html":{"href":"https://github.com/TrinityCore/TrinityCore/pull/15796#discussion_r54406782"},"pull_request":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/15796"}}},"pull_request":{"url":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/15796","id":49369491,"html_url":"https://github.com/TrinityCore/TrinityCore/pull/15796","diff_url":"https://github.com/TrinityCore/TrinityCore/pull/15796.diff","patch_url":"https://github.com/TrinityCore/TrinityCore/pull/15796.patch","issue_url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/15796","number":15796,"state":"closed","locked":false,"title":"Blink v4","user":{"login":"kvipka","id":2619928,"avatar_url":"https://avatars.githubusercontent.com/u/2619928?v=3","gravatar_id":"","url":"https://api.github.com/users/kvipka","html_url":"https://github.com/kvipka","followers_url":"https://api.github.com/users/kvipka/followers","following_url":"https://api.github.com/users/kvipka/following{/other_user}","gists_url":"https://api.github.com/users/kvipka/gists{/gist_id}","starred_url":"https://api.github.com/users/kvipka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kvipka/subscriptions","organizations_url":"https://api.github.com/users/kvipka/orgs","repos_url":"https://api.github.com/users/kvipka/repos","events_url":"https://api.github.com/users/kvipka/events{/privacy}","received_events_url":"https://api.github.com/users/kvipka/received_events","type":"User","site_admin":false},"body":"- -[x] blink in abyss\r\n- -[x] blink by path ( rechecking each step )\r\n- -[x] where player can walk - blink will available there\r\n- -[x] implemented check on dynamic objects (locked doors and etc)\r\n- -[x] implemented total path of blink.\r\n\r\nvideo : http://www.youtube.com/watch?v=wpymzrkwNTg","created_at":"2015-11-01T10:42:47Z","updated_at":"2016-02-29T13:08:39Z","closed_at":"2016-02-26T22:34:54Z","merged_at":null,"merge_commit_sha":"1ff13c99417f84a1e90852fe0779c38d35d83061","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/15796/commits","review_comments_url":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/15796/comments","review_comment_url":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/15796/comments","statuses_url":"https://api.github.com/repos/TrinityCore/TrinityCore/statuses/8a67973e928eb13fafa216f2bc54317857c1652c","head":{"label":"kvipka:blink","ref":"blink","sha":"8a67973e928eb13fafa216f2bc54317857c1652c","user":{"login":"kvipka","id":2619928,"avatar_url":"https://avatars.githubusercontent.com/u/2619928?v=3","gravatar_id":"","url":"https://api.github.com/users/kvipka","html_url":"https://github.com/kvipka","followers_url":"https://api.github.com/users/kvipka/followers","following_url":"https://api.github.com/users/kvipka/following{/other_user}","gists_url":"https://api.github.com/users/kvipka/gists{/gist_id}","starred_url":"https://api.github.com/users/kvipka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kvipka/subscriptions","organizations_url":"https://api.github.com/users/kvipka/orgs","repos_url":"https://api.github.com/users/kvipka/repos","events_url":"https://api.github.com/users/kvipka/events{/privacy}","received_events_url":"https://api.github.com/users/kvipka/received_events","type":"User","site_admin":false},"repo":null},"base":{"label":"TrinityCore:3.3.5","ref":"3.3.5","sha":"9f6a7c7526b10b4cd7da21cc76643319d87ba0f3","user":{"login":"TrinityCore","id":539602,"avatar_url":"https://avatars.githubusercontent.com/u/539602?v=3","gravatar_id":"","url":"https://api.github.com/users/TrinityCore","html_url":"https://github.com/TrinityCore","followers_url":"https://api.github.com/users/TrinityCore/followers","following_url":"https://api.github.com/users/TrinityCore/following{/other_user}","gists_url":"https://api.github.com/users/TrinityCore/gists{/gist_id}","starred_url":"https://api.github.com/users/TrinityCore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TrinityCore/subscriptions","organizations_url":"https://api.github.com/users/TrinityCore/orgs","repos_url":"https://api.github.com/users/TrinityCore/repos","events_url":"https://api.github.com/users/TrinityCore/events{/privacy}","received_events_url":"https://api.github.com/users/TrinityCore/received_events","type":"Organization","site_admin":false},"repo":{"id":1204412,"name":"TrinityCore","full_name":"TrinityCore/TrinityCore","owner":{"login":"TrinityCore","id":539602,"avatar_url":"https://avatars.githubusercontent.com/u/539602?v=3","gravatar_id":"","url":"https://api.github.com/users/TrinityCore","html_url":"https://github.com/TrinityCore","followers_url":"https://api.github.com/users/TrinityCore/followers","following_url":"https://api.github.com/users/TrinityCore/following{/other_user}","gists_url":"https://api.github.com/users/TrinityCore/gists{/gist_id}","starred_url":"https://api.github.com/users/TrinityCore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TrinityCore/subscriptions","organizations_url":"https://api.github.com/users/TrinityCore/orgs","repos_url":"https://api.github.com/users/TrinityCore/repos","events_url":"https://api.github.com/users/TrinityCore/events{/privacy}","received_events_url":"https://api.github.com/users/TrinityCore/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TrinityCore/TrinityCore","description":"TrinityCore Open Source MMO Framework","fork":false,"url":"https://api.github.com/repos/TrinityCore/TrinityCore","forks_url":"https://api.github.com/repos/TrinityCore/TrinityCore/forks","keys_url":"https://api.github.com/repos/TrinityCore/TrinityCore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TrinityCore/TrinityCore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TrinityCore/TrinityCore/teams","hooks_url":"https://api.github.com/repos/TrinityCore/TrinityCore/hooks","issue_events_url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/events{/number}","events_url":"https://api.github.com/repos/TrinityCore/TrinityCore/events","assignees_url":"https://api.github.com/repos/TrinityCore/TrinityCore/assignees{/user}","branches_url":"https://api.github.com/repos/TrinityCore/TrinityCore/branches{/branch}","tags_url":"https://api.github.com/repos/TrinityCore/TrinityCore/tags","blobs_url":"https://api.github.com/repos/TrinityCore/TrinityCore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TrinityCore/TrinityCore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TrinityCore/TrinityCore/git/refs{/sha}","trees_url":"https://api.github.com/repos/TrinityCore/TrinityCore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TrinityCore/TrinityCore/statuses/{sha}","languages_url":"https://api.github.com/repos/TrinityCore/TrinityCore/languages","stargazers_url":"https://api.github.com/repos/TrinityCore/TrinityCore/stargazers","contributors_url":"https://api.github.com/repos/TrinityCore/TrinityCore/contributors","subscribers_url":"https://api.github.com/repos/TrinityCore/TrinityCore/subscribers","subscription_url":"https://api.github.com/repos/TrinityCore/TrinityCore/subscription","commits_url":"https://api.github.com/repos/TrinityCore/TrinityCore/commits{/sha}","git_commits_url":"https://api.github.com/repos/TrinityCore/TrinityCore/git/commits{/sha}","comments_url":"https://api.github.com/repos/TrinityCore/TrinityCore/comments{/number}","issue_comment_url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/comments{/number}","contents_url":"https://api.github.com/repos/TrinityCore/TrinityCore/contents/{+path}","compare_url":"https://api.github.com/repos/TrinityCore/TrinityCore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TrinityCore/TrinityCore/merges","archive_url":"https://api.github.com/repos/TrinityCore/TrinityCore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TrinityCore/TrinityCore/downloads","issues_url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues{/number}","pulls_url":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls{/number}","milestones_url":"https://api.github.com/repos/TrinityCore/TrinityCore/milestones{/number}","notifications_url":"https://api.github.com/repos/TrinityCore/TrinityCore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TrinityCore/TrinityCore/labels{/name}","releases_url":"https://api.github.com/repos/TrinityCore/TrinityCore/releases{/id}","deployments_url":"https://api.github.com/repos/TrinityCore/TrinityCore/deployments","created_at":"2010-12-28T23:40:07Z","updated_at":"2016-02-29T07:56:45Z","pushed_at":"2016-02-29T11:22:17Z","git_url":"git://github.com/TrinityCore/TrinityCore.git","ssh_url":"git@github.com:TrinityCore/TrinityCore.git","clone_url":"https://github.com/TrinityCore/TrinityCore.git","svn_url":"https://github.com/TrinityCore/TrinityCore","homepage":"http://www.trinitycore.org","size":751798,"stargazers_count":3164,"watchers_count":3164,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3303,"mirror_url":null,"open_issues_count":1363,"forks":3303,"open_issues":1363,"watchers":3164,"default_branch":"6.x"}},"_links":{"self":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/15796"},"html":{"href":"https://github.com/TrinityCore/TrinityCore/pull/15796"},"issue":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/15796"},"comments":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/15796/comments"},"review_comments":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/15796/comments"},"review_comment":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/15796/commits"},"statuses":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/statuses/8a67973e928eb13fafa216f2bc54317857c1652c"}}}}