Postado Fevereiro 28, 2021 4 anos Bom Dia, Alguem Poderia me Ajudar a Coloca a Caveira da Guild war em Um Evento de PVP. Quando vc Entra no Evento tem o Time Azul Vs Time Vermelho ex: Time azul Cai com a caverinha azul, e Time Vermelho cai com a Caverinha Vermelha Quando Entra no Evento Fica Assim Queria que Ficasse Assim Alguem Poderia me da Uma Ajuda? Script (TVT Vai Na Pasta Lib e Copia o Script BattleLib.lua Spoiler _Lib_Battle_Info = { Reward = {2160,100}, Reward2 = {12780,300}, TeamOne = {name = "Demonics", storage = 140120, pos = {x = 289, y = 341, z = 15}}, TeamTwo = {name = "Saiyajins",storage = 140121,pos = {x = 352, y = 382, z = 15}}, storage_count = 180400, tpPos = {x=94, y=101, z=6}, limit_Time = 1 -- em minutos } function resetBattle() return setGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage, 0) and setGlobalStorageValue(_Lib_Battle_Info.TeamTwo.storage, 0) end function OpenWallBattle() local B = { -- Demonics {1524,{x=288, y=340, z=15, stackpos = 1}}, {1524,{x=289, y=340, z=15, stackpos = 1}}, -- Saiyajins {1526,{x = 352, y = 384, z = 15, stackpos = 1}}, {1524,{x = 349, y = 387, z = 15, stackpos = 1}} } for i = 1, #B do if getTileItemById(B[i][2], B[i][1]).uid == 0 then doCreateItem(B[i][1], 1, B[i][2]) else doRemoveItem(getThingfromPos(B[i][2]).uid,1) end end end function doBroadCastBattle(type,msg) local players = {} for _, cid in pairs(getPlayersOnline()) do if getPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage) == 1 or getPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage) == 1 then table.insert(players, cid) end end for i = 1, #players do doPlayerSendTextMessage(players[i],type,msg) end end function removeBattleTp() local t = getTileItemById(_Lib_Battle_Info.tpPos, 1387).uid return t > 0 and doRemoveItem(t) and doSendMagicEffect(_Lib_Battle_Info.tpPos, CONST_ME_POFF) end function getWinnersBattle(storage) local players,str = {},"" for _, cid in pairs(getPlayersOnline()) do if getPlayerStorageValue(cid, storage) == 1 then table.insert(players, cid) end end str = str .. ""..#players.." Jogador"..(#players > 1 and "es" or "").." do time "..(getGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage) == 0 and _Lib_Battle_Info.TeamTwo.name or _Lib_Battle_Info.TeamOne.name).." ganharam o evento Battlefield e receberam ".._Lib_Battle_Info.Reward[2].." "..getItemNameById(_Lib_Battle_Info.Reward[1]).." + ".._Lib_Battle_Info.Reward2[2].." "..getItemNameById(_Lib_Battle_Info.Reward2[1]).."!" for i = 1, #players do doPlayerAddItem(players[i], _Lib_Battle_Info.Reward[1], _Lib_Battle_Info.Reward[2]) doPlayerAddItem(players[i], _Lib_Battle_Info.Reward2[1], _Lib_Battle_Info.Reward2[2]) doRemoveCondition(players[i], CONDITION_OUTFIT) doTeleportThing(players[i], getTownTemplePosition(getPlayerTown(players[i]))) setPlayerStorageValue(players[i], storage, -1) end resetBattle() OpenWallBattle() return doBroadcastMessage(str) end function CheckEvent(delay) if delay > 0 and getGlobalStorageValue(_Lib_Battle_Info.storage_count) > 0 then doBroadcastMessage("[BattleField] Estamos à espera de "..getGlobalStorageValue(_Lib_Battle_Info.storage_count).." jogadores para o Battlefield iniciar.") elseif delay == 0 and getGlobalStorageValue(_Lib_Battle_Info.storage_count) > 0 then local players = {} for _, cid in pairs(getPlayersOnline()) do if getPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage) == 1 or getPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage) == 1 then table.insert(players, cid) end end for i = 1, #players do doRemoveCondition(players[i], CONDITION_OUTFIT) doTeleportThing(players[i], getTownTemplePosition(getPlayerTown(players[i]))) setPlayerStorageValue(players[i], getPlayerStorageValue(players[i], _Lib_Battle_Info.TeamOne.storage) == 1 and _Lib_Battle_Info.TeamOne.storage or _Lib_Battle_Info.TeamTwo.storage, -1) end doBroadcastMessage("O evento Battlefield não iniciou por não ter jogadores suficientes.") setGlobalStorageValue(_Lib_Battle_Info.storage_count, 0) resetBattle() removeBattleTp() end addEvent(CheckEvent, 60000, delay-1) end 2- Vai Na Pasta Globalevents e Cole o Script TVTEvent Spoiler function onThink(interval, lastExecution) _Lib_Battle_Days = { ["Sunday"] = { ["19:13"] = {players = 4} }, ["Wednesday"] = { ["18:30"] = {players = 20} }, ["Friday"] = { ["20:00"] = {players = 20} } } if _Lib_Battle_Days[os.date("%A")] then hours = tostring(os.date("%X")):sub(1, 5) tb = _Lib_Battle_Days[os.date("%A")][hours] if tb and (tb.players % 2 == 0) then local tp = doCreateItem(1387, 1, _Lib_Battle_Info.tpPos) doItemSetAttribute(tp, "aid", 45000) CheckEvent(_Lib_Battle_Info.limit_Time) doBroadcastMessage("O evento Battlefield foi aberto, ainda faltam "..tb.players.." jogadores para começar! Os times serão divididos em "..((tb.players)/2).." VS "..((tb.players)/2)) return setGlobalStorageValue(_Lib_Battle_Info.storage_count, tb.players) end end return true end 3- Registrando em GlobalEvents.xml Spoiler <!-- Evento TVT--> <globalevent name="GlobalBattle" interval="60000" event="script" value="TVTEvent.lua"/> 4- Agora em Movements Cole o Script BattleMovements Spoiler local conditionBlack = createConditionObject(CONDITION_OUTFIT) setConditionParam(conditionBlack, CONDITION_PARAM_TICKS, -1) addOutfitCondition(conditionBlack, {lookType = 494}) local conditionRed = createConditionObject(CONDITION_OUTFIT) setConditionParam(conditionRed, CONDITION_PARAM_TICKS, -1) addOutfitCondition(conditionRed, {lookType = 495}) function onStepIn(cid, item, position, fromPosition) if getPlayerAccess(cid) > 3 then doTeleportThing(cid, _Lib_Battle_Info.TeamOne.pos) return false elseif getGlobalStorageValue(_Lib_Battle_Info.storage_count) > 0 then setGlobalStorageValue(_Lib_Battle_Info.storage_count, getGlobalStorageValue(_Lib_Battle_Info.storage_count)-1) end if getGlobalStorageValue(_Lib_Battle_Info.storage_count) >= 0 then if getGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage) < getGlobalStorageValue(_Lib_Battle_Info.TeamTwo.storage) then setPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage, 1) doAddCondition(cid, conditionBlack) setGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage, getGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage)+1) doTeleportThing(cid, _Lib_Battle_Info.TeamOne.pos) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce está no time " .. _Lib_Battle_Info.TeamOne.name .. "!") else setPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage, 1) doAddCondition(cid, conditionRed) setGlobalStorageValue(_Lib_Battle_Info.TeamTwo.storage, getGlobalStorageValue(_Lib_Battle_Info.TeamTwo.storage)+1) doTeleportThing(cid, _Lib_Battle_Info.TeamTwo.pos) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce está no time " .. _Lib_Battle_Info.TeamTwo.name .. "!") end end if getGlobalStorageValue(_Lib_Battle_Info.storage_count) == 0 then removeBattleTp() doBroadcastMessage("Battlefield irá começar em 1 minuto, monte sua estratégia.") addEvent(doBroadcastMessage, 1*60*1000-500, "Battlefield irá começar agora!") addEvent(OpenWallBattle, 1*60*1000) end return true end 5- Registrando em Movimentes.xml Spoiler <movevent type="StepIn" actionid="45000" event="script" value="BattleMovements.lua"/> Editado Fevereiro 28, 2021 4 anos por Diego Rosa (veja o histórico de edições)
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.