Hermes
dziwki kola gramy w lola
Hi there,
many ppl are saying that this arena doesn't work in 0.3. Lol? I am using 0.3b2 and it's working.. erm.. almost. When player kills the monster, monster doesn't die, and it keeps attacking but it's not moving. Player is spammed with "Succeeded! Go ahead, warrior...". When the next player is going to the arena room with monster "killed" by previous player, this monster dissapears, and the right monster is spawned. Just everything is alright except removing killed monster.So maybe someone will know how to make the monster dissapear immediately after killing it by the right person.
Movement script:
onKill from creaturescripts
Additional things to login.lua
And I think it's all of important parts of this arena.
Thanks,
Hermes
many ppl are saying that this arena doesn't work in 0.3. Lol? I am using 0.3b2 and it's working.. erm.. almost. When player kills the monster, monster doesn't die, and it keeps attacking but it's not moving. Player is spammed with "Succeeded! Go ahead, warrior...". When the next player is going to the arena room with monster "killed" by previous player, this monster dissapears, and the right monster is spawned. Just everything is alright except removing killed monster.So maybe someone will know how to make the monster dissapear immediately after killing it by the right person.
Movement script:
Code:
function onStepIn(cid, item, position, fromPosition)
if InitArenaScript == 0 then
InitArenaScript = 1
checkArenaRooms({})
end
local arena_room = item.actionid
local player_arena = getPlayerStorageValue(cid, 42355)
if getPlayerStorageValue(cid, arena_room+getPlayerStorageValue(cid, 42355)*10-1) == 1 or arena_room+getPlayerStorageValue(cid, 42355)*10-1 == 42299 then
if getGlobalStorageValue(cid, arena_room) == 0 then
local monster_uid = getGlobalStorageValue(arena_room+100)
if monster_uid > 0 then
if isCreature(monster_uid) == TRUE then
doRemoveCreature(monster_uid)
end
end
local spawn_pos = getThingPos(arena_room)
local monster = doSummonCreature(arena_monsters[arena_room+getPlayerStorageValue(cid, 42355)*10], {x=spawn_pos.x-1,y=spawn_pos.y-1,z=spawn_pos.z})
setGlobalStorageValue(arena_room+100, monster)
doTeleportThing(cid, spawn_pos, TRUE)
setGlobalStorageValue(arena_room, cid)
setGlobalStorageValue(arena_room-1, 0)
setPlayerStorageValue(cid, 42350, os.time()+arena_room_max_time)
else
doTeleportThing(cid, fromPosition, TRUE)
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,getCreatureName(getGlobalStorageValue(cid, arena_room))..' was fighting above. Please wait, mortal!')
end
else
doTeleportThing(cid, fromPosition, TRUE)
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,'First kill the monster!')
end
if arena_room == 42300 then
setPlayerStorageValue(cid, 42351, 0)
setPlayerStorageValue(cid, 42352, 1)
end
return TRUE
end
function checkArenaRooms(param)
addEvent(checkArenaRooms, 1000, {})
for i = 42300, 42309 do
local player = getGlobalStorageValue(i)
if isPlayer(player) == TRUE then
local player_storage = getPlayerStorageValue(player, 42350)
if player_storage <= os.time() then
doTeleportThing(player, arenaKickPosition, TRUE)
setPlayerStorageValue(player, 42350, 0)
setGlobalStorageValue(i, 0)
doPlayerSendTextMessage(player,MESSAGE_STATUS_CONSOLE_ORANGE,'You are doomed!')
elseif player_storage - 10 <= os.time() then
doPlayerSendTextMessage(player,MESSAGE_EVENT_DEFAULT,'You have ' .. player_storage - os.time() .. ' seconds left to advance to the next room!')
end
else
setGlobalStorageValue(i, 0)
end
end
end
onKill from creaturescripts
Code:
function onKill(cid, target)
local monster = getCreatureName(target)
local room = getArenaMonsterIdByName(monster)
if room > 0 then
setPlayerStorageValue(cid, room, 1)
doPlayerSendTextMessage(cid,MESSAGE_EVENT_DEFAULT,'Succeeded! Go ahead, warrior...')
end
end
Additional things to login.lua
Code:
registerCreatureEvent(cid, "PlayerKill")
if (InitArenaScript ~= 0) then
InitArenaScript = 1
-- make arena rooms free
for i = 42300, 42309 do
setGlobalStorageValue(i, 0)
setGlobalStorageValue(i+100, 0)
end
end
-- if he did not make full arena 1 he must start from zero
if getPlayerStorageValue(cid, 42309) < 1 then
for i = 42300, 42309 do
setPlayerStorageValue(cid, i, 0)
end
end
-- if he did not make full arena 2 he must start from zero
if getPlayerStorageValue(cid, 42319) < 1 then
for i = 42310, 42319 do
setPlayerStorageValue(cid, i, 0)
end
end
-- if he did not make full arena 3 he must start from zero
if getPlayerStorageValue(cid, 42329) < 1 then
for i = 42320, 42329 do
setPlayerStorageValue(cid, i, 0)
end
end
if getPlayerStorageValue(cid, 42355) == -1 then
setPlayerStorageValue(cid, 42355, 0) -- did not arena level
end
setPlayerStorageValue(cid, 42350, 0) -- time to kick 0
setPlayerStorageValue(cid, 42352, 0) -- is not in arena
And I think it's all of important parts of this arena.
Thanks,
Hermes
Last edited: