local config = {
[1] = {x_storage = 11111, x_storage_value = 1, teleport_pos = {x = 1397, y = 1416, z = 7}, boss_name = "rat", boss_position = {x = 1398, y = 1416, z = 7}, boss_chamber_top_left_pos = {x = 1397, y = 1416, z = 7}, boss_chamber_bottom_right_pos = {x = 1398, y = 1417, z = 7}},
[2] = {x_storage = 11111, x_storage_value = 1, teleport_pos = {x = 1000, y = 1000, z = 7}, boss_name = "boss", boss_position = {x = 1000, y = 1000, z = 7}, boss_chamber_top_left_pos = {x = 1900, y = 1900, z = 6}, boss_chamber_bottom_right_pos = {x = 2100, y = 2100, z = 8}},
[3] = {x_storage = 11111, x_storage_value = 1, teleport_pos = {x = 1000, y = 1000, z = 7}, boss_name = "boss", boss_position = {x = 1000, y = 1000, z = 7}, boss_chamber_top_left_pos = {x = 1900, y = 1900, z = 6}, boss_chamber_bottom_right_pos = {x = 2100, y = 2100, z = 8}}
}
local condition = createConditionObject(CONDITION_INFIGHT)
setConditionParam(condition, CONDITION_PARAM_TICKS, 5000)
function onStepIn(cid, item, position, fromPosition)
if not isPlayer(cid) then
return true
end
for i = 1, #config do
if getPlayerStorageValue(cid, config[i].x_storage) == config[i].x_storage_value then
local count = 0
local monster = 0
for t = config[i].boss_chamber_top_left_pos.x, config[i].boss_chamber_bottom_right_pos.x do
for f = config[i].boss_chamber_top_left_pos.y, config[i].boss_chamber_bottom_right_pos.y do
for n = config[i].boss_chamber_top_left_pos.z, config[i].boss_chamber_bottom_right_pos.z do
pos = {x = t, y = f, z = n}
pid = getTopCreature(pos).uid
if isPlayer(pid) then
count = count + 1
end
if isMonster(pid) then
monster = pid
end
end
end
end
if count ~= 0 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Someone is currently in " .. config[i].boss_name .. "'s chamber. Please wait awhile.")
doTeleportThing(cid, fromPosition)
doSendMagicEffect(fromPosition, 10)
return true
end
if monster ~= 0 then
doRemoveCreature(monster)
end
doSendMagicEffect(position, 10)
doTeleportThing(cid, config[i].teleport_pos)
doAddCondition(cid, condition)
local delay = 1000
for n = 1, 3 do
addEvent(doSendMagicEffect, delay, config[i].boss_position, 10)
delay = delay + 1000
end
addEvent(doCreateMonster, 4000, config[i].boss_name:lower(), config[i].boss_position)
return true
end
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don't have any required quests completed to access this portal.")
doTeleportThing(cid, fromPosition)
doSendMagicEffect(fromPosition, 10)
return true
end
--[[
<movevent type="StepIn" actionid="45001" event="script" value="test35.lua"/>
]]