seriousots
New Member
- Joined
- Mar 5, 2021
- Messages
- 8
- Reaction score
- 2
Lua:
local config = {
requiredLevel = 100,
daily = true,
roomCenterPosition = Position(32997, 32212, 15),
playerPositions = {
Position(32997, 32228, 15),
Position(32997, 32229,15),
Position(32997, 32230, 15),
Position(32997, 32231, 15),
Position(32997, 32232,15)
},
teleportPosition = Position(32997, 32212, 15),
bossPosition = Position(32997, 32209, 15)
}
local leverboss = Action()
function leverboss.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if item.itemid == 9825 then
-- Check if the player that pulled the lever is on the correct position
if player:getPosition() ~= config.playerPositions[1] then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You can\'t start the battle.")
return true
end
local team, participant = {}
for i = 1, #config.playerPositions do
participant = Tile(config.playerPositions[i]):getTopCreature()
-- Check there is a participant player
if participant and participant:isPlayer() then
-- Check participant level
if participant:getLevel() < config.requiredLevel then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE,
"Todos precisam ser level ".. config.requiredLevel .." ou mais.")
return true
end
-- Check participant boss timer
if config.daily and participant:getStorageValue(Storage.Kilmaresh.fr02) > os.time() then
player:getPosition():sendMagicEffect(CONST_ME_POFF)
player:sendCancelMessage("Um ou mais jogadores, ainda nao esperou o cooldown do boss!")
return true
end
team[#team + 1] = participant
end
end
-- Check if a team currently inside the boss room
local specs, spec = Game.getSpectators(config.roomCenterPosition, false, false, 6, 6, 6, 6)
for i = 1, #specs do
spec = specs[i]
if spec:isPlayer() then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Ja tem um time na sala")
return true
end
spec:remove()
end
-- Spawn boss
Game.createMonster("Razzagorn", config.bossPosition)
-- Teleport team participants
for i = 1, #team do
team[i]:getPosition():sendMagicEffect(CONST_ME_POFF)
team[i]:teleportTo(config.teleportPosition)
-- Assign boss timer
team[i]:setStorageValue(Storage.Kilmaresh.fr02, os.time() + 4*60*60) -- 20 hours
end
config.teleportPosition:sendMagicEffect(CONST_ME_ENERGYAREA)
end
item:transform(9825)
return true
end
leverboss:uid(42432)
leverboss:register()
I HAVE ONE QUEST PLEASE HELP ME
I USE TFS1.3 REVSCRIPTS, AN AMEK ONE SYSTEM WITH BOSS...
THIS SYSTEM IS FOR 5 PLAYERS GO TO ROOM AND KILL BOSS
SO HAVE OTHER TEAM MAKE BOSS, AND OTHER PLAYER PUSH LEVER ... BOSS IS ROOM LEAVE
REVISE MY SCRIPT AND ADD TIME IN ROOM AND VERIFY SO HAVE OTHER PLAYERS DONT REMOVE BOSS INS ROOM
Post automatically merged:
bump
Last edited: