adrianoswatt

PrivateWar Sys LIB

May 17th, 2017
567
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 18.15 KB | None | 0 0
  1. -- ########################################################
  2. -- #####          Name: Adriano Swatt'                #####
  3. -- #####              Version: 1.0                    #####
  4. -- ########################################################
  5. -- #####        Developed by Adriano Swatt'           #####
  6. -- #####     Contact: [email protected]        #####
  7. -- #####       PRIVATE WAR SYSTEM BY SWATT'           #####
  8. -- ########################################################
  9.  
  10. -- [[ EXPLAIN // EXPLICAÇÃO // COMO CONFIGURAR ]] --
  11. -- TeamBalanced = Se os times precisam de quantidade iguais de players [true/false]
  12. -- minLevel = Level Minimo para o Evento
  13. -- minPlayers = Quantidade Minima de Player, valor ou 0 para n?checar
  14. -- timeLimit = Tempo maximo para concluir o evento ou ser?expulsos
  15. -- enterPos = Coordenada Inicial e Final da Sala de Entrada do Evento
  16. -- basePos = Posição da base do time, ao morrer ser?eleportado para ela.
  17. -- leverPos = Posição da alavanca.
  18. -- startDelay = É o tempo, em segundos, de confirmação para puxar ambas alavancas.
  19. -- warPos = Posição Inicial e Posição Final do Arena da WAR.
  20.     -- DICA:
  21.         --
  22.     -- OBSERVA?O: Abaixo do "Control Configs" n?precisa configurar.
  23. _PRIVATE_WAR_SYSTEM_CONFIG = {
  24.     coinID = 2160,
  25.     startDelay = 10,
  26.     TeamBalanced = true,
  27.     minLevel = 50,
  28.     minPlayers = 1,
  29.     timeLimit = 1, -- Em minutos
  30.     winMSG = "Congratulations, your team win the tourney.",
  31.     loseMSG = "Sorry, your team don't have a good war.",
  32.    
  33.     warPos = {from = {x=32300, y=31768, z=7}, to = {x=32307, y=31775, z=7}},
  34.     teamConfig = {
  35.         [1] = { -- blueTeam
  36.             tname = "Blue",
  37.             color = 87,
  38.             coinPos = {x=32303, y=31771, z=7},
  39.             leverPos = {x=32303, y=31772, z=7},
  40.             lever = {on = 9825, off = 9826}, -- ID da Alavanca
  41.             enterPos = {from = {x=32300, y=31770, z=7}, to = {x=32303, y=31773, z=7}},
  42.             basePos = {x=32302, y=31768, z=7},
  43.            
  44.             gsto_kills = 23552, --[[Blue Kills // Don't Change]]--
  45.         },
  46.         [2] = { -- redTeam
  47.             tname = "Red",
  48.             color = 94,
  49.             coinPos = {x=32304, y=31771, z=7},
  50.             leverPos = {x=32304, y=31772, z=7},
  51.             lever = {on = 9826, off = 9825}, -- ID da Alavanca
  52.             enterPos = {from = {x=32304, y=31770, z=7}, to = {x=32307, y=31773, z=7}},
  53.             basePos = {x=32305, y=31768, z=7},
  54.            
  55.             gsto_kills = 23553, --[[Red Kills // Don't Change]]--
  56.         }
  57.     },
  58.     --[[ Control Configs // Don't Need Change ]]--
  59.     gbet_sto = 23550, --[[betValue // Player In Event]]--
  60.     glead_sto = 23551, --[[Leaders Name ";"]]--
  61.     gtime_sto = 23554, --[[Fix Bug Event End]]--
  62. }
  63.  
  64. --[[ Checa Se Time Est?quilibrado ]]--
  65. function checkPrivWarTeams(cid)
  66.     cfg = _PRIVATE_WAR_SYSTEM_CONFIG
  67.     if not cfg.TeamBalanced then
  68.         doPrivWarBlock(cid, true)
  69.         return true
  70.     else
  71.         blueTeamCount = 0
  72.         redTeamCount = 0
  73.         for xx = cfg.teamConfig[1].enterPos.from.x, cfg.teamConfig[2].enterPos.to.x do
  74.             for yy = cfg.teamConfig[1].enterPos.from.y, cfg.teamConfig[2].enterPos.to.y do
  75.                 get_top = getTopCreature({x=xx, y=yy, z=cfg.teamConfig[1].enterPos.from.z}).uid
  76.                 if get_top > 0 then
  77.                     -- if isPlayer(get_top) and getPlayerLevel(get_top) >= cfg.minLevel then
  78.                         if xx <= cfg.teamConfig[1].leverPos.x then
  79.                             blueTeamCount = blueTeamCount + 1
  80.                         else
  81.                             redTeamCount = redTeamCount + 1
  82.                         end
  83.                     -- end
  84.                 end
  85.             end
  86.         end    
  87.         if redTeamCount == blueTeamCount then
  88.             if redTeamCount >= cfg.minPlayers then
  89.                 doPrivWarBlock(cid, true)
  90.                 return true
  91.             else
  92.                 return false
  93.             end
  94.         else
  95.             return false
  96.         end    
  97.     end
  98. end
  99.  
  100. --[[ Block Players // Evitar Bugs ]]--
  101. function doPrivWarBlock(cid, status)
  102.     cfg = _PRIVATE_WAR_SYSTEM_CONFIG
  103.     for xx = cfg.teamConfig[1].enterPos.from.x, cfg.teamConfig[2].enterPos.to.x do
  104.         for yy = cfg.teamConfig[1].enterPos.from.y, cfg.teamConfig[2].enterPos.to.y do
  105.             get_top = getTopCreature({x=xx, y=yy, z=cfg.teamConfig[1].enterPos.from.z}).uid
  106.             if get_top > 0 then
  107.                 -- if isPlayer(get_top) and getPlayerLevel(get_top) >= cfg.minLevel then
  108.                     mayNotMove(get_top, status)
  109.                     if status then
  110.                         if not getCreatureCondition(get_top, CONDITION_OUTFIT) then
  111.                             local infight = createConditionObject(CONDITION_INFIGHT)
  112.                             setConditionParam(infight, CONDITION_PARAM_TICKS, cfg.startDelay * 1000)
  113.                             --[[ Setando Outfit ]]--
  114.                             outfit = getCreatureOutfit(get_top)
  115.                             if xx <= cfg.teamConfig[1].leverPos.x then
  116.                                 --[[ Blue Team ]]--
  117.                                 doSendMagicEffect(getThingPos(get_top), 12)
  118.                                 local condition = createConditionObject(CONDITION_OUTFIT)
  119.                                 setConditionParam(condition, CONDITION_PARAM_TICKS, -1)
  120.                                 addOutfitCondition(condition, {lookType = outfit.lookType, lookHead = cfg.teamConfig[1].color, lookBody = cfg.teamConfig[1].color, lookLegs = cfg.teamConfig[1].color, lookFeet = cfg.teamConfig[1].color, lookAddons = outfit.lookAddons})
  121.                                 doAddCondition(get_top, condition)
  122.                             else
  123.                                 --[[ Red Team ]]--
  124.                                 doSendMagicEffect(getThingPos(get_top), 13)
  125.                                 local condition = createConditionObject(CONDITION_OUTFIT)
  126.                                 setConditionParam(condition, CONDITION_PARAM_TICKS, -1)
  127.                                 addOutfitCondition(condition, {lookType = outfit.lookType, lookHead = cfg.teamConfig[2].color, lookBody = cfg.teamConfig[2].color, lookLegs = cfg.teamConfig[2].color, lookFeet = cfg.teamConfig[2].color, lookAddons = outfit.lookAddons})
  128.                                 doAddCondition(get_top, condition)
  129.                             end
  130.                             doAddCondition(get_top, infight)
  131.                         end
  132.                     else
  133.                         doRemoveCondition(get_top, CONDITION_OUTFIT)
  134.                         doRemoveCondition(get_top, CONDITION_INFIGHT)
  135.                     end
  136.                 -- end
  137.             end
  138.         end
  139.     end
  140. end
  141.  
  142. --[[ Checa Aposta dos Times ]]--
  143. function checkPrivWarBet(cid)
  144.     cfg = _PRIVATE_WAR_SYSTEM_CONFIG
  145.     --[[ Blue Team Check ]]--
  146.     blueCoinPos = cfg.teamConfig[1].coinPos
  147.     blueAmount = getTileItemById(blueCoinPos, cfg.coinID).type
  148.     --[[ Red Team Check ]]--
  149.     redCoinPos = cfg.teamConfig[2].coinPos
  150.     redAmount = getTileItemById(redCoinPos, cfg.coinID).type
  151.     if blueAmount == redAmount and redAmount > 0 then
  152.         return blueAmount
  153.     else
  154.         return false
  155.     end
  156. end
  157.  
  158. --[[ Checa Qual Time Puxou ]]--
  159. function getPrivWarTeam(cid)
  160.     teamID = 0
  161.     pPos = getCreaturePos(cid)
  162.     if pPos.x == cfg.teamConfig[1].leverPos.x-1 and pPos.y == cfg.teamConfig[1].leverPos.y then
  163.         teamID = 1
  164.     else
  165.         teamID = 2
  166.     end
  167.     return teamID
  168. end
  169.  
  170. --[[ Checa SE J?uxaram para Ativar Evento ]]--
  171. function getAlreadyLeverPrivWar(cid, teamid)
  172.     if teamid == 1 then teamid = 2 else teamid = 1 end
  173.     rlever = getTileItemById(cfg.teamConfig[teamid].leverPos, cfg.teamConfig[teamid].lever.on).uid
  174.     if rlever > 0 then
  175.         return true
  176.     else
  177.         doSendMagicEffect(cfg.teamConfig[teamid].leverPos, 55)
  178.         doSendAnimatedText(cfg.teamConfig[teamid].leverPos, "PUSH HERE", COLOR_WHITE)
  179.         return false
  180.     end
  181. end
  182.  
  183. --[[ Active The First Push Lever ]]--
  184. function doChanceLeverPrivWar(cid, leveruid, teamid)
  185.     cfg = _PRIVATE_WAR_SYSTEM_CONFIG
  186.     doTransformItem(leveruid, cfg.teamConfig[teamid].lever.on)
  187.     doSendMagicEffect(cfg.teamConfig[1].coinPos, 27)
  188.     doCreateItem(8047, 1, cfg.teamConfig[1].coinPos)
  189.     doSendMagicEffect(cfg.teamConfig[2].coinPos, 27)
  190.     doCreateItem(8047, 1, cfg.teamConfig[2].coinPos)
  191.     --[[ Securin' Thinks ]]--
  192.     setGlobalStorageValue(cfg.glead_sto, getCreatureName(cid))
  193.     addEvent(function()
  194.         if getGlobalStorageValue(cfg.gbet_sto) == -1 then
  195.             rlever = getTileItemById(cfg.teamConfig[teamid].leverPos, cfg.teamConfig[teamid].lever.on).uid
  196.             doRemoveItem(getTileItemById(cfg.teamConfig[1].coinPos, 8047).uid, 1)
  197.             doRemoveItem(getTileItemById(cfg.teamConfig[2].coinPos, 8047).uid, 1)
  198.             doTransformItem(rlever, cfg.teamConfig[teamid].lever.off)
  199.             doPrivWarBlock(cid, false)
  200.             setGlobalStorageValue(cfg.glead_sto, -1)
  201.             if teamid == 2 then overid = 1 else overid = 2 end
  202.             doSendAnimatedText(cfg.teamConfig[overid].leverPos, "TIME IS OVER", COLOR_YELLOW)
  203.         end
  204.     end, cfg.startDelay * 1000)
  205. end
  206.  
  207. --[[ Startin' The Event ]]--
  208. function doPrivWarStart(cid, betvalue, teamid)
  209.     cfg = _PRIVATE_WAR_SYSTEM_CONFIG
  210.     for xx = cfg.teamConfig[1].enterPos.from.x, cfg.teamConfig[2].enterPos.to.x do
  211.         for yy = cfg.teamConfig[1].enterPos.from.y, cfg.teamConfig[2].enterPos.to.y do
  212.             get_top = getTopCreature({x=xx, y=yy, z=cfg.teamConfig[1].enterPos.from.z}).uid
  213.             if get_top > 0 then
  214.                 if getCreatureNoMove(get_top) then
  215.                     mayNotMove(get_top, false)
  216.                     if xx <= cfg.teamConfig[1].leverPos.x then
  217.                         --[[ Blue Team ]]--
  218.                         setPlayerStorageValue(get_top, cfg.gbet_sto, 1)
  219.                         doSendMagicEffect(getThingPos(get_top), 12)
  220.                         doTeleportThing(get_top, cfg.teamConfig[1].basePos)
  221.                     else
  222.                         --[[ Red Team ]]--
  223.                         setPlayerStorageValue(get_top, cfg.gbet_sto, 2)
  224.                         doSendMagicEffect(getThingPos(get_top), 13)
  225.                         doTeleportThing(get_top, cfg.teamConfig[2].basePos)
  226.                     end
  227.                     doPlayerSendTextMessage(get_top, MESSAGE_STATUS_CONSOLE_BLUE, "A batalha come?, ambos times tem "..cfg.timeLimit.." minutos para juntar "..betvalue.." frags e ganhar a luta.")
  228.                 end
  229.             end
  230.         end
  231.     end
  232.     setGlobalStorageValue(cfg.gbet_sto, betvalue)
  233.     setGlobalStorageValue(cfg.teamConfig[1].gsto_kills, 0)
  234.     setGlobalStorageValue(cfg.teamConfig[2].gsto_kills, 0)
  235.    
  236.     if teamid == 2 then leaders = ""..getGlobalStorageValue(cfg.glead_sto)..";"..getCreatureName(cid).."" else leaders = ""..getCreatureName(cid)..";"..getGlobalStorageValue(cfg.glead_sto).."" end
  237.     setGlobalStorageValue(cfg.glead_sto, leaders)
  238.     --[[ BET Remove ]]--
  239.     for f = 1, 2 do
  240.         coin = getTileItemById(cfg.teamConfig[f].coinPos, cfg.coinID)
  241.         spark = getTileItemById(cfg.teamConfig[f].coinPos, 8047)
  242.         if coin.uid > 0 then
  243.             doRemoveItem(coin.uid, coin.type)
  244.         end
  245.         if spark.uid > 0 then
  246.             doRemoveItem(spark.uid, 1)
  247.         end
  248.     end
  249.    
  250.     checkTempo = (os.time() + (cfg.timeLimit * 60))
  251.     print(""..os.time().." + "..(cfg.timeLimit * 60).." = "..checkTempo.."")
  252.     setGlobalStorageValue(cfg.gtime_sto, checkTempo)
  253.     addEvent(doPrivWarEnd, cfg.timeLimit * 60 * 1000, cid, 0, false, checkTempo)
  254. return true
  255. end
  256.  
  257. --[[ Endin' The Event // done = false if time is over ]]--
  258. function doPrivWarEnd(cid, teamwin, done, checkTime)
  259.     cfg = _PRIVATE_WAR_SYSTEM_CONFIG
  260.     ctrl = 0
  261.     if done then
  262.         print("Mataram pra caralho e ganhou o time "..teamwin..".")
  263.         --[[ Removin' All Players from Arena -- Kill Objetive DONE ]]--
  264.         for xx = cfg.warPos.from.x, cfg.warPos.to.x do
  265.             for yy = cfg.warPos.from.y, cfg.warPos.to.y do
  266.                 for zz = cfg.warPos.from.z, cfg.warPos.to.z do
  267.                     get_top = getTopCreature({x=xx, y=yy, z=zz}).uid
  268.                     if get_top > 0 then
  269.                         if isPlayer(get_top) then
  270.                             get_team = getPlayerStorageValue(get_top, cfg.gbet_sto)
  271.                             betValue = getGlobalStorageValue(cfg.gbet_sto)
  272.                             local string = tostring(getGlobalStorageValue(cfg.glead_sto))
  273.                             local cutSto = string:explode(";")
  274.                             leaderWinName = ""..cutSto[teamwin]..""
  275.                             winReward = ""..getItemPluralNameById(cfg.coinID)..""
  276.                             if get_team == teamwin then
  277.                                 if getCreatureName(get_top) == leaderWinName then
  278.                                     doPlayerAddItem(get_top, cfg.coinID, (betValue*2))
  279.                                     doPlayerSendTextMessage(get_top, MESSAGE_STATUS_CONSOLE_BLUE, ""..cfg.winMSG.." [You have received "..(betValue*2).." "..winReward.." because you're the leader.]")
  280.                                 else                               
  281.                                     doPlayerSendTextMessage(get_top, MESSAGE_STATUS_CONSOLE_BLUE, ""..cfg.winMSG.." [The "..leaderWinName.." have received "..(betValue*2).." "..winReward.."]")
  282.                                 end
  283.                             else
  284.                                 doPlayerSendTextMessage(get_top, MESSAGE_STATUS_CONSOLE_RED, cfg.loseMSG)
  285.                             end
  286.                             doRemoveCondition(get_top, CONDITION_OUTFIT)
  287.                             doRemoveCondition(get_top, CONDITION_INFIGHT)
  288.                             doTeleportThing(get_top, getTownTemplePosition(getPlayerTown(get_top)))
  289.                             doSendMagicEffect(getThingPos(get_top), 10)
  290.                         else
  291.                             doRemoveCreature(get_top)
  292.                         end
  293.                     end
  294.                     ctrl = ctrl + 1
  295.                 end
  296.             end
  297.         end
  298.     else
  299.         if checkTime ~= getGlobalStorageValue(cfg.gtime_sto) then
  300.             print("Evento j?inalizado cuza1.")
  301.         return true
  302.         end
  303.         --[[ Removin' All Players from Arena -- TIME IS OVER ]]--
  304.         getTeam1 = getGlobalStorageValue(cfg.teamConfig[1].gsto_kills)
  305.         getTeam2 = getGlobalStorageValue(cfg.teamConfig[2].gsto_kills)
  306.         if getTeam1 == getTeam2 then
  307.             --[[ Empate ]]--
  308.             print("Empatou sapoorra ai.")
  309.             for xx = cfg.warPos.from.x, cfg.warPos.to.x do
  310.                 for yy = cfg.warPos.from.y, cfg.warPos.to.y do
  311.                     for zz = cfg.warPos.from.z, cfg.warPos.to.z do
  312.                         get_top = getTopCreature({x=xx, y=yy, z=zz}).uid
  313.                         if get_top > 0 then
  314.                             if isPlayer(get_top) then
  315.                                 get_team = getPlayerStorageValue(get_top, cfg.gbet_sto)
  316.                                 betValue = getGlobalStorageValue(cfg.gbet_sto)
  317.                                 local string = tostring(getGlobalStorageValue(cfg.glead_sto))
  318.                                 local cutSto = string:explode(";")
  319.                                 leaderWinName1, leaderWinName2 = ""..cutSto[1].."", ""..cutSto[2]..""
  320.                                 winReward = ""..getItemPluralNameById(cfg.coinID)..""
  321.                                 if get_team == 1 then
  322.                                     if getCreatureName(get_top) == leaderWinName1 then
  323.                                         doPlayerAddItem(get_top, cfg.coinID, betValue)
  324.                                         doPlayerSendTextMessage(get_top, MESSAGE_STATUS_CONSOLE_BLUE, "Os times empataram nos frags e voc?omo leader recebe o valor da aposta ["..betValue.." "..winReward.."]")
  325.                                     else                               
  326.                                         doPlayerSendTextMessage(get_top, MESSAGE_STATUS_CONSOLE_BLUE, "Os times empataram nos frags e o leader recebeu o valor da aposta [The "..leaderWinName1.." have received "..betValue.." "..winReward.."]")
  327.                                     end
  328.                                 else
  329.                                     if getCreatureName(get_top) == leaderWinName2 then
  330.                                         doPlayerAddItem(get_top, cfg.coinID, betValue)
  331.                                         doPlayerSendTextMessage(get_top, MESSAGE_STATUS_CONSOLE_BLUE, "Os times empataram nos frags e voc?omo leader recebe o valor da aposta ["..betValue.." "..winReward.."]")
  332.                                     else                               
  333.                                         doPlayerSendTextMessage(get_top, MESSAGE_STATUS_CONSOLE_BLUE, "Os times empataram nos frags e o leader recebeu o valor da aposta [The "..leaderWinName2.." have received "..betValue.." "..winReward.."]")
  334.                                     end
  335.                                 end
  336.                                 doRemoveCondition(get_top, CONDITION_OUTFIT)
  337.                                 doRemoveCondition(get_top, CONDITION_INFIGHT)
  338.                                 doTeleportThing(get_top, getTownTemplePosition(getPlayerTown(get_top)))
  339.                                 doSendMagicEffect(getThingPos(get_top), 10)
  340.                             else
  341.                                 doRemoveCreature(get_top)
  342.                             end
  343.                         end
  344.                         ctrl = ctrl + 1
  345.                     end
  346.                 end
  347.             end
  348.         else
  349.             --[[ Team Win per Time ]]--
  350.             if getTeam1 > getTeam2 then teamwin = 1 else teamwin = 2 end
  351.             print("Tempo acabou e quem ganhou foi "..teamwin..".")
  352.             for xx = cfg.warPos.from.x, cfg.warPos.to.x do
  353.                 for yy = cfg.warPos.from.y, cfg.warPos.to.y do
  354.                     for zz = cfg.warPos.from.z, cfg.warPos.to.z do
  355.                         get_top = getTopCreature({x=xx, y=yy, z=zz}).uid
  356.                         if get_top > 0 then
  357.                             if isPlayer(get_top) then
  358.                                 get_team = getPlayerStorageValue(get_top, cfg.gbet_sto)
  359.                                 betValue = getGlobalStorageValue(cfg.gbet_sto)
  360.                                 local string = tostring(getGlobalStorageValue(cfg.glead_sto))
  361.                                 local cutSto = string:explode(";")
  362.                                 leaderWinName = ""..cutSto[teamwin]..""
  363.                                 winReward = ""..getItemPluralNameById(cfg.coinID)..""
  364.                                 if get_team == teamwin then
  365.                                     if getCreatureName(get_top) == leaderWinName then
  366.                                         doPlayerAddItem(get_top, cfg.coinID, (betValue*2))
  367.                                         doPlayerSendTextMessage(get_top, MESSAGE_STATUS_CONSOLE_BLUE, "[Time is Over] "..cfg.winMSG.." [You have received "..(betValue*2).." "..winReward.." because you're the leader.]")
  368.                                     else                               
  369.                                         doPlayerSendTextMessage(get_top, MESSAGE_STATUS_CONSOLE_BLUE, "[Time is Over] "..cfg.winMSG.." [The "..leaderWinName.." have received "..(betValue*2).." "..winReward.."]")
  370.                                     end
  371.                                 else
  372.                                     doPlayerSendTextMessage(get_top, MESSAGE_STATUS_CONSOLE_RED, "[Time is Over] "..cfg.loseMSG.."")
  373.                                 end
  374.                                 doRemoveCondition(get_top, CONDITION_OUTFIT)
  375.                                 doRemoveCondition(get_top, CONDITION_INFIGHT)
  376.                                 doTeleportThing(get_top, getTownTemplePosition(getPlayerTown(get_top)))
  377.                                 doSendMagicEffect(getThingPos(get_top), 10)
  378.                             else
  379.                                 doRemoveCreature(get_top)
  380.                             end
  381.                         end
  382.                         ctrl = ctrl + 1
  383.                     end
  384.                 end
  385.             end
  386.         end
  387.     end
  388.     addEvent(function()
  389.         if ctrl > 0 then
  390.             --[[ Resetin' Levers ]]--
  391.             blever = getTileItemById(cfg.teamConfig[1].leverPos, cfg.teamConfig[1].lever.on).uid
  392.             rlever = getTileItemById(cfg.teamConfig[2].leverPos, cfg.teamConfig[2].lever.on).uid
  393.             if blever > 0 then
  394.                 doTransformItem(blever, cfg.teamConfig[1].lever.off)
  395.             end
  396.             if rlever > 0 then
  397.                 doTransformItem(rlever, cfg.teamConfig[2].lever.off)
  398.             end
  399.             --[[ Resetin' Global Storages ]]--
  400.             setGlobalStorageValue(cfg.gbet_sto, -1)
  401.             setGlobalStorageValue(cfg.glead_sto, -1)
  402.             setGlobalStorageValue(cfg.teamConfig[1].gsto_kills, 0)
  403.             setGlobalStorageValue(cfg.teamConfig[2].gsto_kills, 0)
  404.             setGlobalStorageValue(cfg.gtime_sto, 0)
  405.         end
  406.     end, 5 * 1000)
  407. end
  408.  
  409. function doBroadcastPrivWar(killer, death, team)
  410.     cfg = _PRIVATE_WAR_SYSTEM_CONFIG
  411.     for xx = cfg.warPos.from.x, cfg.warPos.to.x do
  412.         for yy = cfg.warPos.from.y, cfg.warPos.to.y do
  413.             for zz = cfg.warPos.from.z, cfg.warPos.to.z do
  414.                 get_top = getTopCreature({x=xx, y=yy, z=zz}).uid
  415.                 if get_top > 0 then
  416.                     get_team = getPlayerStorageValue(get_top, cfg.gbet_sto)
  417.                     if get_team == team then
  418.                         if team == 1 then nteam = 2 else nteam = 1 end
  419.                         doPlayerSendTextMessage(get_top, MESSAGE_STATUS_CONSOLE_BLUE, "The "..getCreatureName(killer).." ["..cfg.teamConfig[team].tname.." Team] have killed "..getCreatureName(death).." ["..cfg.teamConfig[nteam].tname.." Team]. \n ?Score: ["..cfg.teamConfig[1].tname.." Team ("..getGlobalStorageValue(cfg.teamConfig[1].gsto_kills).." Kills)  Vs.  "..cfg.teamConfig[2].tname.." Team ("..getGlobalStorageValue(cfg.teamConfig[2].gsto_kills).." Kills)]")
  420.                     else
  421.                         doPlayerSendTextMessage(get_top, MESSAGE_STATUS_CONSOLE_RED, "The "..getCreatureName(killer).." ["..cfg.teamConfig[team].tname.." Team] have killed "..getCreatureName(death).." ["..cfg.teamConfig[nteam].tname.." Team]. \n ?Score: ["..cfg.teamConfig[1].tname.." Team ("..getGlobalStorageValue(cfg.teamConfig[1].gsto_kills).." Kills)  Vs.  "..cfg.teamConfig[2].tname.." Team ("..getGlobalStorageValue(cfg.teamConfig[2].gsto_kills).." Kills)]")
  422.                     end
  423.                 end
  424.             end
  425.         end
  426.     end
  427. end
Advertisement
Add Comment
Please, Sign In to add comment