• 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:
@Flyde
I mean script which teleports you on XYZ tile after death, etc.. Without PZ after attacking player.
 
Maybe someone can make script, which if player dies, checks his position. If his position is equal to fromx= fromy= fromz= and tox= toy= toz= player is teleported to tile x= y= z=, and PZlock (from fighting) is cleaned. Also I need script for teleport in arena. If player steps on it (movements, tile under teleport), he is teleported to x= y= z=, and then PZlock is cleaned too.
 
Last edited:
You will not be able to do it in alpha 4, since it does not have onPrepareDeath, which already is in Beta 1.
 
function.lua:
Code:
function isInArea(pos, fromPos, toPos)
    if pos.x >= fromPos.x and pos.x <= toPos.x then
        if pos.y >= fromPos.y and pos.y <= toPos.y then
            if pos.z >= fromPos.z and pos.z <= toPos.z then
                return true
            end
        end
    end
    return false
end
script:
Code:
local config = {
	fromPos = { x = 10, y = 10, z 6},
	toPos = { x = 15, y = 20, z = 7},
	positionOut = { x = 17, y = 22, z = 7 },
}

function onPrepareDeath(cid, lastHitKiler, mostDamageKiller)
	if inInArea(getCreaturePosition(cid), config.fromPos, config.toPos) == TRUE then
		doTeleportThing(cid, config.positionOut, 0)
		doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have been defeated by "..lastHitKiller..".")
	return TRUE
end
 
Thank you, Marcinek. I will test it tomor.. erm.. today :D, but later. I think it's working so I don't have to worry :).

Regards,
Hermes
 
isInArea -> data/lib/function.lua
script -> data/creaturescripts/scripts/something.lua
data/creaturescripts/creaturescripts.xml ->
Code:
<event type="prepareDeath" name="arena" script="something.lua"/>

data/creaturescripts/scripts/login.lua ->
Code:
registerCreatureEvent(cid, "arena")

Think thats all.
 
It's not working.

First of all one end was missing and there must be isInArea not inInArea (misspelling):

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, 0)
		doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have been defeated by "..lastHitKiller..".")
	return TRUE
	end
end

Yea. After killing player, player is still standing. I can somewhat attack him (always my hit misses). I can throw explosion on him (hit - 0). Etc:

ss1yn5.jpg



ss2sx3.jpg



ss3cp6.jpg



ss4qr0.jpg



ss5zf6.jpg


But when I'm logging out seeing this died character (hm, not really died. He had 0 hp and in his tibia he still can see everything, but he was unable to do anything) the tibia is crashing and the server is crashing too. Here is my report from report.txt:

Code:
*****************************************************
Error report - Sun Dec 14 16:10:57 2008

Compiler info - gcc 3.4.5 (mingw special)
Compilation Date - Dec  1 2008 08:16:01

Memory load: 72
Total phys: 1046508 K available phys: 290688 K
Start time: 14-12-2008  14:56:23
Kernel time: 0:0:1.31
User time: 0:0:6.15
Threads: 4

Exception: 0xc0000005 at eip = 0x5059c8(ScriptEnviroment::addThing(Thing*) - 0x505968)
eax = 0
ebx = 0x820acc -> 0
ecx = 0x2dd0268 -> 0x1
edx = 0x1bdfc6c -> 0x820acc
esi = 0x1bdfc6c -> 0x820acc
edi = 0x58fb368 -> 0
ebp = 0x1bdfc80 -> 0x1bdfcb0
esp = 0x1bdfc38 -> 0x58fb368
efl = 0x10246

---Stack Trace---
From: 0x1bdfc38 to: 0x1be0000
0x1bdfc38 | 0x58fb368 -> 0
0x1bdfc3c | 0x1bdfc50 -> 0x10001025
0x1bdfc40 | 0x7edba8 -> 0
0x1bdfc44 | 0x2eb7a38 -> 0x2e8ffa8
0x1bdfc48 | 0x1bdfd44 -> 0x821334
0x1bdfc4c | 0x820aa0 -> 0x81b408
0x1bdfc50 | 0x10001025 -> 0x9090c308
0x1bdfc54 | 0
0x1bdfc58 | 0x1bdfc74 -> 0x820aa0
0x1bdfc5c | 0
0x1bdfc60 | 0x2de62ec -> 0
0x1bdfc64 | 0x2de62ec -> 0
0x1bdfc68 | 0x49452200
0x1bdfc6c | 0x820acc -> 0
0x1bdfc70 | 0x1bd0000
0x1bdfc74 | 0x820aa0 -> 0x81b408
0x1bdfc78 | 0x2de66e8 -> 0x81c448
0x1bdfc7c | 0
0x1bdfc80 | 0x1bdfcb0 -> 0x1bdfce0 \\\\\\ stack frame //////
0x1bdfc84 | 0x4544c0 -> 0x4d8bc689 <-- ret
0x1bdfc84  CreatureEvent::executeOnPrepareDeath(Creature*, Creature*, Creature*)(0x4543c4)
0x1bdfc88 | 0x820aa0 -> 0x81b408
0x1bdfc8c | 0x58fb368 -> 0
0x1bdfc90 | 0x2de6010 -> 0x81c16c
0x1bdfc94 | 0x2de6010 -> 0x81c16c
0x1bdfc98 | 0
0x1bdfc9c | 0x10001025 -> 0x9090c308
0x1bdfca0 | 0x24adf60 -> 0x81ae28
0x1bdfca4 | 0
0x1bdfca8 | 0x2de6010 -> 0x81c16c
0x1bdfcac | 0
0x1bdfcb0 | 0x1bdfce0 -> 0x1bdfd50 \\\\\\ stack frame //////
0x1bdfcb4 | 0x44e50c -> 0xba <-- ret
0x1bdfcb4  Creature::onDeath()(0x44e414)
0x1bdfcb8 | 0x24adf60 -> 0x81ae28
0x1bdfcbc | 0x2de6010 -> 0x81c16c
0x1bdfcc0 | 0
0x1bdfcc4 | 0x2db2dd0 -> 0x2dc7800
0x1bdfcc8 | 0x1bdfcf0 -> 0x1bdfdb4
0x1bdfccc | 0x1001da4 -> 0
0x1bdfcd0 | 0x1bdfd00 -> 0x1bdfd30
0x1bdfcd4 | 0x2eb7a38 -> 0x2e8ffa8
0x1bdfcd8 | 0x821334 -> 0x246d800
0x1bdfcdc | 0x33c
0x1bdfce0 | 0x1bdfd50 -> 0x1bdfe40 \\\\\\ stack frame //////
0x1bdfce4 | 0x5c45eb -> 0xba <-- ret
0x1bdfce4  Player::onDeath()(0x5c45d4)
0x1bdfce8 | 0x2de6010 -> 0x81c16c
0x1bdfcec | 0x7edbdc -> 0x2dc1d48
0x1bdfcf0 | 0x1bdfdb4 -> 0x1bdfe74
0x1bdfcf4 | 0x2
0x1bdfcf8 | 0x7edba0 -> 0x81d628
0x1bdfcfc | 0
0x1bdfd00 | 0x1bdfd30 -> 0x1bdfd50
0x1bdfd04 | 0x7acf91 -> 0x8be8458b
0x1bdfd2c | 0
0x1bdfd30 | 0x1bdfd50 -> 0x1bdfe40
0x1bdfd34 | 0x605393 -> 0x8404ec83
0x1bdfd34  Scheduler::addEvent(SchedulerTask*)(0x605304)
0x1bdfd38 | 0x7edbc0 -> 0x246a48
0x1bdfd3c | 0x1bdfd5c -> 0
0x1bdfd40 | 0x821260 -> 0x81bb68
0x1bdfd44 | 0x821334 -> 0x246d800
0x1bdfd48 | 0x33c
0x1bdfd4c | 0
0x1bdfd50 | 0x1bdfe40 -> 0x1bdfe50 \\\\\\ stack frame //////
0x1bdfd54 | 0x4828af -> 0x3575c084 <-- ret
0x1bdfd54  Game::checkCreatures()(0x4823c0)
0x1bdfd58 | 0x2de6010 -> 0x81c16c
0x1bdfd5c | 0
0x1bdfd60 | 0x1
0x1bdfd64 | 0x821260 -> 0x81bb68
0x1bdfd68 | 0
0x1bdfd6c | 0x252c10 -> 0
0x1bdfd70 | 0x1bdff5c -> 0x1bdffa4
0x1bdfd74 | 0xb
0x1bdfdd8  Game::checkCreatures()(0x4823c0)
0x1bdfdfc  Game::checkCreatures()(0x4823c0)
0x1bdfe08  Game::checkCreatures()(0x4823c0)
0x1bdfe14  Game::checkCreatureWalk(unsigned int)(0x4821dc)
0x1bdfe1c | 0x4823c0 -> 0x57e58955
0x1bdfe1c  Game::checkCreatures()(0x4823c0)
0x1bdfe20 | 0
0x1bdfe24 | 0x821260 -> 0x81bb68
0x1bdfe28 | 0x18
0x1bdfe2c | 0x800003f7
0x1bdfe30 | 0x1bdfe50 -> 0x1bdfef0
0x1bdfe34 | 0x821260 -> 0x81bb68
0x1bdfe38 | 0x186
0x1bdfe3c | 0xc
0x1bdfe40 | 0x1bdfe50 -> 0x1bdfef0 \\\\\\ stack frame //////
0x1bdfe44 | 0x73f014 -> 0x5b04c483 <-- ret
0x1bdfe48 | 0x821260 -> 0x81bb68
0x1bdfe4c | 0x101c520 -> 0xaefe8d81
0x1bdfe50 | 0x1bdfef0 -> 0x1bdff80 \\\\\\ stack frame //////
0x1bdfe54 | 0x77476f -> 0x8984458d <-- ret
0x1bdfe58 | 0x2eb3fe0 -> 0x4823c0
0x1bdfe5c | 0x1bdfe90 -> 0x7e8b5c
0x1bdfe60 | 0x1bdfef0 -> 0x1bdff80
0x1bdfe64 | 0x5aed4c -> 0x8bf45d8b
0x1bdfe64  OutputMessagePool::sendAll()(0x5aeb14)
0x1bdfe68 | 0x1fe94
0x1bdfe6c | 0x3
0x1bdfe70 | 0x2eb3fdc -> 0x7eda3c
0x1bdfe74 | 0x19df374 -> 0x19df804
0x1bdfeb4  OutputMessagePool::startExecutionFrame()(0x5ae4c6)
0x1bdfecc | 0xffc4033c
0x1bdfed0 | 0x77c10000 -> 0xe85077c0
0x1bdfed4 | 0x6cea0d -> 0x9090c3c9
0x1bdfed8 | 0x1b9e6b40 -> 0x2b43320
0x1bdfedc | 0x7c802600 -> 0x90000cc2
0x1bdfee0 | 0x1bdfef0 -> 0x1bdff80
0x1bdfee4 | 0x101c520 -> 0xaefe8d81
0x1bdfee8 | 0x186
0x1bdfeec | 0xc
0x1bdfef0 | 0x1bdff80 -> 0x1bdffb4 \\\\\\ stack frame //////
0x1bdfef4 | 0x63c8a4 -> 0x907d83 <-- ret
0x1bdfef4  Dispatcher::dispatcherThread(void*)(0x63c588)
0x1bdfef8 | 0x2eb3fdc -> 0x7eda3c
0x1bdfefc | 0xffffffff
0x1bdff00 | 0x1010000 -> 0xc8
0x1bdff04 | 0
0x1bdff08 | 0x86da0bc8
0x1bdff0c | 0x9
0x1bdff10 | 0x2eb3fd8 -> 0x81af38
0x1bdff14 | 0x19dfed4 -> 0x133ff14
0x1bdff38  Dispatcher::dispatcherThread(void*)(0x63c588)
0x1bdff5c | 0x1bdffa4 -> 0x1bdffdc
0x1bdff60 | 0x45ded0 -> 0x57e58955
0x1bdff60  _SEHHandler(_EXCEPTION_RECORD*, void*, _CONTEXT*, void*)(0x45ded0)
0x1bdff64 | 0x804f4194
0x1bdff68 | 0x1bdff4c -> 0xffc40186
0x1bdff6c | 0x85feda24
0x1bdff70 | 0x1bdffa4 -> 0x1bdffdc
0x1bdff74 | 0x101c520 -> 0xaefe8d81
0x1bdff78 | 0x101c640 -> 0x9bc
0x1bdff7c | 0xc
0x1bdff80 | 0x1bdffb4 -> 0x1bdffec \\\\\\ stack frame //////
0x1bdff84 | 0x77c2a243 -> 0xff4be859 <-- ret
0x1bdff88 | 0
0x1bdff8c | 0xc
0x1bdff90 | 0x1063f10 -> 0x249960
0x1bdff94 | 0x101c520 -> 0xaefe8d81
0x1bdff98 | 0
0x1bdff9c | 0x1bdff8c -> 0xc
0x1bdffa0 | 0
0x1bdffa4 | 0x1bdffdc -> 0xffffffff
0x1bdffa8 | 0x77c25c94 -> 0x83ec8b55
0x1bdffac | 0x77c040c8 -> 0xffffffff
0x1bdffb0 | 0
0x1bdffb4 | 0x1bdffec -> 0 \\\\\\ stack frame //////
0x1bdffb8 | 0x7c80b713 -> 0x9cfe850 <-- ret
0x1bdffbc | 0x101c520 -> 0xaefe8d81
0x1bdffc0 | 0xc
0x1bdffc4 | 0x1063f10 -> 0x249960
0x1bdffc8 | 0x101c520 -> 0xaefe8d81
0x1bdffcc | 0x7ffdc000 -> 0x1bdf87c
0x1bdffd0 | 0x86fbc600
0x1bdffd4 | 0x1bdffc0 -> 0xc
0x1bdffd8 | 0x8608c410
0x1bdffdc | 0xffffffff
0x1bdffe0 | 0x7c839ac0 -> 0x83ec8b55
0x1bdffe4 | 0x7c80b720 -> 0xffffffff
0x1bdffe8 | 0
0x1bdffec | 0 \\\\\\ stack frame //////
0x1bdfff0 | 0 <-- ret
0x1bdfff4 | 0x77c2a1d7 -> 0xc8680c6a
0x1bdfff8 | 0x101c520 -> 0xaefe8d81
0x1bdfffc | 0
*****************************************************

And I need movement, which onStepIn teleports player to tile XYZ, removes his PZlock and all conditiond he has.

Thanks,
Hermes
 
Last edited:
Put the return TRUE above the last end, if the player still will be standing change it to return FALSE.
 
Back
Top