adrianoswatt

TextInMap [Transition]

Jan 27th, 2017
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.13 KB | None | 0 0
  1. -- ########################################################
  2. -- #####          Name: Adriano Swatt'                #####
  3. -- #####              Version: 1.0                    #####
  4. -- ########################################################
  5. -- #####        Developed by Adriano Swatt'           #####
  6. -- #####     Contact: [email protected]        #####
  7. -- #####       TEXTO INGAME ANIMADO BY SWATT          #####
  8. -- ########################################################
  9.   -- [[ <- 15 sqms -> ]] -- POR -- [[ /\ 6 sqms \/ ]] --
  10. local cfg = {
  11.     effect = 43, -- Magic Effect to Text [Efeito das Letras]
  12.     columns = 15, -- Número de Colunas [Sqms na horizontal]
  13.     delay = 15, -- Effect Delay [Montando Texto / Transition]
  14.     interval = 1000, -- Text [Entre Um Texto e Outro]
  15. }
  16.  
  17. local text = {
  18.     [1] = { -- 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15
  19.         [1] = {x, 0, 0, 0, 0, x, 0, 0, x, x, 0, 0, x, x, x},
  20.         [2] = {x, 0, 0, 0, x, 0, x, 0, x, 0, x, 0, 0, 0, x},
  21.         [3] = {x, 0, 0, 0, x, 0, x, 0, x, 0, x, 0, 0, x, 0},
  22.         [4] = {x, 0, 0, 0, x, x, x, 0, x, x, 0, 0, 0, x, 0},
  23.         [5] = {x, 0, 0, 0, x, 0, x, 0, x, 0, x, 0, x, 0, 0},
  24.         [6] = {x, x, x, 0, x, 0, x, 0, x, x, 0, 0, x, x, x}
  25.         },
  26.    
  27.     [2] = {
  28.         [1] = {x, x, 0, 0, x, x, x, 0, x, x, x, 0, x, x, x},
  29.         [2] = {x, 0, x, 0, x, 0, 0, 0, 0, x, 0, 0, x, 0, x},
  30.         [3] = {x, x, x, 0, x, x, x, 0, 0, x, 0, 0, x, 0, x},
  31.         [4] = {x, 0, x, 0, x, 0, 0, 0, 0, x, 0, 0, x, x, x},
  32.         [5] = {x, 0, x, 0, x, 0, 0, 0, 0, x, 0, 0, x, 0, x},
  33.         [6] = {x, x, 0, 0, x, x, x, 0, 0, x, 0, 0, x, 0, x}
  34.         },
  35.  
  36.     [3] = {
  37.         [1] = {x, x, x, x, x, x, x, 0, x, x, x, x, x, x, x},
  38.         [2] = {x, 0, 0, 0, 0, 0, 0, x, 0, 0, 0, 0, 0, 0, x},
  39.         [3] = {x, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, x},
  40.         [4] = {x, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, x},
  41.         [5] = {x, 0, 0, 0, 0, 0, 0, x, 0, 0, 0, 0, 0, 0, x},
  42.         [6] = {x, x, x, x, x, x, x, 0, x, x, x, x, x, x, x}
  43.         },
  44.        
  45.     [4] = {
  46.         [1] = {x, x, 0, 0, x, x, x, 0, x, x, x, 0, x, x, x},
  47.         [2] = {x, 0, x, 0, x, 0, 0, 0, 0, x, 0, 0, x, 0, x},
  48.         [3] = {x, x, x, 0, x, x, x, 0, 0, x, 0, 0, x, 0, x},
  49.         [4] = {x, 0, x, 0, x, 0, 0, 0, 0, x, 0, 0, x, x, x},
  50.         [5] = {x, 0, x, 0, x, 0, 0, 0, 0, x, 0, 0, x, 0, x},
  51.         [6] = {x, x, 0, 0, x, x, x, 0, 0, x, 0, 0, x, 0, x}
  52.         },
  53.        
  54.     [5] = {
  55.         [1] = {x, x, x, 0, 0, x, x, 0, x, x, 0, 0, x, x, x},
  56.         [2] = {x, 0, 0, 0, x, 0, 0, x, 0, 0, x, 0, 0, 0, x},
  57.         [3] = {x, 0, 0, 0, x, 0, 0, 0, 0, 0, x, 0, 0, 0, x},
  58.         [4] = {x, 0, 0, 0, 0, x, 0, 0, 0, x, 0, 0, 0, 0, x},
  59.         [5] = {x, 0, 0, 0, 0, 0, x, 0, x, 0, 0, 0, 0, 0, x},
  60.         [6] = {x, x, x, 0, 0, 0, 0, x, 0, 0, 0, 0, x, x, x}
  61.         },
  62.  
  63. }
  64.  
  65. function onSay(cid, words, param)
  66.     myPos = getCreaturePos(cid)
  67.     centerPos = {x=myPos.x, y=myPos.y+2, z=myPos.z}
  68.     local effPosY = {
  69.         [1] = 2,
  70.         [2] = 1,
  71.         [3] = 0,
  72.         [4] = 1,
  73.         [5] = 2,
  74.         [6] = 3,
  75.     }  
  76.     local effPosX = {
  77.         [1] = 7,
  78.         [2] = 6,
  79.         [3] = 5,
  80.         [4] = 4,
  81.         [5] = 3,
  82.         [6] = 2,
  83.         [7] = 1,
  84.         [8] = 0,
  85.         [9] = 1,
  86.         [10] = 2,
  87.         [11] = 3,
  88.         [12] = 4,
  89.         [13] = 5,
  90.         [14] = 6,
  91.         [15] = 7,
  92.     }
  93.    
  94.     for w = 1, #text do -- W = 1, Quantidade de Textos
  95.         for a = 1, #text[1] do -- A = 1, Quantidade de Linhas Y
  96.             for b = 1, cfg.columns do -- B = 1, Quantidade de Colunas X
  97.                 var = text[w][a][b]
  98.                 if tostring(var) == "nil" then
  99.                     addEvent(function()
  100.                         if a <= 2 then
  101.                             if b <= 7 then
  102.                                 local newPosFinal = {x=centerPos.x-effPosX[b], y=centerPos.y-effPosY[a], z=centerPos.z}
  103.                                 addEvent(doSendMagicEffect, (cfg.delay * b), newPosFinal, cfg.effect)
  104.                             elseif b == 8 then
  105.                                 local newPosFinal = {x=centerPos.x, y=centerPos.y-effPosY[a], z=centerPos.z}
  106.                                 addEvent(doSendMagicEffect, (cfg.delay * b), newPosFinal, cfg.effect)
  107.                             elseif b >= 9 then
  108.                                 local newPosFinal = {x=centerPos.x+effPosX[b], y=centerPos.y-effPosY[a], z=centerPos.z}
  109.                                 addEvent(doSendMagicEffect, (cfg.delay * b), newPosFinal, cfg.effect)
  110.                             end
  111.  
  112.                         elseif a == 3 then
  113.                             if b <= 7 then
  114.                                 local newPosFinal = {x=centerPos.x-effPosX[b], y=centerPos.y, z=centerPos.z}
  115.                                 addEvent(doSendMagicEffect, (cfg.delay * b), newPosFinal, cfg.effect)
  116.                             elseif b == 8 then
  117.                                 local newPosFinal = {x=centerPos.x, y=centerPos.y, z=centerPos.z}
  118.                                 addEvent(doSendMagicEffect, (cfg.delay * b), newPosFinal, cfg.effect)
  119.                             elseif b >= 9 then
  120.                                 local newPosFinal = {x=centerPos.x+effPosX[b], y=centerPos.y, z=centerPos.z}
  121.                                 addEvent(doSendMagicEffect, (cfg.delay * b), newPosFinal, cfg.effect)
  122.                             end
  123.                            
  124.                         elseif a >= 4 then
  125.                             if b <= 7 then
  126.                                 local newPosFinal = {x=centerPos.x-effPosX[b], y=centerPos.y+effPosY[a], z=centerPos.z}
  127.                                 addEvent(doSendMagicEffect, (cfg.delay * b), newPosFinal, cfg.effect)
  128.                             elseif b == 8 then
  129.                                 local newPosFinal = {x=centerPos.x, y=centerPos.y+effPosY[a], z=centerPos.z}
  130.                                 addEvent(doSendMagicEffect, (cfg.delay * b), newPosFinal, cfg.effect)
  131.                             elseif b >= 9 then
  132.                                 local newPosFinal = {x=centerPos.x+effPosX[b], y=centerPos.y+effPosY[a], z=centerPos.z}
  133.                                 addEvent(doSendMagicEffect, (cfg.delay * b), newPosFinal, cfg.effect)
  134.                             end
  135.                         end
  136.                     end, cfg.interval * w)
  137.                 end
  138.             end
  139.         end
  140.     end
  141. return true
  142. end
Advertisement
Add Comment
Please, Sign In to add comment