Signup Now
Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Show Runes

  1. #1
    Moderator Leonardo's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    758
    Reputation
    77
    Rep Power
    22

    Show Runes

    Show Runes

    Description

    It shows on your screen where runes on your crosshair will hit.


    Configuration

    Change AnimateShape to false if you don't want to animate the shape with the current rune image, making that will freeze the image shown.
    Change CommonShape to true if you don't want to draw the rune shape, that will just show a "drown" icon on the affected squares.

    Code

    init start
    local AnimateShape = true
    local CommonShape = false

    -- DO NOT EDIT BELOW --
    -- OR EDIT IF YOU KNOW WHAT YOU'RE DOING
    local runes = {
    {itemID = 3192, area = "2x2", id = 16},
    {itemID = 3161, area = "3x3", id = 42},
    {itemID = 3191, area = "3x3", id = 7},
    {itemID = 3202, area = "3x3", id = 12},
    {itemID = 3175, area = "3x3", id = 45},
    {itemID = 3180, area = "mpos", id = 2128},
    {itemID = 3156, area = "mpos", id = 10182},
    {itemID = 3152, area = "mpos", id = 13},
    {itemID = 3155, area = "mpos", id = 18},
    {itemID = 3160, area = "mpos", id = 13},
    {itemID = 3164, area = "mpos", id = 2135},
    {itemID = 3172, area = "mpos", id = 2134},
    {itemID = 3174, area = "mpos", id = 12},
    {itemID = 3179, area = "mpos", id = 45},
    {itemID = 3182, area = "mpos", id = 40},
    {itemID = 3188, area = "mpos", id = 2131},
    {itemID = 3198, area = "mpos", id = 12},
    {itemID = 3190, area = "wall", id = 2131},
    {itemID = 3176, area = "wall", id = 2134},
    {itemID = 3166, area = "wall", id = 2135},
    {itemID = 3200, area = "expl", id = 5},
    }

    local function drawspellshape(id, x, y)
    local pos, info = table.find(runes, id, "itemID")

    if pos then
    info = runes[pos]
    else
    return false
    end

    if info.area == 'mpos' then
    -- rune is only on 1 sqm
    if info.id == 2128 or info.id == 10182 and not CommonShape then
    return {elements = {{x = x - 1, y = y - 1}}, effectID = info.id}
    end

    return {elements = {{x = x, y = y}}, effectID = info.id}
    elseif info.area == 'expl' then
    -- rune is an explosion rune (+ shaped)
    return {elements = {{x = x, y = y}, {x = x, y = y + 1}, {x = x, y = y - 1}, {x = x + 1, y = y}, {x = x - 1, y = y}}, effectID = info.id}
    elseif info.area == '2x2' then
    -- fire bomb rune
    local elements = {}

    for a = -1, 1 do
    for b = -1, 1 do
    table.insert(elements, {x = x + a, y = y + b})
    end
    end

    return {elements = elements, effectID = info.id}
    elseif info.area == '3x3' then
    -- area rune
    local elements = {}

    for a = -3, 3 do
    for b = -3, 3 do
    if math.abs(a) + math.abs(b) < 5 then
    table.insert(elements, {x = x + a, y = y + b})
    end
    end
    end

    return {elements = elements, effectID = info.id}
    elseif info.area == 'wall' then
    -- energy/poison/fire wall field
    local elements = {{x = x, y = y}}
    local distx, disty = math.abs($posx - x), math.abs($posy - y)

    if x == $posx or y == $posy or (distx == 1 or disty == 1) then
    local delim = 2

    if id == 3166 then -- size of energy wall is 1 sqm larger
    delim = 3
    end

    if distx < disty then
    for i = 1, delim do
    table.insert(elements, {x = x + i, y = y})
    table.insert(elements, {x = x - i, y = y})
    end
    else
    for i = 1, delim do
    table.insert(elements, {x = x, y = y - i})
    table.insert(elements, {x = x, y = y + i})
    end
    end
    else
    -- determine quadrant
    -- these are always equal
    elements[2] = {x = x + 1, y = y}
    elements[3] = {x = x - 1, y = y}

    if (x > $posx and y > $posy) or (x < $posx and y < $posy) then
    -- \
    elements[4] = {x = elements[2].x, y = elements[2].y - 1}
    elements[5] = {x = elements[3].x, y = elements[3].y + 1}
    elements[6] = {x = elements[4].x + 1, y = elements[4].y}
    elements[7] = {x = elements[5].x - 1, y = elements[5].y}
    elements[8] = {x = elements[6].x, y = elements[6].y - 1}
    elements[9] = {x = elements[7].x, y = elements[7].y + 1}

    if id == 3166 then
    elements[10] = {x = elements[8].x + 1, y = elements[8].y}
    elements[11] = {x = elements[9].x - 1, y = elements[9].y}
    elements[12] = {x = elements[10].x, y = elements[10].y - 1}
    elements[13] = {x = elements[11].x, y = elements[11].y + 1}
    end
    else
    -- /
    elements[4] = {x = elements[2].x, y = elements[2].y + 1}
    elements[5] = {x = elements[3].x, y = elements[3].y - 1}
    elements[6] = {x = elements[4].x + 1, y = elements[4].y}
    elements[7] = {x = elements[5].x - 1, y = elements[5].y}
    elements[8] = {x = elements[6].x, y = elements[6].y + 1}
    elements[9] = {x = elements[7].x, y = elements[7].y - 1}

    if id == 3166 then
    elements[10] = {x = elements[8].x + 1, y = elements[8].y}
    elements[11] = {x = elements[9].x - 1, y = elements[9].y}
    elements[12] = {x = elements[10].x, y = elements[10].y + 1}
    elements[13] = {x = elements[11].x, y = elements[11].y - 1}
    end
    end
    end

    return {elements = elements, effectID = info.id}
    end

    return false
    end

    useworldhud()

    init end

    if $cursorinfo.crosshair > 0 then
    local pos = cursorinfo(($targeting and $cavebot and getsetting('Settings/MouseMode') == 'Simulate Mouse') and $simulatedcursor or $cursor)

    if not (pos.x == 0 and pos.y == 0 and pos.z == 0) then
    local toDraw = drawspellshape($cursorinfo.crosshair, pos.x, pos.y)

    if toDraw then
    local scale = math.floor((($worldwin.width / 13) / 36.5) * 100)

    for _, item in pairs(toDraw.elements) do
    local r = getobjectarea(item.x, item.y, $posz)

    if r then
    if toDraw.effectID <= 75 or CommonShape then
    draweffect(CommonShape and 2 or toDraw.effectID, r.left, r.top, scale, AnimateShape and -1 or 2)
    else
    drawitem(toDraw.effectID, r.left, r.top, scale, 1, AnimateShape and -1 or 2)
    end
    end
    end
    end
    end
    end

    setposition($worldwin.left, $worldwin.top) setfixedsize($worldwin.width, $worldwin.height)

    Download

    Special Thanks

    Lucas Terra, Raphael, Dehan and BUgWT for being nice as always and helping out with bugs and testing.
    Last edited by Leonardo; 03-16-2015 at 06:01 PM.

  2. #2
    Moderator Dehan's Avatar
    Join Date
    Dec 2013
    Posts
    1,404
    Reputation
    315
    Rep Power
    26
    I loved it!

    Well done, Leo das Gatinhas!!!!
    haha

    Level Latest Scripts by Dehan
    250+
    [EK & ED & MS & RP] [Navigation] Prison -1
    200+
    [EK & ED & MS] [Navigation] Asura Palace
    200+
    [EK & ED] [Navigation] Lower Roshamuul Softcore

  3. #3
    Moderator Raphael's Avatar
    Join Date
    Dec 2013
    Location
    raphseller.com
    Posts
    2,441
    Reputation
    309
    Rep Power
    28
    Very good, has picture?

  4. #4
    Moderator RoxZin xD's Avatar
    Join Date
    Dec 2013
    Location
    Rio de Janeiro
    Posts
    4,914
    Reputation
    109
    Rep Power
    31
    Leo das gatas mitando!



    Troubled Animals Quest [100+]
    ALL
    Feyrist Animals Surface [160+]
    RP
    Feyrist Silencers Underground X1 [180+]
    RP | EK
    Feyrist Silencers Underground X2 [200+]
    RP | EK
    Feyrist Silencers Surface [210+]
    RP | EK
    Rathleton Sewers [240+]
    RP
    Glooth Fairy [350+]
    ED/MS
    Hardcore Draken Walls [400+]
    EK

  5. #5
    Moderator mistgun's Avatar
    Join Date
    Dec 2013
    Location
    Lodz, Poland
    Posts
    1,821
    Reputation
    220
    Rep Power
    26
    very well! such a great piece of code

  6. #6
    Moderator SuNe's Avatar
    Join Date
    Dec 2013
    Location
    Sweden
    Posts
    2,880
    Reputation
    186
    Rep Power
    27
    Pic or did not happend!
    กิิิิิิิิิิิิิิิิิิิิกิิิิิิิิิิิิิิิิิิิิกิิิิิิิ ิิิิิิิิิิิิิกิิิิิิิิิิิิิิิิิิิิกิิิิิิิิิิิิิิิ ิิิิิกิิิิิิิิิิิิิิิิิิิิกิิิิิิิิิิิิิิิิิิิิกิิ ิิิิิิิิิิิิิิิิิิกิิิิิิิิิิิิิิิิิิิิกิิิิิิิิิิ ิิิิิิิิิิกิิิิิิิิิิิิิิิิิิิิกิิิิิิิิิิิิิิิิิิ ิิกิิิิิิิิิิิิิิิิิิิิกิิิิิิิิิิิิิิิิิิิิกิิิิิ ิิิิิิิิิิิิิิิกิิิิิิิิิิิิิิิิิิิิกิิิิิิิิิิิิิ ิิิิิิิกิิิิิิิิิิิิิิิิิิิิกิิิิิิิิิิิิิิิิิิิิก ิิิิิิิิิิิิิิิิิิิิกิิิิิิิิิิิิิิิิิิิิกิิิิิิิิ ิิิิิิิิิิิิกิิิิิิิิิิิิิิิิิิิิกิิิิิิิิิิิิิิิิ ิิิิกิิิิิิิิิิิิิิิิิิิิกิิิิิิิิิิิิิิิิิิิิกิิิ ิิิิิิิิิิิิิิิิิกิิิิิิิิิิิิิิิิิิิิกิิิิิิิิิิิ ิิิิิิิิิกิิิิิิิิิิิิิิิิิิิิกิิิิิิิิิิิิิิิิิิิ ิกิิิิิิิิิิิิิิิิิิิิกิิิิิิิิิิิิิิิิิิิิกิิิิิิ ิิิิิิิิิิิิิิกิิิิิิิิิิิิิิิิิิิิกิิิิิิิิิิิิิิ ิิิิิิกิิิิิิิิิิิิิิิิิิิิกิิิิิิิิิิิิิิิิิิิิกิ ิิิิิิิิิิิิิิิิิิิกิิิิิิิิิิิิิิิิิิิิกิิิิิิิิิ ิิิิิิิิิิิกิิิิิิิิิิิิิิิิิิิิกิิิิิิิิิิิิิิิิิ ิิิกิิิิิิิิิิิิิิิิิิิิกิิิิิิิิิิิิิิิิิิิิกิิิิ ิิิิิิิิิิิิิิิิกิิิิิิิิิิิิิิิิิิิิกิิิิิิิิิิิิ ิิิิิิิิ

  7. #7
    Free User denismpz's Avatar
    Join Date
    Jun 2014
    Posts
    64
    Reputation
    7
    Rep Power
    0
    Pic !!!

  8. #8
    Free User albino's Avatar
    Join Date
    Apr 2014
    Location
    Brazil
    Posts
    183
    Reputation
    27
    Rep Power
    21
    It's the one I asked??? =ddddddddddddd

  9. #9
    Moderator Leonardo's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    758
    Reputation
    77
    Rep Power
    22
    Added a picture of it, however it doesn't show my cursor.

    Code was messed up (thanks @Garkstal), download again please.

  10. #10
    Free User albino's Avatar
    Join Date
    Apr 2014
    Location
    Brazil
    Posts
    183
    Reputation
    27
    Rep Power
    21
    It works great.
    The only problem I have is that I don't use my cliente maximized, I split it half-screen, and that HUD won't work this way. Anything I can do to make it work?


    O único problema que estou tendo é que eu não uso a janela do tibia maximizada, eu divido ela metade do monitor, e desse jeito o HUD não aparece. Tem jeito de fazer funcionar?

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •