Ir para conteúdo

Featured Replies

Postado
  • Autor
  Em 28/09/2019 em 00:29, luanluciano93 disse:

@Lisbeky war_death


local config = {
	redTeam = 1,
	blueTeam = 2,
	gametime = 2000,
	redTeamStorage = 2001,
	blueTeamStorage = 2002,
	outfitRed = {lookType = 128, lookHead = 94, lookAddons = 2, lookLegs = 94, lookBody = 94, lookFeet = 94},
	outfitBlue = {lookType = 128, lookHead = 88, lookAddons = 2, lookLegs = 88, lookBody = 88, lookFeet = 88},
	war = {
		fromPos = {x=638, y=711, z=7, stackpos=253},
		toPos = {x=751, y=780, z=7, stackpos=253},
		rewardRoom = {x=636,y=662,z=7,stackpos=1},
		removePlayer = {x=518, y=840, z=7, stackpos=253}
	}
}

local function TpWinners(cid)
	for _, pid in ipairs(getPlayersOnline()) do
		if isInArea(getPlayerPosition(pid), config.war.fromPos, config.war.toPos) then
			doTeleportThing(pid, config.war.rewardRoom, false)
		end
	end
end

local function winKill(cid, team)
	addEvent(TpWinners, 5000, cid)
	setGlobalStorageValue(config.redTeamStorage, 0)
	setGlobalStorageValue(config.blueTeamStorage, 0)
	doTeleportThing(cid, config.war.removePlayer)
	if team = 1 then
		doBroadcastMessage("Red Team has won the event!")
	elseif team == 2
		doBroadcastMessage("Blue Team has won the event!")
	end
end

local function arenaDeath(cid, team)
	doTeleportThing(cid, config.war.removePlayer)
	doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have died, you are eliminated from the event')
	setPlayerStorageValue(cid, 1001, 0)
	setPlayerStorageValue(cid, 1002, 1)
	doRemoveCondition(cid,CONDITION_INFIGHT)
	doRemoveCondition(cid, CONDITION_OUTFIT)
	if team == 1 then
		setGlobalStorageValue(config.redTeamStorage, getGlobalStorageValue(2001) - 1)
	elseif team == 2 then
		setGlobalStorageValue(config.blueTeamStorage, getGlobalStorageValue(2002) - 1)
	end

	if getGlobalStorageValue(2001) == 1 then -- redStorage
		winKill(cid, 2)
	elseif getGlobalStorageValue(2002) == 1 then -- blueStorage
		winKill(cid, 1)
	end
end

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)

	if isPlayer(cid) == true and getPlayerStorageValue(cid, 1001) > 0 then
		arenaDeath(cid, team)
		return false
	end
	return true
end 

 

opa fala meu amigo! se eu tivesse visto na sexta, teria feito o teste ja hahahaha . bom fiz a mudança que vc pediu do script, e deu um erro na distro....

 

[30/09/2019 15:33:23] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/war arena/war_death.lua:30: 'then' expected near '='
[30/09/2019 15:33:23] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/war arena/war_death.lua)
[30/09/2019 15:33:23] data/creaturescripts/scripts/war arena/war_death.lua:30: 'then' expected near '='

 

 

  • Respostas 19
  • Visualizações 837
  • Created
  • Última resposta

Top Posters In This Topic

Postado
  • Autor
  Em 30/09/2019 em 19:30, ernaix69 disse:

esse evento provavelmente seta uma town id quando o jogador entra nele, verifique se as town id sao as mesmas q estao no seu mapa.

 

é sim amigo... tanto que divide o time certinho, apenas o q esta bugando sao as mortes.

Postado

war_death 

local config = {
	redTeam = 1,
	blueTeam = 2,
	gametime = 2000,
	redTeamStorage = 2001,
	blueTeamStorage = 2002,
	outfitRed = {lookType = 128, lookHead = 94, lookAddons = 2, lookLegs = 94, lookBody = 94, lookFeet = 94},
	outfitBlue = {lookType = 128, lookHead = 88, lookAddons = 2, lookLegs = 88, lookBody = 88, lookFeet = 88},
	war = {
		fromPos = {x=638, y=711, z=7, stackpos=253},
		toPos = {x=751, y=780, z=7, stackpos=253},
		rewardRoom = {x=636,y=662,z=7,stackpos=1},
		removePlayer = {x=518, y=840, z=7, stackpos=253}
	}
}

local function TpWinners(cid)
	for _, pid in ipairs(getPlayersOnline()) do
		if isInArea(getPlayerPosition(pid), config.war.fromPos, config.war.toPos) then
			doTeleportThing(pid, config.war.rewardRoom, false)
		end
	end
end

local function winKill(cid, team)
	addEvent(TpWinners, 5000, cid)
	setGlobalStorageValue(config.redTeamStorage, 0)
	setGlobalStorageValue(config.blueTeamStorage, 0)
	doTeleportThing(cid, config.war.removePlayer)
	if team == 1 then
		doBroadcastMessage("Red Team has won the event!")
	elseif team == 2
		doBroadcastMessage("Blue Team has won the event!")
	end
end

local function arenaDeath(cid, team)
	doTeleportThing(cid, config.war.removePlayer)
	doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have died, you are eliminated from the event')
	setPlayerStorageValue(cid, 1001, 0)
	setPlayerStorageValue(cid, 1002, 1)
	doRemoveCondition(cid,CONDITION_INFIGHT)
	doRemoveCondition(cid, CONDITION_OUTFIT)
	if team == 1 then
		setGlobalStorageValue(config.redTeamStorage, getGlobalStorageValue(2001) - 1)
	elseif team == 2 then
		setGlobalStorageValue(config.blueTeamStorage, getGlobalStorageValue(2002) - 1)
	end

	if getGlobalStorageValue(2001) == 1 then -- redStorage
		winKill(cid, 2)
	elseif getGlobalStorageValue(2002) == 1 then -- blueStorage
		winKill(cid, 1)
	end
end

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)

	if isPlayer(cid) == true and getPlayerStorageValue(cid, 1001) > 0 then
		arenaDeath(cid, team)
		return false
	end
	return true
end 

ctf_death 

local config = {
	redTeam = 3,
	blueTeam = 4,
	redSide = {x=676, y=499, z=7, stackpos=253},
	blueSide = {x=744, y=520, z=7, stackpos=253},
	flagDropRed = 'Red Team has dropped the flag.',
	flagDropBlue = 'Blue Team has dropped the flag.'
}

function onPrepareDeath(cid, deathList)
	if not isPlayer(cid) and getPlayerStorageValue(cid, 1001) < 1 then
		return true
	end

	local flagPosRed = {x=676,y=503,z=7,stackpos=0}
	local flagPosBlue = {x=744,y=523,z=7,stackpos=0}
	local hasFlag = getPlayerStorageValue(cid, 2015)

	local killer = 1
	local assister = 2
	local kills = 65530
	local deaths = 65529
	local getDeaths = getPlayerStorageValue(cid,deaths)
	local getKills = getPlayerStorageValue(deathList[killer],kills)

	if getPlayerStorageValue(cid, 1001) == config.redTeam or getPlayerStorageValue(cid, 1001) == config.blueTeam then
		
		if getPlayerStorageValue(cid, 1001) == config.redTeam then
			setPlayerStorageValue(cid, 1003, 1)
			doTeleportThing(cid, config.redSide)
		elseif getPlayerStorageValue(cid, 1001) == config.blueTeam then
			setPlayerStorageValue(cid, 1004, 1)
			doTeleportThing(cid, config.blueSide)
		end

		doRemoveCondition(cid,CONDITION_INFIGHT)

		if getPlayerStorageValue(deathList[killer],kills) < 1 then
			setPlayerStorageValue(deathList[killer], kills, 1)
		else
			setPlayerStorageValue(deathList[killer], kills, getKills + 1)
		end
		
		if getPlayerStorageValue(cid,deaths) < 1 then
			setPlayerStorageValue(cid,deaths, 1)
		else
			setPlayerStorageValue(cid,deaths, getDeaths + 1)
		end

		if hasFlag >= 1 then
			if getPlayerStorageValue(cid,1001) == config.redTeam then
				doSetItemActionId(getThingFromPos(flagPosBlue).uid, 100)
				doBroadcastMessage(config.flagDropRed)
			elseif getPlayerStorageValue(cid, 1001) == config.blueTeam then
				doSetItemActionId(getThingFromPos(flagPosRed).uid, 100)
				doBroadcastMessage(config.flagDropBlue)
			end

			doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You dropped the flag!')
			setPlayerStorageValue(cid,2015, 0)
		
			if getPlayerStorageValue(deathList[killer],65532) < 1 then
				setPlayerStorageValue(deathList[killer], 65532, 1)
			else
				setPlayerStorageValue(deathList[killer], 65532, getPlayerStorageValue(deathList[killer],65532) + 1)
			end
			
			if isPlayer(deathList[assister]) == true then
				if getPlayerStorageValue(deathList[assister],65531) < 1 then
					setPlayerStorageValue(deathList[assister], 65531, 1)
				else
					setPlayerStorageValue(deathList[assister], 65531, getPlayerStorageValue(deathList[assister],65531) + 1)
				end
			end
		end
		return false
	end
	return true
end 

 

Postado
  • Autor
  Em 30/09/2019 em 23:20, luanluciano93 disse:

war_death 


local config = {
	redTeam = 1,
	blueTeam = 2,
	gametime = 2000,
	redTeamStorage = 2001,
	blueTeamStorage = 2002,
	outfitRed = {lookType = 128, lookHead = 94, lookAddons = 2, lookLegs = 94, lookBody = 94, lookFeet = 94},
	outfitBlue = {lookType = 128, lookHead = 88, lookAddons = 2, lookLegs = 88, lookBody = 88, lookFeet = 88},
	war = {
		fromPos = {x=638, y=711, z=7, stackpos=253},
		toPos = {x=751, y=780, z=7, stackpos=253},
		rewardRoom = {x=636,y=662,z=7,stackpos=1},
		removePlayer = {x=518, y=840, z=7, stackpos=253}
	}
}

local function TpWinners(cid)
	for _, pid in ipairs(getPlayersOnline()) do
		if isInArea(getPlayerPosition(pid), config.war.fromPos, config.war.toPos) then
			doTeleportThing(pid, config.war.rewardRoom, false)
		end
	end
end

local function winKill(cid, team)
	addEvent(TpWinners, 5000, cid)
	setGlobalStorageValue(config.redTeamStorage, 0)
	setGlobalStorageValue(config.blueTeamStorage, 0)
	doTeleportThing(cid, config.war.removePlayer)
	if team == 1 then
		doBroadcastMessage("Red Team has won the event!")
	elseif team == 2
		doBroadcastMessage("Blue Team has won the event!")
	end
end

local function arenaDeath(cid, team)
	doTeleportThing(cid, config.war.removePlayer)
	doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have died, you are eliminated from the event')
	setPlayerStorageValue(cid, 1001, 0)
	setPlayerStorageValue(cid, 1002, 1)
	doRemoveCondition(cid,CONDITION_INFIGHT)
	doRemoveCondition(cid, CONDITION_OUTFIT)
	if team == 1 then
		setGlobalStorageValue(config.redTeamStorage, getGlobalStorageValue(2001) - 1)
	elseif team == 2 then
		setGlobalStorageValue(config.blueTeamStorage, getGlobalStorageValue(2002) - 1)
	end

	if getGlobalStorageValue(2001) == 1 then -- redStorage
		winKill(cid, 2)
	elseif getGlobalStorageValue(2002) == 1 then -- blueStorage
		winKill(cid, 1)
	end
end

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)

	if isPlayer(cid) == true and getPlayerStorageValue(cid, 1001) > 0 then
		arenaDeath(cid, team)
		return false
	end
	return true
end 

ctf_death 


local config = {
	redTeam = 3,
	blueTeam = 4,
	redSide = {x=676, y=499, z=7, stackpos=253},
	blueSide = {x=744, y=520, z=7, stackpos=253},
	flagDropRed = 'Red Team has dropped the flag.',
	flagDropBlue = 'Blue Team has dropped the flag.'
}

function onPrepareDeath(cid, deathList)
	if not isPlayer(cid) and getPlayerStorageValue(cid, 1001) < 1 then
		return true
	end

	local flagPosRed = {x=676,y=503,z=7,stackpos=0}
	local flagPosBlue = {x=744,y=523,z=7,stackpos=0}
	local hasFlag = getPlayerStorageValue(cid, 2015)

	local killer = 1
	local assister = 2
	local kills = 65530
	local deaths = 65529
	local getDeaths = getPlayerStorageValue(cid,deaths)
	local getKills = getPlayerStorageValue(deathList[killer],kills)

	if getPlayerStorageValue(cid, 1001) == config.redTeam or getPlayerStorageValue(cid, 1001) == config.blueTeam then
		
		if getPlayerStorageValue(cid, 1001) == config.redTeam then
			setPlayerStorageValue(cid, 1003, 1)
			doTeleportThing(cid, config.redSide)
		elseif getPlayerStorageValue(cid, 1001) == config.blueTeam then
			setPlayerStorageValue(cid, 1004, 1)
			doTeleportThing(cid, config.blueSide)
		end

		doRemoveCondition(cid,CONDITION_INFIGHT)

		if getPlayerStorageValue(deathList[killer],kills) < 1 then
			setPlayerStorageValue(deathList[killer], kills, 1)
		else
			setPlayerStorageValue(deathList[killer], kills, getKills + 1)
		end
		
		if getPlayerStorageValue(cid,deaths) < 1 then
			setPlayerStorageValue(cid,deaths, 1)
		else
			setPlayerStorageValue(cid,deaths, getDeaths + 1)
		end

		if hasFlag >= 1 then
			if getPlayerStorageValue(cid,1001) == config.redTeam then
				doSetItemActionId(getThingFromPos(flagPosBlue).uid, 100)
				doBroadcastMessage(config.flagDropRed)
			elseif getPlayerStorageValue(cid, 1001) == config.blueTeam then
				doSetItemActionId(getThingFromPos(flagPosRed).uid, 100)
				doBroadcastMessage(config.flagDropBlue)
			end

			doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You dropped the flag!')
			setPlayerStorageValue(cid,2015, 0)
		
			if getPlayerStorageValue(deathList[killer],65532) < 1 then
				setPlayerStorageValue(deathList[killer], 65532, 1)
			else
				setPlayerStorageValue(deathList[killer], 65532, getPlayerStorageValue(deathList[killer],65532) + 1)
			end
			
			if isPlayer(deathList[assister]) == true then
				if getPlayerStorageValue(deathList[assister],65531) < 1 then
					setPlayerStorageValue(deathList[assister], 65531, 1)
				else
					setPlayerStorageValue(deathList[assister], 65531, getPlayerStorageValue(deathList[assister],65531) + 1)
				end
			end
		end
		return false
	end
	return true
end 

 

 

opa, deu um erro no distro luan.

 

[Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/war arena/war_death.lua:33: 'then' expected near 'doBroadcastMessage'
[30/09/2019 20:43:34] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/war arena/war_death.lua)
[30/09/2019 20:43:34] data/creaturescripts/scripts/war arena/war_death.lua:33: 'then' expected near 'doBroadcastMessage'

 

 

 

 

Luan, apesar do erro ter sido somente no war_death, eu fiz um teste para ver se da erro no ctf_death e o bug permanece, morreu vai para o templo.

Luan vou te passar todas os scripts dos eventos e vc da uma olhada se ha alguma duplicação ou algo nos códigos que possam esta entrando em conflito.

 

creaturescript: creaturescript, war_death, ctf_death, team_attack

globalevents: events

movements: movements, multi_block, stealth_ring, set_teams(war), blue_flag_plate, ctf_determine_winner, ctf_set_teams, red_flag_plate, blue_flag_score, ctf_score, red_flag_score.

 

caso não vá separado por pastas, eu descrevi aqui em cima o destino delas.

 

por via das duvidas, mandei tudo. 

 

mas uma vez obrigado Luan, não desista de mim pls.

creaturescripts.xmlUnavailable events.luaUnavailable globalevents.xmlUnavailable ctf_death.luaUnavailable team_attack.luaUnavailable war_death.luaUnavailable movements.xmlUnavailable Blue_Flag_Plate.luaUnavailable ctf_determine_winner.luaUnavailable ctf_set_teams.luaUnavailable Blue_Flag_Score.luaUnavailable ctf_score.luaUnavailable Red_Flag_Score.luaUnavailable Red_Flag_Plate.luaUnavailable multi_block.luaUnavailable stealth_ring.luaUnavailable set_teams.luaUnavailable

Editado por Lisbeky (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.

Visitante
Responder

Quem Está Navegando 0

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

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo