• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Looking for working PvP arena script for TFS 0.3b1pl2

Hermes

dziwki kola gramy w lola
Joined
Nov 17, 2007
Messages
1,867
Reaction score
14
Location
Poland
Hello,

I'm looking for PvP arena script, for the latest The Forgotten Server. I've found some scripts somewhere, but neither was working.

If somebody have full working PvP arena script, please post it there.

Thanks!

Regards,
Hermes
 
Last edited:
It's working but player is teleported to temple not to selected tile... And second player can't exit without getting pz.

Note. Player which dies, is teleported to temple, not kicked. So it works like out position is temple position. Also this player have not any conditions.

Btw. I also need lever, who allows only 2 players to fight, and with level limit.

Thank you, anyways, Marcinek, for your great help!
 
Code:
local config = {
	fromPos = { x = 1041, y = 985, z = 9 },
	toPos = { x = 1052, y = 991, z = 9 },
	positionOut = { x = 1035, y = 988, z = 8 },
}

function onPrepareDeath(cid, lastHitKiler, mostDamageKiller)
	if isInArea(getCreaturePosition(cid), config.fromPos, config.toPos) == TRUE then
		doTeleportThing(cid, config.positionOut)
		doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have been defeated by "..lastHitKiller..".")
	return TRUE
	end
return TRUE
end

When player dies it's not teleported to positionOut but to temple of city which player is citizen. This player has removed PZ condition.

The second thing is that I need script for a lever that allows only 2 players to fight, with 50lvl requirment.

Third thing is movement which teleport player to positionOut and removes PZ lock from him.
 
Give some time to think about it, maybe I figure something out :pP
But pvp arena isn't bad idea :D

I won't for sure leave this problem ^^

//Good night =]
 
I wish help you but i don't know why player before die isn't healed by 'doCreatureAddHealth' except that all is working ;s
 
I make it is working now. Both players are teleported out of 'arena zone' Anyway defeated player dies though there is a healing function.. I dont understand why player is not healing while script is execute :S
 
PHP:
local config = {
	fromPos = { x = 93, y = 123, z = 7 },
	toPos = { x = 96, y = 126, z = 7 },
	positionOut1 = { x = 95, y = 127, z = 7 },
	positionOut2 = { x = 95, y = 121, z = 7 }
}


function onPrepareDeath(cid, lastHitKiler, mostDamageKiller)
	if isInArea(getCreaturePosition(cid), config.fromPos, config.toPos) == TRUE then
		doCreatureAddHealth(cid, 20)
		doCreatureSay(cid,'Loooser',1)
		doTeleportThing(cid, config.positionOut1)
		doTeleportThing(lastHitKiler, config.positionOut2)		
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have been defeated by ".. getCreatureName(lastHitKiller) ..".")
		
		
		return
	end
return TRUE
end

Every thing in this is working except healing before die :S
If you solve this I can write lever to this script for you ;d
 
Maybe "lastHitKiler" should be written like "lastHitKiller"? I don't think that TFS Development could make such a misspelling and write "killer" by 1 "l"..
 
In my opinion it doesnt metter. Now we have more serious problem. defeated player isnt healed and I dont have any bugs with ' doCreatureAddHealth(cid, 20) ' ;/

More funny is that the 'doCreatureSay' is executed :p
 
Im trying to do this but all I tried fucked up beacouse deafeted player dies on arena ;s
I would try to make something else but now I'm not at home and I would back in few days ;)
 
PHP:
local config = {
	frompos = { x = 1041, y = 969, z = 5 },
	topos = { x = 1051, y = 973, z = 5 },
	exit = { x = 1046, y = 965, z = 5 },
}

local function exitArena(p)
	doSendMagicEffect(p.exit, 10)
	doTeleportThing(p.cid, p.exit, FALSE)
end

function onPrepareDeath(cid, killer)
	if isInArea(getPlayerPosition(cid), config.frompos, config.topos) then
		doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
		addEvent(exitArena, 100, {cid=cid, exit=config.exit})
		addEvent(exitArena, 100, {cid=killer, exit=config.exit})
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have been defeated by "..getPlayerName(killer)..".")
		doPlayerSendTextMessage(killer, MESSAGE_STATUS_CONSOLE_ORANGE, "You have slayed "..getPlayerName(cid)..".")
	end
	return FALSE
end


Did it some time ago.
 
@up
Elf made me script which is working, but player which left arena has PZ.

Code:
local arenas = {
	{ startPosition = { x = 1041, y = 985, z = 9 }, endPosition = { x = 1052, y = 991, z = 9 }, position = { x = 1035, y = 988, z = 8 } },
}
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
	local tmp = getCreaturePosition(cid)
	for _, arena in ipairs(arenas) do
		if(isInArea(tmp, arena.startPosition, arena.endPosition) == TRUE) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have been defeated by " .. getCreatureName(lastHitKiller) .. ".")
			doCreatureAddHealth(cid, getCreatureMaxHealth(cid), TRUE)
			doTeleportThing(cid, arena.position)
			doSendMagicEffect(tmp, CONST_ME_POFF)
			doSendMagicEffect(arena.position, CONST_ME_TELEPORT)
			return FALSE
		end
	end
	return FALSE
end
 
Now it all stopped on this script.

Code:
local arenas = {
	{ startPosition = { x = 1041, y = 985, z = 9 }, endPosition = { x = 1052, y = 991, z = 9 }, position = { x = 1035, y = 988, z = 8 } },
}
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
	local tmp = getCreaturePosition(cid)
	local hp = getCreatureHealth(cid)
	local maxhp = getCreatureMaxHealth(cid)
	local add = maxhp - hp
	for _, arena in ipairs(arenas) do
		if(isInArea(tmp, arena.startPosition, arena.endPosition) == TRUE) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have been defeated by " .. getCreatureName(lastHitKiller) .. ".")
			doCreatureAddHealth(cid, add, TRUE)
			doTeleportThing(cid, arena.position, TRUE)
			doSendMagicEffect(tmp, CONST_ME_POFF)
			doSendMagicEffect(arena.position, CONST_ME_TELEPORT)
			doRemoveCondition(cid, CONDITION_INFIGHT)
			return FALSE
		end
	end
	return TRUE
end

Player when "dies" is teleported to temple, rest of the script is fine.
 
Last edited:
Back
Top