Ir para conteúdo
  • Cadastre-se

Histórico de Edições

Please note that revisions older than 15 days are pruned and will no longer show here

Não há histórico de edição para mostrar, ou este comentário foi editado por um moderador.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Conteúdo Similar

    • Por Absolute
      Fala galerinha linda do TK, vejo muita gente reclamando do battlefield do nosso amigo Vodkart, mas aqui funciona 100%, creio que seja rejeição nos TFS, mas então resolvi trazer a vocês um battlefield que venho customizando a algum tempo, o mesmo possui em alguns servidores poloneses, globalwar e cia.
       
      O Evento é um pouco modificado do que o tradicional battlefield, porém acho que ficou mais legal, é de pegar a bandeira do time inimigo, para dar um pouco mais de emoção que tal? rs.
       
      Preste atenção nos arquivos e como configurar, estarei explicando tudo passo a passo.
       
      Atenção, o comando para abrir o evento é: /battlefield 20 (o 20 é o número de participantes, no caso 10 no time vermelho e 10 no preto, coloque sempre números pares para balancear corretamente o evento)
       
      Vamos ao que interessa:
       

      Primeiramente, em data/libs crie um arquivo com o nome de battlefield.lua e adicione o seguinte dentro:
      battlefield = { storage = 201206300801, storage2 = 201206300802, tpPos = {x=32342, y=32213, z=7}, -- aonde aparecerá o teleport pos_team_1 = {x=31621,y=31860,z=7}, -- posição do team 1 (do lado direito) pos_team_2 = {x=31582,y=31860,z=7}, -- posição do team 2 (do lado esquerdo) spectors = {{x=31593,y=31853,z=6},{x=31609,y=31853,z=6},{x=31593,y=31866,z=6},{x=31609,y=31866,z=6}}, -- aonde aparecerá os espectadores (em volta do battlefield) team1Name = "Black Assassins", team2Name = "Red Barbarians", } function doBroadCastBattle(type,msg) for _, cid in pairs(getPlayersOnline()) do if getPlayerStorageValue(cid, battlefield.storage2) ~= -1 then doPlayerSendTextMessage(cid,type,msg) end end return true end function removeTp() local t = getTileItemById(battlefield.tpPos, 1387) if t then doRemoveItem(t.uid, 1) doSendMagicEffect(battlefield.tpPos, CONST_ME_POFF) end end function OpenWallBattle() local x = true local B = { [1] = {1056,{x=31601, y=31858, z=6, stackpos = 1}}, -- posição da barreira [2] = {1056,{x=31601, y=31859, z=6, stackpos = 1}}, -- posição da barreira [3] = {1056,{x=31601, y=31860, z=6, stackpos = 1}}, -- posição da barreira [4] = {1056,{x=31601, y=31861, z=6, stackpos = 1}} -- posição da barreira } for i = 1, #B do if getTileItemById(B[i][2], B[i][1]).uid == 0 then x = false end if x == true then doRemoveItem(getThingfromPos(B[i][2]).uid,1) else doCreateItem(B[i][1], 1, B[i][2]) end end end function getWinnersBattle(storage) local team = storage == 1 and battlefield.team1Name or battlefield.team2Name doBroadcastMessage("Players from team ".. team .." won the event battlefield,they received a Master Surprise Bag!") setGlobalStorageValue(battlefield.storage, -1) removeTp() OpenWallBattle() for _, cid in pairs(getPlayersOnline()) do if getPlayerStorageValue(cid, battlefield.storage2) ~= -1 then doRemoveCondition(cid, CONDITION_OUTFIT) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) if getPlayerStorageValue(cid, battlefield.storage2) == storage then doPlayerAddItem(cid,6571,1) end setPlayerStorageValue(cid, battlefield.storage2, -1) end end end Como configurar este passo;
       
       
       
      Pós o primeiro passo, crie um arquivo em actions/scripts com o nome de battlefieldAbsolute.lua e adicione o seguinte dentro:
      function onUse(cid, item, fromPosition, itemEx, toPosition) local team = getPlayerStorageValue(cid, battlefield.storage2) if (item.actionid == 45001 and team == 1) or (item.actionid == 45002 and team == 2) then getWinnersBattle(team) end return true end
      Em actions.xml, adicione as seguintes linhas:
      <action actionid="49901" event="script" value="battlefieldAbsolute.lua"/> <action actionid="45002" event="script" value="battlefieldAbsolute.lua"/> Pós o segundo passo, vá até sua pasta creaturescripts/scripts e crie um arquivo com o nome de combat.lua e adicione o seguinte:
      function onLogin(cid) if getGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage) == -1 then setGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage, 0) setGlobalStorageValue(_Lib_Battle_Info.TeamTwo.storage, 0) setGlobalStorageValue(_Lib_Battle_Info.storage_count, 0) end registerCreatureEvent(cid, "BattleTeam") registerCreatureEvent(cid, "BattleDeath") return true end function onCombat(cid, target) if isPlayer(cid) and isPlayer(target) then if getPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage) == 1 and getPlayerStorageValue(target, _Lib_Battle_Info.TeamOne.storage) == 1 then doPlayerSendCancel(cid, "You may not attack your team mates.") return false end if getPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage) == 1 and getPlayerStorageValue(target, _Lib_Battle_Info.TeamTwo.storage) == 1 then doPlayerSendCancel(cid, "You may not attack your team mates.") return false end return true end return true end function onPrepareDeath(cid, deathList, lastHitKiller, mostDamageKiller) if getPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage) >= 1 then setPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage, -1) setGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage, getGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage)-1) doRemoveCondition(cid, CONDITION_OUTFIT) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "[Battle Field] You Are Dead!") if getGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage) == 0 then getWinnersBattle(_Lib_Battle_Info.TeamTwo.storage) else doBroadCastBattle(23,"[BattleField Information] ".._Lib_Battle_Info.TeamOne.name.." "..getGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage).." VS "..getGlobalStorageValue(_Lib_Battle_Info.TeamTwo.storage).." " .._Lib_Battle_Info.TeamTwo.name) end elseif getPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage) >= 1 then setPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage, -1) setGlobalStorageValue(_Lib_Battle_Info.TeamTwo.storage, getGlobalStorageValue(_Lib_Battle_Info.TeamTwo.storage)-1) doRemoveCondition(cid, CONDITION_OUTFIT) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "[Battle Field] You Are Dead!") if getGlobalStorageValue(_Lib_Battle_Info.TeamTwo.storage) == 0 then getWinnersBattle(_Lib_Battle_Info.TeamOne.storage) else doBroadCastBattle(23,"[BattleField Information] ".._Lib_Battle_Info.TeamOne.name.." "..getGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage).." VS "..getGlobalStorageValue(_Lib_Battle_Info.TeamTwo.storage).." " .._Lib_Battle_Info.TeamTwo.name) end end return true end Ainda na mesma pasta crie outro arquivo com o nome de pdeath.lua com o seguinte conteúdo: (ATENÇÃO QUE NA MESMA PASTA SÃO 2 ARQUIVOS)
      function onPrepareDeath(cid, corpse, lastHitKiller, mostDamageKiller) if getPlayerStorageValue(cid, config_tvt.green_kills) > 0 then doTeleportThing(cid, config_tvt.green_pos) setGlobalStorageValue(red_kills, getGlobalStorageValue(red_kills) + 1) end if getPlayerStorageValue(cid, config_tvt.red_kills) > 0 then doTeleportThing(cid, config_tvt.red_pos) setGlobalStorageValue(red_kills, getGlobalStorageValue(green_kills) + 1) end doPlayerSendTextMessage(cid, 27, "You dead! by Absolute") return true end Em creaturescripts/creaturescripts.xml adicione as seguintes linhas:
      <event type="preparedeath" name="BattlefieldP" event="script" value="pdeath.lua"/> <event type="combat" name="BattlefieldC" event="script" value="combat.lua"/> Pós o terceiro passo, em movements/scripts crie um arquivo com o nome de battlefieldAbsolute.lua e adicione o seguinte:
      local conditionBlack = createConditionObject(CONDITION_OUTFIT) setConditionParam(conditionBlack, CONDITION_PARAM_TICKS, -1) addOutfitCondition(conditionBlack, {lookType = 134, lookHead = 114, lookBody = 114, lookLegs = 114, lookFeet = 114}) local conditionRed = createConditionObject(CONDITION_OUTFIT) setConditionParam(conditionRed, CONDITION_PARAM_TICKS, -1) addOutfitCondition(conditionRed, {lookType = 143, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94}) function onStepIn(cid, item, position, fromPosition) if getPlayerAccess(cid) > 3 then doTeleportThing(cid, battlefield.pos_team_1) return true elseif getGlobalStorageValue(battlefield.storage) == 0 then doTeleportThing(cid, battlefield.spectors[math.random(#battlefield.spectors)]) return true end if getGlobalStorageValue(battlefield.storage) > 0 then if getGlobalStorageValue(battlefield.storage) % 2 == 0 then setPlayerStorageValue(cid, battlefield.storage2, 1) doAddCondition(cid, conditionBlack) doTeleportThing(cid, battlefield.pos_team_1) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You will join the team " .. battlefield.team1Name .. "!") else setPlayerStorageValue(cid, battlefield.storage2, 2) doAddCondition(cid, conditionRed) doTeleportThing(cid, battlefield.pos_team_2) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You will join the team " .. battlefield.team2Name .. "!") end setGlobalStorageValue(battlefield.storage, getGlobalStorageValue(battlefield.storage)-1) if getGlobalStorageValue(battlefield.storage) == 0 then doBroadcastMessage("Battlefield will start in 1 minute, please create your strategy!") addEvent(doBroadcastMessage, 60*1000, "BattleField will begin now!") addEvent(OpenWallBattle, 60*1000) else doBroadcastMessage("We are waiting "..getGlobalStorageValue(battlefield.storage).." players to Battlefield starts.") end end return true end Em movements.xml adicione a seguinte linha:
      <movevent type="StepIn" actionid="45000" event="script" value="battlefieldAbsolute.lua"/> Á pedidos fiz o comando para abrir manualmente, então em talkactions/scripts crie um arquivo com o nome de battlefieldopenAbsolute.lua e coloque:
      function onSay(cid, words, param) if getGlobalStorageValue(battlefield.storage) ~= -1 then doPlayerSendCancel(cid, "The event is already open.") return true elseif not tonumber(param) or param % 2 ~= 0 then doPlayerSendCancel(cid, "You must choose an even number.") return true end doBroadcastMessage("The event BattleField was opened and We are waiting "..param.." Players! Team divided into "..((param)/2).." VS "..((param)/2)) setGlobalStorageValue(battlefield.storage, tonumber(param)) local tp = doCreateItem(1387, 1, battlefield.tpPos) doItemSetAttribute(tp, "aid", 45000) return true end Em talkactions.xml adicione a linha:
      <talkaction words="/battlefield" access="3" event="script" value="battlefieldopenAbsolute.lua"/> Screenshots do mapa do evento; Clique em spoiler para ver.
       
       
      Download & Scan do mapa;
    • Por HenriqueFisch13
      Boa Noite Pessoal, estou com um problema no meu battle field, já tentei diversos scripts e não consegui solucionar;
      Pois bem, no battle field event tem aquela "parede" que quando o game iniciará elas irão sumir, porem elas n somem, ja tentei remove-las pelo RME e deixa-las, mas mesmo assim nada acontece, o evento esta funcionando perfeitamente, porem com esse pequeno detalhe, gostaria que me ajudassem para eu poder colocar meu otserv online o quanto antes... ficarei grato REP+
      NO CASO SERIA BATTLELIB, OBS: posições estão corretas e o id da parede também, OT Baiak 8.6 TFS: 0.4.1
      Meu Script :
       
      ERRO no Console
       
       
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo