• 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:
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)
[B]doTeleportThing(lastHitKiller, arena.position, TRUE)[/B]
			doSendMagicEffect(tmp, CONST_ME_POFF)
			doSendMagicEffect(arena.position, CONST_ME_TELEPORT)
			doRemoveCondition(cid, CONDITION_INFIGHT)
			return FALSE
		end
	end
	return TRUE
end

Try this.. Any way you can use global storagevalue for your lever.. I can't help you now beacouse I'm making Bounty Hounter Npc. When I'll do it I can help you more :D
 
#UP
Yes, both need be teleported but he say, the "dead player" is teleported to is Town... and he dont wanna that :)

P.S.: My english sucks u.u
 
I will refresh everything and I will say wtf.

I have scripts like levers and I didn't used any storages. Just simple checking (getThingFromPos etc.). I have movements, which are used as teleports in arena which takes out protection zone.

And the main script. It gives no errors, and works perfectly, except one thing. Player which "dies" in arena is teleported to temple. But I have set when it should be teleported. The strange thing is that the rest of things are working. So it is healed, message that he got owned shows to him and hiz PZ lock is removed. Just this teleportation is not working.

Code:
local arenas = {
	{ startPosition = { x = 1041, y = 985, z = 9 }, endPosition = { x = 1052, y = 991, z = 9 }, position = { x = 1035, y = 988, z = 8 } },
}
local arenaLeave = {x=1038, y=988, z=6}
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, arenaLeave, TRUE)
			doSendMagicEffect(tmp, CONST_ME_POFF)
			doSendMagicEffect(arenaLeave, CONST_ME_TELEPORT)
			doRemoveCondition(cid, CONDITION_INFIGHT)
			return FALSE
		end
	end
	return TRUE
end

Also, it's possible to make a time limit for the arena? Like players can fight up to 30 minutes and then they are teleported? I don't want both players teleported : /

Regards,
Hermes
 
Mm...
Thanks to Inspiro for this :)

Add it to constants.lua
Code:
Arenas_Positions = {
	{ startPosition = { x = 1041, y = 985, z = 9 }, endPosition = { x = 1052, y = 991, z = 9 }, position = { x = 1035, y = 988, z = 8 } },
}

Create a script called "arenawar.lua" in creaturescripts and add this :)
Code:
local arenaLeave = {x=1038, y=988, z=6}
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
	local tmp = getCreaturePosition(cid)
	for _, arena in ipairs(Arenas_Positions) 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) - getCreatureHealth(cid), TRUE)
			doTeleportThing(cid, arenaLeave, TRUE)
			doSendMagicEffect(tmp, CONST_ME_POFF)
			doSendMagicEffect(arenaLeave, CONST_ME_TELEPORT)
			doRemoveCondition(cid, CONDITION_INFIGHT)
			return FALSE
		end
	end
	return TRUE
end

Go to actions and create a script called "arenawar_lever.lua" and add this
Code:
local arenaEnter = {x=1035, y=988, z=8 }
local arenaLeave = {x=1038, y=988, z=6}
local tmp = getCreaturePosition(cid)

function teleportOutOfArena(cid)
	if(isPlayer(cid) == TRUE) then
		for _, arena in ipairs(Arenas_Positions) do
			if(isInArea(getCreaturePosition(cid), arena.startPosition, arena.endPosition) == TRUE) then
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Time up!")
				doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid), TRUE)
				doTeleportThing(cid, arenaLeave, TRUE)
				doSendMagicEffect(tmp, CONST_ME_POFF)
				doSendMagicEffect(arenaLeave, CONST_ME_TELEPORT)
				doRemoveCondition(cid, CONDITION_INFIGHT)
				return FALSE
			end
		end
	end
end

function onUse(cid, item, frompos, item2, topos)
	if(item.uid == UNIQUEIDOFLEVER) then
		doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid), TRUE)
		doTeleportThing(cid, arenaEnter, TRUE)
		addEvent(teleportOutOfArena, 1000*60*30, cid)
		return TRUE
	end
	return FALSE
end

The END :)
Test it and say me, i cant test u_u
 
Haha, sorry, it's working. By accident I have commented a line for this creaturescript in creaturescripts.xml >.> lol xDDD!!!

Close topic blz <,<
 
hey i need a arena that when you die you go to a certain spot but the person who kills you doesnt leave but stays in the arena, plus i dont want them to get a pvp skull when there fighting each other. can someone plz post a sript that can do that and tell me were i'm suppose to but everything
 
hey i need a arena that when you die you go to a certain spot but the person who kills you doesnt leave but stays in the arena, plus i dont want them to get a pvp skull when there fighting each other. can someone plz post a sript that can do that and tell me were i'm suppose to but everything

Read the full thread pages, StreamSide already made one!
 
Hermes, Streamside Thank you so much!!!!!!!! :p

Edid: Can anyone tell me what do I have put in actions.xml and creaturescripts.xml?
 
Last edited:
Go to creaturescripts.xml and add:
Code:
<event type="preparedeath" name="ArenaWar" script="arenawar.lua"/>

And in actions.xml add:
Code:
<action uniqueid="your.unique.id" script="arenawar_lever.lua"/>
or
Code:
<action actionid="your.action.id" script="arenawar_lever.lua"/>
 
Back
Top