SHARE
TWEET

Untitled

a guest Oct 11th, 2016 152 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Set variables:
  2.  
  3. local MapScales = {
  4.     [0] = {[0] = {x=0.0000000001,y=0.0000000001}}, -- overworld dummy
  5.    
  6.     [-1] = { -- Battlegrounds
  7.         [0] = {x=0.0000000001,y=0.0000000001}, -- dummy
  8.         ["Alterac Valley"] = {x=0.00025277584791183,y=0.0003791834626879}, -- alterac
  9.         ["Arathi Basin"] = {x=0.00060996413230886,y=0.00091460134301867}, -- arathi
  10.         ["Warsong Gulch"] = {x=0.000934666820934484,y=0.0013986080884933}, -- warsong
  11.     },
  12.    
  13.     [1] = { -- Kalimdor
  14.         [0] = {x=0.0000000001,y=0.0000000001}, -- dummy
  15.         [1] = {x=0.00018538534641226,y=0.00027837923594884}, -- Ashenvale
  16.         [2] = {x=0.0002110515322004,y=0.00031666883400508}, -- Aszhara
  17.         [3] = {x=0.00016346999577114,y=0.0002448782324791}, -- Darkshore
  18.         [4] = {x=0.001011919762407,y=0.0015176417572158}, -- Darnassus
  19.         [5] = {x=0.000238049243117769,y=0.00035701000264713}, -- Desolace
  20.         [6] = {x=0.000202241752828887,y=0.00030311250260898},  -- Durotar
  21.         [7] = {x=0.00020404585770198,y=0.00030594425542014}, -- Dustwallow
  22.         [8] = {x=0.00018605589866638,y=0.00027919347797121}, -- Felwood
  23.         [9] = {x=0.00015413335391453,y=0.00023112978254046}, -- Feralas
  24.         [10] = {x=0.00046338992459433,y=0.00069469745670046}, -- Moonglade
  25.         [11] = {x=0.00020824585642133,y=0.00031234536852155}, -- Mulgor
  26.         [12] = {x=0.00076302673135485,y=0.0011450946331024}, -- Orgrimmar
  27.         [13] = {x=0.00030702139650072,y=0.00046115900788988}, -- Silithus
  28.         [14] = {x=0.0002192035317421,y=0.00032897400004523}, -- Stonetalon
  29.         [15] = {x=0.00015519559383392,y=0.00023255497217178}, -- Tanaris
  30.         [16] = {x=0.00021010743720191,y=0.00031522342136928}, -- Teldrassil
  31.         [17] = {x=0.0001055257661002,y=0.00015825512153762}, -- Barrens
  32.         [18] = {x=0.00024301665169852,y=0.00036516572747912}, -- Needles
  33.         [19] = {x=0.00102553303755263,y=0.0015390366315842}, -- Thunderbluff
  34.         [20] = {x=0.00028926772730691,y=0.0004336131470544}, -- Ungoro
  35.         [21] = {x=0.0001503484589713,y=0.0002260080405644}, -- Winterspring
  36.     },
  37.    
  38.     [2] = { -- Eastern Kingdoms
  39.         [0] = {x=0.0000000001,y=0.0000000001}, -- dummy
  40.         [1] = {x=0.00038236060312816,y=0.00057270910058703}, -- Alterac mountains
  41.         [2] = {x=0.00029711957488741,y=0.00044587893145425}, -- arathi
  42.         [3] = {x=0.00043004538331713,y=0.00064518196242196}, -- Badlands
  43.         [4] = {x=0.00031955327306475,y=0.00047930649348668}, -- blasted lands
  44.         [5] = {x=0.00036544565643583,y=0.00054845426763807}, -- Burning steppes
  45.         [6] = {x=0.00042719074657985,y=0.00064268921102796}, -- deadwind pass
  46.         [7] = {x=0.00021748670509883,y=0.00032613213573183}, -- Dun Morogh
  47.         [8] = {x=0.00039665134889739,y=0.000594192317755393},-- duskwood
  48.         [9] = {x=0.00027669753347124,y=0.00041501436914716}, -- EPL
  49.         [10] = {x=0.00030816452843802,y=0.00046261719294957}, -- Elwynn Forest
  50.         [11] = {x=0.00033472904137203,y=0.00050214784485953}, -- hillsbrad
  51.         [12] = {x=0.0013541845338685,y=0.0020301469734737}, -- Ironforge
  52.         [13] = {x=0.00038827742849077,y=0.000582420040021079}, -- loch modan
  53.         [14] = {x=0.00049317521708352,y=0.0007399320602417}, -- redridge mountains
  54.         [15] = {x=0.00047916280371802,y=0.00071918751512255}, -- Searing G.
  55.         [16] = {x=0.00025506743362975,y=0.00038200191089085}, -- silverpine
  56.         [17] = {x=0.00079576990434102,y=0.0011931381055287}, -- Stormwind
  57.         [18] = {x=0.00016783603600093,y=0.00025128040994917}, -- stranglethorn
  58.         [19] = {x=0.00046689595494952,y=0.00070027368409293}, -- swamp of sorrows
  59.         [20] = {x=0.0002777065549578,y=0.00041729531117848}, -- Hinterlands
  60.         [21] = {x=0.00023638989244189,y=0.0003550010068076}, -- Tirisfal
  61.         [22] = {x=0.0011167100497655,y=0.0016737942184721}, -- Undercity
  62.         [23] = {x=0.00024908781051636,y=0.00037342309951782}, -- WPL
  63.         [24] = {x=0.00030591232436044,y=0.00045816733368805},-- westfall
  64.         [25] = {x=0.00025879591703415,y=0.00038863212934562}, -- wetlands
  65.     }
  66. }
  67. local Continent = 1
  68. local Zone = 1
  69. local ZoneName = ""
  70. local UnitID = "party1"
  71. local px, py = 0, 0
  72. local ux, uy = 0, 0
  73. local distance = 0
  74.  
  75. Set Event:
  76.  
  77. elseif event == "ZONE_CHANGED_NEW_AREA" then
  78.         SetMapToCurrentZone()
  79.         Continent = GetCurrentMapContinent()
  80.         Zone = GetCurrentMapZone()
  81.         ZoneName = GetZoneText()
  82.         UnitID = "party1"
  83.         if ZoneName == "Warsong Gulch" or ZoneName == "Arathi Basin" or ZoneName == "Alterac Valley" then Zone = ZoneName end
  84.        
  85.        
  86. print distance:
  87.  
  88. function VHM:GetMapScale()
  89.     if VHM.GetNumPartyMembers() > 0 then
  90.         px, py = GetPlayerMapPosition("player")
  91.         ux, uy = GetPlayerMapPosition(UnitID)
  92.        
  93.         distance = sqrt(((px - ux)/MapScales[Continent][Zone].x)^2 + ((py - uy)/MapScales[Continent][Zone].y)^2)
  94.         DEFAULT_CHAT_FRAME:AddMessage(distance)
  95.     end
  96. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top