Ir para conteúdo

Featured Replies

Postado
  • Este é um post popular.

66YRMCp.jpg

 

 

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;

Spoiler


tpPos = {x=32342, y=32213, z=7}, -- aonde aparecerá o teleport - Aqui o lugar onde aparecerá o TP para os players entrarem pós o uso do comando a algum membro da equipe.

    pos_team_1 = {x=31621,y=31860,z=7}, -- posição do team 1 (do lado direito) - Lado onde o time preto irá nascer no evento
    pos_team_2 = {x=31582,y=31860,z=7}, -- posição do team 2 (do lado esquerdo) - Lado onde o time vermelho irá nascer no evento
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) - COLOQUE A POSIÇÃO DAS 4 AREAS QUADRADAS QUE TEM PERTO DA PONTE, ONDE OS ESPECTADORES SENTIRÃO A ADRENALINA DOS PARTICIPANTES!
As positions das 4 áreas, seguem na imagem:
zla64gs.jpg
 

 

 

 

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.

Spoiler

 

Base dos times / bandeira:

lVYGN5M.png

 

 

Primeiro andar:

6FudLK2.jpg

 

 

Ponte de confronte/sala de espectadores:

ZoFkZyU.jpg

 

PVP Stacks:

Xm2tnSe.png

 

 

Download & Scan do mapa;

Spoiler

https://www.sendspace.com/file/3s5no6

https://www.virustotal.com/pt/url/c333ba4b4978934bf8000c3da8a6424b7a0e060777ab48af386f7b22b20fa899/analysis/1402855824/

 

Spoiler

 

 

Caso haja dúvidas comente ou contate-me, será um prazer ajuda-lo.



Créditos:

Otland
Responsáveis pelas funções do script
Absolute

 

 

 

 

 

 

Até o próximo sisteminha TK! <3.

 

 

 

 

Cordialmente;
Absolute.
 

YDmXTU2.png

 

Entenda tudo sobre VPS, DEDICADOS & HOSPEDAGENS. => Clique aqui

Global Full Download 10.9x - TFS 1.2/FERUMBRAS/KRAILOS. => Clique aqui

 

Muitos querem aquilo que você tem, 
mas vão desistir quando souberem o preço que você pagou.

 

skype-favicon.png lu.lukinha

message-16.png [email protected]

  • Respostas 99
  • Visualizações 18k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Sistema inteiramente mal "editado" 2 creaturescrips com a mesma função PrepareDeath, dando conflito, Libs inexistentes e entre outros, script de péssima qualidade, não era de ser espera Feito por nada

  • Galerinha, só uma dica, o evento foi totalmente feito pelo grandioso scripter DEMONBHOLDER, e não por essa farsa que não sabe ao menos fazer uma função de soma

  • Divulgação de um sistema Falho e inutil e mal copiado

Posted Images

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo