• 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!

Why remove "onPrepareDeath creatureEvent??

drosah

New Member
Joined
Aug 16, 2007
Messages
69
Reaction score
0
at the forgotten 0.2.11 we can make pvp arenas with onPrepareDeath event (an example i found at the forum)
local arena = {
frompos = {x=120, y=32, z=9},
topos = {x=129, y=39, z=9},
exit = {x=125, y=30, z=9}
}

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

function onPrepareDeath(cid, killer)
if isInArea(getPlayerPosition(cid), arena.frompos, arena.topos) then
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
addEvent(exitArena, 100, {cid=cid, exit=arena.exit})
end
return FALSE
end

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
but at forgotten 0.3 there is not prepareDeath events and onDeath events not working for it :/, cause when we put "return false" the player still dieing.

PS.: pvp areas not working
 
But then you have the bug that you can die after leaving the pvp zone and won't lose eq/skill
 
what do the pvp zones do? i mean if you have the world set to pvp then pvp tiles do nothing. we want a pvp arena were you can fight each other and you don't lose skill or anything when you die
 
A area that player die and do not lose skills is PVP ARENA.

wow thanks, i had no idea.....


anyway i though the pvp zones tiles did something like if you had the world type set to non-pvp but then put some pvp tiles it would make that area act like a it was pvp with the skulls and stuff in that area thats why i was confused
 
Remere's Map Editor? PVP Zone?

;P

yea i use rme ^^ pvp zone i belive when u die with pvp zone u will not get skull and no lose itens lvl skills etc when die :) (one think i now if u is at pvp zone and go to a normal zone and get battle u cant go to normal zone ^^ x)!

and when we put at ondeath function return false he ignores ^^ (will be usefull it cause we can make some scripts)
 
But just think a bit.
Let's say u want a pvp arena and if someone wins sth happends?
o.O

can this be also done with RME?!?

mfg
MicBird
 
Thats sad, tell me more about yourself.
I won't repeat more - PVP zones are for that.

if pvp zones are for that. How to create arena? (Players not loose stats and itens)
 
if pvp zones are for that. How to create arena? (Players not loose stats and itens)

Create a room on you map, 2 tiles and a switch next to one of them whom tps the players into the room. Beside the tiles you have a room. Put pvp zone in it and a teleport out. Voila! A pvp arena.

//Massen
 
As Massen said - using tiles for that.
onPrepareDeath was bugged, and wasn't working sometimes, fe. on an arena: You shoot someone for 1000 hp, he had 100 and he died anyway.
 
Why couldn't you simply fix that?

I'm working on more advanced arenas, where player get teleported depending on which team they are in. I actually do need onPrepareDeath and yeah it's quite bugged :/

Can't teleport player etc but why not just fix it? Is it too hard? Why remove the most usefull stuff? Maybe not usefull for you, but I need it very much.
 
Back
Top