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

TFS 1.X+ Raids! ASK

Nuelman

Member
Joined
Nov 9, 2017
Messages
98
Solutions
1
Reaction score
6
it is possible that when a raid is executed, a magic wall is removed from a specific place?

version 10.99
 
ok , I undeastand, but , where I put itemid?
item id: 1498 ( magic wall )
position? 32999, 32301, 7

local item = Tile(32999, 32301, 7):getItemById(1498)
if item then
item:remove()
end

correct?
 
Lua:
local mwallPos = Position(32999, 32301, 7)
local mwallId = 1498
local item = Tile(mwallPos):getItemById(mwallId)
if item then
   item:remove()
end
 
now the magic wall never appears!,
What I want is, when I run a raid, the magic wall disappears

example:

/raid Ferumbras ( magic wall disappears )removed

Lua:
function onRaid()
 local monster = Game.createMonster("White Pale", Position(32224, 32761, 10))
 monster:setReward(true)
 end
local mwallPos = Position(32999, 32301, 7)
local mwallId = 1498
local item = Tile(mwallPos):getItemById(mwallId)
if item then
   item:remove()
end
 
but when I start my server with this configuration. The magic wall no longer exists...

I want the magic wall to be removed when the raid is executed
Post automatically merged:

I can't get it to work the way I want it to.
I should eliminate the magic wall juto the moment the raid is executed
 
Last edited:
Lua:
function onRaid()
    local monster = Game.createMonster("White Pale", Position(32224, 32761, 10))
    monster:setReward(true)
    local mwallPos = Position(32999, 32301, 7)
    local mwallId = 1498
    local item = Tile(mwallPos):getItemById(mwallId)
    if item then
        item:remove()
    end
end
 
OK now work. !!!!!!!!!
Thanks you....

is it possible to put a time limit on the boss?
That is, if no one kills him, after two hours he disappears, so they don't accumulate.
after that time the magic wall is created again?

THANKS
 
Use this instead. @up is unsafe.

Lua:
local mwallPos = Position(32999, 32301, 7)
local mwallId = 1498
local timeToRemove = 120 -- 120 minutes / 2 hours

function onRaid()
    local monster = Game.createMonster("White Pale", Position(32224, 32761, 10))
    monster:setReward(true)
    local item = Tile(mwallPos):getItemById(mwallId)
    if item then
        item:remove()
    end
    addEvent(removeBossCreateWall, timeToRemove * 60 * 1000, monster:getId())
end

function removeBossCreateWall(monsterId)
    local item = Tile(mwallPos):getItemById(mwallId)
    if not item then
        Game.createItem(mwallId, 1, mwallPos)
    end

    local boss = Monster(monsterId)

    if boss then
        boss:remove()
    end
end
 
Ok , you are a genius.
Everything works perfectly except the message of the raid:
example on this raid :
Tyrn.lua
Lua:
local mwallPos = Position(32999, 32301, 7)
local mwallId = 1498
local timeToRemove = 120 -- 120 minutes / 2 hours

function onRaid()
 local monster = Game.createMonster("Tyrn", Position(33094, 32404, 13))
    monster:setReward(true)
    local item = Tile(mwallPos):getItemById(mwallId)
    if item then
        item:remove()
    end
    addEvent(removeBossCreateWall, timeToRemove * 60 * 1000, monster:getId())
end

function removeBossCreateWall(monsterId)
    local item = Tile(mwallPos):getItemById(mwallId)
    if not item then
        Game.createItem(mwallId, 1, mwallPos)
    end

    local boss = Monster(monsterId)

    if boss then
        boss:remove()
    end
end

Tyrn.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<raid>
    <!--
    // Raid System by 5mok3
    // DO NOT CHANGE INTERVAL UNLESS YOU ARE SURE WHAT YOU ARE DOING!!
    -->

    <!--Announcements-->
    <script delay="1000" script="Tyrn.lua" />
    <announce delay="1000" type="event" message="Beware of Tyrn!" />
  <!--Single Spawns-->
 <!-- <singlespawn delay="1000" name="Tyrn" x="33094" y="32404" z="13" /> -->
</raid>

Does not show the message : ...
ype="event" message="Beware of Tyrn!" />

why?

Thanks again !
 
I've never actually played around with raids, so I'm not sure if the xml syntax is right; you can send the message with Lua
Add the following on line 6 under "function onRaid()"
Lua:
Game.broadcastMessage("Beware of Tyrn!", MESSAGE_EVENT_ADVANCE)
 
Ok it works correctly,
Finally, and to finish,
Is it possible that this raid will take place on a particular day?

I mean, for example, that Raid Tyrn is executed every Wednesday at 7:00 p.m.

Thanks you for u work
 
Ok , lo probe y lo edite, pero al iniciar el server recibo este error,:

Code:
[Warning - Event::checkScript] Can not load script: scripts/spawn/raids.lua
data/globalevents/scripts/spawn/raids.lua:12: '}' expected (to close '{' at line 9) near '['



que puede ser?


Lua:
local raids = {
    -- Weekly
    ['Monday'] = {
        ['08:00'] = {raidName = 'RatsThais'},

        ['18:00'] = {raidName = 'Roshaevil'}
    },

    ['Tuesday'] = {
        ['18:00'] = {raidName = 'Falangon'}
        
        ['19:00'] = {raidName = 'Midnight Panther'}
        
    },
    
    ['Wednesday'] = {
        ['15:00'] = {raidName = 'Draptor'}
        
        ['18:00'] = {raidName = 'Sinistrus'}
    },
    
    ['Thursday'] = {
        ['18:00'] = {raidName = 'Nelsus'}
        
        ['21:00'] = {raidName = 'Undead Cavebear'}
    },
    
    ['Friday'] = {
        ['18:00'] = {raidName = 'Jaul'}
        
        ['21:00'] = {raidName = 'Titanica'}
    },
    
    ['Saturday'] = {
        ['18:00'] = {raidName = 'Obujos'}
        
        ['23:00'] = {raidName = 'Draptor'}
    },
    
    ['Sunday'] = {
        ['18:00'] = {raidName = 'Tanjis'}
        
        ['20:00'] = {raidName = 'Undead Cavebear'}
    },

    -- By date (Day/Month)
    ['31/10'] = {
        ['16:00'] = {raidName = 'Halloween Hare'}
    }
}

function onThink(interval, lastExecution, thinkInterval)
    local day, date = os.date('%A'), getRealDate()

    local raidDays = {}
    if raids[day] then
        raidDays[#raidDays + 1] = raids[day]
    end
    if raids[date] then
        raidDays[#raidDays + 1] = raids[date]
    end

    if #raidDays == 0 then
        return true
    end

    for i = 1, #raidDays do
        local settings = raidDays[i][getRealTime()]
        if settings and not settings.alreadyExecuted then
            Game.startRaid(settings.raidName)
            settings.alreadyExecuted = true
        end
    end

    return true
end
 
Back
Top