Mam problem.
Silnik : TFS
Version : 0.3.3
Tibia : 8.41/8.42
Mam 3 skrypty do areny pvp i ..
Skrypt nr. 1 -
Skrypt nr. 2 -
Skrypt nr. 3 -
1) Nie wiem, który wybrać, który będzie mi działał.
2) Wkleić go muszę do actions\scripts ?
Jeśli tak to jaką linijkę muszę dodać do actions.xml
Proszę o pomoc.
btw. Jeśli żaden ze skryptów powyżej nie będzie działać proszę o poprawienie.
Silnik : TFS
Version : 0.3.3
Tibia : 8.41/8.42
Mam 3 skrypty do areny pvp i ..
Skrypt nr. 1 -
Code:
local arena = {
frompos = {x=187, y=406, z=10},
topos = {x=198, y=412, z=10},
exit = {x=185, y=409, z=9}
}
local function exitArena(p)
doSendMagicEffect(p.exit, 10)
doTeleportThing(p.cid, p.exit, FALSE)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
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
Skrypt nr. 2 -
Code:
local arena = {
frompos = {x=31950, y=32068, z=0},
topos = {x=32192, y=32256, z=15},
exit = {x=32097, y=32219, z=7}
}
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
if isPlayer(cid) == TRUE then
if isInArea(getPlayerPosition(cid), arena.frompos, arena.topos) then
if doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid), TRUE) == TRUE then
if doTeleportThing(cid, arena.exit) == TRUE then
doSendMagicEffect(arena.exit, 10)
doPlayerSendTextMessage(mostDamageKiller,MESSAGE_STATUS_CONSOLE_BLUE,'[ARENA] You have defeated '..getPlayerName(cid)..'!')
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,'[ARENA] You where defeated by '..getPlayerName(mostDamageKiller)..'!')
return FALSE
end
end
end
end
return TRUE
end
Skrypt nr. 3 -
Code:
local arenapos = {fromx=120, fromy=32, tox=129, toy=39, z=9}
local exit = {x=125, y=30, z=9}
function onPrepareDeath(cid, killer)
for x=arenapos.fromx, arenapos.tox do
for y=arenapos.fromy, arenapos.toy do
if comparePos(getPlayerPosition(cid), {x=x, y=y, z=arenapos.z}) then
doTeleportThing(cid, exit, TRUE)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
return TRUE
end
end
end
return FALSE
end
1) Nie wiem, który wybrać, który będzie mi działał.
2) Wkleić go muszę do actions\scripts ?
Jeśli tak to jaką linijkę muszę dodać do actions.xml
Proszę o pomoc.
btw. Jeśli żaden ze skryptów powyżej nie będzie działać proszę o poprawienie.