Hahaha bem bacana esse seu script, só fica meio enjuativo se vc colocar sempre esse evento, cê bem que podia colocar mais umas posições, tipo uns 7 locais de scripts configuraveis, ai um por semana, num lugar diferente não ia enjoar ![]()
- Fórum
- OTServ
- Recursos
- Scripting
- Mods, funções e outros
- BattleField TFS 1.1+
info
Grupo: Campones
Registrado: 31/08/12
Posts: 68
Reputação: +44
Char no Tibia: Tii Rush

info
Grupo: Marquês
Registrado: 03/02/13
Posts: 1.2k
Reputação: +254
Gênero: Masculino
Char no Tibia: Partiu Baladinha

Acho que deu um biziu: em vez de remover a parede, tá criando as grade sde ID 1343 impossibilitando do evento continuar...
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

Acho que deu um biziu: em vez de remover a parede, tá criando as grade sde ID 1343 impossibilitando do evento continuar...
isso é simples, você adiciona no MAPA EDITOR as parades, configura no script o ID delas e POS, quando começar o evento a função vai checar se tem realmente as paredes naquele lugar q vc configurou, caso não tiver, vai cria-las.
Hahaha bem bacana esse seu script, só fica meio enjuativo se vc colocar sempre esse evento, cê bem que podia colocar mais umas posições, tipo uns 7 locais de scripts configuraveis, ai um por semana, num lugar diferente não ia enjoar
vou fazer isso então, só vou adc uma storage igual eu fiz no map changer.
qndo eu atualizar aviso
info
Grupo: Banidos
Registrado: 20/11/11
Posts: 455
Reputação: +134

Ótimo, quais as funções do TFS 1.1 que não tem no 1.0 pra adicionar nas sources?
info
Grupo: Marquês
Registrado: 03/02/13
Posts: 1.2k
Reputação: +254
Gênero: Masculino
Char no Tibia: Partiu Baladinha

isso é simples, você adiciona no MAPA EDITOR as parades, configura no script o ID delas e POS, quando começar o evento a função vai checar se tem realmente as paredes naquele lugar q vc configurou, caso não tiver, vai cria-las.
Vdd dlç.. não tinha percebido isso... mudei o ID das walls ficou perfeito! funcionando sem erros.
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

Ótimo, quais as funções do TFS 1.1 que não tem no 1.0 pra adicionar nas sources?
só ir em data/events/script e ver que o creature.lua falta algumas funções que foram corrigidas no TFS 1.1
info
Grupo: Herói
Registrado: 01/05/08
Posts: 2.6k
Reputação: +536
Gênero: Masculino

info
Grupo: Visconde
Registrado: 24/07/09
Posts: 356
Reputação: +28
Gênero: Masculino

Fiz o evento aqui.. sobrou 3 player do time black e não aconteceu nada.
É por que eu não coloquei Pvp Tool na área e NoLogout ?
info
Grupo: Administrador
Registrado: 08/07/05
Posts: 5.8k
Reputação: +1.4k
Gênero: Outro

Grande contribuição!
Evento ta funcionando de boa, o problema é q os cara tao matando próprio time e bugando tudo antes de começar
Evento ta funcionando de boa, o problema é q os cara tao matando próprio time e bugando tudo antes de começar
Troque:
return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER
por:
return false
vlww kkk
info
Grupo: Campones
Registrado: 05/06/09
Posts: 3
Reputação: 0
Char no Tibia: Vitor Nasser

e o mapa? aquele que você postou no antigo funciona para essa versao ou eh só 8.6 +/-?







info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino
Informações:
Repassei esse sistema:
http://www.xtibia.com/forum/topic/192920-battlefield-event/page-1
para a nova versão
Versão: TFS 1.1 ou SUPERIOR(NÃO FUNCIONA NO TFS 1.0)
OBS: Favor ter noções básicas de como instalar o sistema no seu server.
Instalando o Sistema:
data\creaturescripts\scripts
battlefield.lua
function onLogin(player) player:registerEvent("battledeath") if Game.getStorageValue(_Lib_Battle_Info.TeamOne.storage) == -1 then Game.setStorageValue(_Lib_Battle_Info.TeamOne.storage, 0) Game.setStorageValue(_Lib_Battle_Info.TeamTwo.storage, 0) Game.setStorageValue(_Lib_Battle_Info.storage_count, 0) end if player:getStorageValue(_Lib_Battle_Info.TeamOne.storage) >= 1 or player:getStorageValue(_Lib_Battle_Info.TeamTwo.storage) >= 1 then player:setStorageValue(_Lib_Battle_Info.TeamOne.storage, -1) player:setStorageValue(_Lib_Battle_Info.TeamTwo.storage, -1) player:teleportTo(player:getTown():getTemplePosition()) end return true end function onPrepareDeath(creature, lastHitKiller, mostDamageKiller) if creature:isPlayer() and creature:getStorageValue(_Lib_Battle_Info.TeamOne.storage) >= 1 or creature:getStorageValue(_Lib_Battle_Info.TeamTwo.storage) >= 1 then local MyTeam = creature:getStorageValue(_Lib_Battle_Info.TeamOne.storage) >= 1 and _Lib_Battle_Info.TeamOne.storage or _Lib_Battle_Info.TeamTwo.storage local EnemyTeam = creature:getStorageValue(_Lib_Battle_Info.TeamOne.storage) >= 1 and _Lib_Battle_Info.TeamTwo.storage or _Lib_Battle_Info.TeamOne.storage Game.setStorageValue(MyTeam, (Game.getStorageValue(MyTeam)-1)) creature:sendTextMessage(MESSAGE_INFO_DESCR, "[Battle Field] You Are Dead!") creature:setStorageValue(MyTeam, -1) creature:removeCondition(CONDITION_OUTFIT) if Game.getStorageValue(MyTeam) == 0 then getWinnersBattle(EnemyTeam) else doBroadCastBattle(23,"[BattleField Information] ".._Lib_Battle_Info.TeamOne.name.." "..Game.getStorageValue(_Lib_Battle_Info.TeamOne.storage).." VS "..Game.getStorageValue(_Lib_Battle_Info.TeamTwo.storage).." " .._Lib_Battle_Info.TeamTwo.name) end end return true end_Lib_Battle_Days = { ["Tuesday"] = { ["16:00"] = {players = 30}, ["15:32"] = {players = 2} }, ["Wednesday"] = { ["23:06"] = {players = 2} }, ["Thursday"] = { ["11:26"] = {players = 4}, ["20:30"] = {players = 10} } } function onThink(interval) 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 = Game.createItem(1387, 1, _Lib_Battle_Info.tpPos) tp:setActionId(45000) CheckEvent(_Lib_Battle_Info.limit_Time) Game.setStorageValue(_Lib_Battle_Info.storage_count, tb.players) broadcastMessage("The event BattleField was opened and We are waiting "..tb.players.." Players! Team divided into "..((tb.players)/2).." VS "..((tb.players)/2)) end end return true end-------------------------------------------//-------------------------------------------------
data\lib\core
battlefield.lua
_Lib_Battle_Info = { Reward = { exp = {true, 100}, items = {true, 2160, 10}, premium_days = {false, 1} }, TeamOne = {name = "Black Assassins", storage = 140120, pos = {x=95,y=113,z=7}}, TeamTwo = {name = "Red Barbarians",storage = 140121,pos = {x=100,y=116,z=7}}, storage_count = 180400, tpPos = {x=92, y=116, z=7}, limit_Time = 2 -- em minutos } function resetBattle() Game.setStorageValue(_Lib_Battle_Info.TeamOne.storage, 0) Game.setStorageValue(_Lib_Battle_Info.TeamTwo.storage, 0) end function doBroadCastBattle(type, msg) for _, cid in pairs(Game.getPlayers()) do if Player(cid):getStorageValue(_Lib_Battle_Info.TeamOne.storage) == 1 or Player(cid):getStorageValue(_Lib_Battle_Info.TeamTwo.storage) == 1 then Player(cid):sendTextMessage(type, msg) end end end function getWinnersBattle(storage) local str, c = "" , 0 for _, cid in pairs(Game.getPlayers()) do local player = Player(cid) if player:getStorageValue(storage) >= 1 then if _Lib_Battle_Info.Reward.exp[1] == true then player:addExperience(_Lib_Battle_Info.Reward.exp[2]) end if _Lib_Battle_Info.Reward.items[1] == true then player:addItem(_Lib_Battle_Info.Reward.items[2], _Lib_Battle_Info.Reward.items[3]) end if _Lib_Battle_Info.Reward.premium_days[1] == true then player:addPremiumDays(_Lib_Battle_Info.Reward.premium_days[2]) end player:teleportTo(player:getTown():getTemplePosition()) player:setStorageValue(storage, -1) player:removeCondition(CONDITION_OUTFIT) c = c+1 end end str = str .. ""..c.." Player"..(c > 1 and "s" or "").." from team "..(Game.getStorageValue(_Lib_Battle_Info.TeamOne.storage) == 0 and _Lib_Battle_Info.TeamTwo.name or _Lib_Battle_Info.TeamOne.name).." won the event battlefield!" resetBattle() OpenWallBattle() return broadcastMessage(str) end function OpenWallBattle() local B = { {1543,{x=96, y=124, z=7, stackpos = 1}}, {1543,{x=95, y=124, z=7, 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 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 CheckEvent(delay) if delay > 0 and Game.getStorageValue(_Lib_Battle_Info.storage_count) > 0 then broadcastMessage("[BattleField Event] We are waiting "..Game.getStorageValue(_Lib_Battle_Info.storage_count).." players to Battlefield starts") elseif delay == 0 and Game.getStorageValue(_Lib_Battle_Info.storage_count) > 0 then for _, cid in pairs(Game.getPlayers()) do local player = Player(cid) if player:getStorageValue(_Lib_Battle_Info.TeamOne.storage) == 1 or player:getStorageValue(_Lib_Battle_Info.TeamTwo.storage) == 1 then player:teleportTo(player:getTown():getTemplePosition()) player:setStorageValue(_Lib_Battle_Info.TeamOne.storage, -1) player:setStorageValue(_Lib_Battle_Info.TeamTwo.storage, -1) player:removeCondition(CONDITION_OUTFIT) end end broadcastMessage("The event cannot be started because not had enough players.") Game.setStorageValue(_Lib_Battle_Info.storage_count, 0) resetBattle() removeBattleTp() end addEvent(CheckEvent, 60000, delay-1) enddofile('data/lib/core/battlefield.lua')local conditionRed = Condition(CONDITION_OUTFIT) conditionRed:setTicks(120 * 60 * 1000) conditionRed:setOutfit({lookType = 143, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94}) local conditionBlack = Condition(CONDITION_OUTFIT) conditionBlack:setTicks(120 * 60 * 1000) conditionBlack:setOutfit({lookType = 134, lookHead = 114, lookBody = 114, lookLegs = 114, lookFeet = 114}) function onStepIn(creature, item, position, fromPosition) local player = creature:getPlayer() if player == nil then return false end if player:getGroup():getId() >= 3 then return player:teleportTo(_Lib_Battle_Info.TeamOne.pos) end if Game.getStorageValue(_Lib_Battle_Info.storage_count) > 0 then local getMyTeam = Game.getStorageValue(_Lib_Battle_Info.TeamOne.storage) < Game.getStorageValue(_Lib_Battle_Info.TeamTwo.storage) and {_Lib_Battle_Info.TeamOne.storage,_Lib_Battle_Info.TeamOne.pos,_Lib_Battle_Info.TeamOne.name,conditionBlack} or {_Lib_Battle_Info.TeamTwo.storage,_Lib_Battle_Info.TeamTwo.pos, _Lib_Battle_Info.TeamTwo.name, conditionRed} player:addCondition(getMyTeam[4]) player:setStorageValue(getMyTeam[1], 1) Game.setStorageValue(getMyTeam[1], Game.getStorageValue(getMyTeam[1])+1) player:teleportTo(getMyTeam[2]) player:sendTextMessage(MESSAGE_INFO_DESCR, "You will join the team " .. getMyTeam[3] .. "!") Game.setStorageValue(_Lib_Battle_Info.storage_count, Game.getStorageValue(_Lib_Battle_Info.storage_count)-1) end if Game.getStorageValue(_Lib_Battle_Info.storage_count) == 0 then removeBattleTp() broadcastMessage("Battlefield will start in 2 minutes, please create your strategy!") addEvent(broadcastMessage, 2*60*1000-500, "BattleField will begin now!") addEvent(OpenWallBattle, 2*60*1000) end return true end_Lib_Battle_Info = { Reward = { exp = {true, 100}, items = {true, 2160, 10}, premium_days = {false, 1} }, TeamOne = {name = "Black Assassins", storage = 140120, pos = {x=95,y=113,z=7}}, TeamTwo = {name = "Red Barbarians",storage = 140121,pos = {x=100,y=116,z=7}}, storage_count = 180400, tpPos = {x=92, y=116, z=7}, limit_Time = 10 -- em minutos }_Lib_Battle_Days = { ["Tuesday"] = { ["16:00"] = {players = 30}, ["15:32"] = {players = 2} }, ["Wednesday"] = { ["23:06"] = {players = 2} }, ["Thursday"] = { ["11:26"] = {players = 4}, ["20:30"] = {players = 10} } }