• 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.2] Raid Starter with Cooldown 2.0

strutZ

Australian OT Member {AKA Beastn}
Joined
Nov 16, 2014
Messages
1,391
Solutions
7
Reaction score
550
Hello Otland!
I have converted my modal window raid starter script to use @Non Sequitur modal window system which can be found HERE

You will have to install that in order to be able to use this system.

Why use this one instead?
Much cleaner then the last version you just need to add the action script and the lib files. There is no need to register the scripts on login.lua or add creaturescripts!

Information on the system
It has an easy config section for you to customize it how you would like it! You just need to fill out the config table found in the action script (pictured below)
Code:
-- Config
   raidStorage = 12345,
   cost = 50000,
   cooldown = 1800,
   moneyMsg = "You dont have enough money.",
   mainTitle = "Pick a Raid!",
   mainMsg = "Pick the raid you wish to start. Each raid will cost you 50k",
-- End Config

Installation

1)
Install the modal window helper HERE

2) Register the script in /data/actions/actions.xml by adding this line (Replacing "ITEMID" with the item you want to use: (Note you can use an action ID aswell)
Code:
    <action itemid="ITEMID" script="start_bossRaid.lua"/>
Code:
    <action actionid="ACTIONID" script="start_bossRaid.lua"/>
3) Create a new text document in /data/actions/scripts and name it "start_bossRaid.lua" and paste the following:
http://pastebin.com/Ztp9BKB2
4) Add the following line to your global.lua:
Code:
dofile('data/lib/start_bossRaid.lua')
5) Create a new text document in /data/lib/ and name it "start_bossRaid.lua" and paste the following:
http://pastebin.com/W3cqdAm1

Enjoy =)
 
Got the modalwindow going! Looks really cool!
Thanks!

But I just realized I have none of those raids on my server, is there a way to download them arround here?
 
So i did what the post said and i got this error, any suggestions? I am also using tfs 1.2

izc7N01.png


So the window opens to spawn a raid but when i click it and click Confirm i get the error

7L4b7Jn.png


I believe i have added them correctly

8GkrffA.png


r9gPxaZ.png


I have also added the actions script
 
Last edited:
So i did what the post said and i got this error, any suggestions? I am also using tfs 1.2

izc7N01.png


So the window opens to spawn a raid but when i click it and click Confirm i get the error

7L4b7Jn.png


I believe i have added them correctly

8GkrffA.png


r9gPxaZ.png


I have also added the actions script
 
Code:
local raids = {
-- Config
    raidStorage = 12345,
    cost = 500000,
    cooldown = 1800,
    moneyMsg = "You dont have enough money.",
    mainTitle = "Pick a Raid!",
    mainMsg = "Pick the raid you wish to start. Each raid will cost you 500k",
-- End Config 

    -- Table of available raids
    [1] = {raid = 'Demodras'},
    [2] = {raid = 'Ethershreck'},
    [3] = {raid = 'Ferumbras'},
    [4] = {raid = 'Furyosa'},
    [5] = {raid = 'Ghazbaran'},
    [6] = {raid = 'Horned Fox'},
    [7] = {raid = 'Mad Mage'},
    [8] = {raid = 'Morgaroth'},
    [9] = {raid = 'Necropharus'},
    [10] = {raid = 'Orshabaal'},
    [11] = {raid = 'Raging Mage'},
    [12] = {raid = 'The Old Widow'},
    [13] = {raid = 'Zanakeph'},
    [14] = {raid = 'Zulazza the Corruptor'}
}

function onUse(player, item, fromPosition, itemEx, toPosition, isHotkey)

    -- Check if system is on cooldown
    if Game.getStorageValue(raids.raidStorage) > os.time() then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You must wait ".. showTimeLeft(Game.getStorageValue(raids.raidStorage) - os.time(), true) ..", before you can start another boss raid.")
        item:getPosition():sendMagicEffect(CONST_ME_POFF)
    return false
    end
    player:sendBossRaidWindow(raids)
    return true
end
 
Nothing? :S i'd really like to use your script :p
Sorry thought i replied. I made an error.

1) Go to /data/lib/start_bossRaid.lua
2) then go to line 13
3) replace this
Code:
 if self:getMoney() < cost then
with this
Code:
if self:getMoney() < raids.cost then
 
Code:
local raids = {
-- Config
    raidStorage = 12345,
    cost = 500000,
    cooldown = 1800,
    moneyMsg = "You dont have enough money.",
    mainTitle = "Pick a Raid!",
    mainMsg = "Pick the raid you wish to start. Each raid will cost you 500k",
-- End Config

    -- Table of available raids
    [1] = {raid = 'Demodras'},
    [2] = {raid = 'Ethershreck'},
    [3] = {raid = 'Ferumbras'},
    [4] = {raid = 'Furyosa'},
    [5] = {raid = 'Ghazbaran'},
    [6] = {raid = 'Horned Fox'},
    [7] = {raid = 'Mad Mage'},
    [8] = {raid = 'Morgaroth'},
    [9] = {raid = 'Necropharus'},
    [10] = {raid = 'Orshabaal'},
    [11] = {raid = 'Raging Mage'},
    [12] = {raid = 'The Old Widow'},
    [13] = {raid = 'Zanakeph'},
    [14] = {raid = 'Zulazza the Corruptor'}
}

function onUse(player, item, fromPosition, itemEx, toPosition, isHotkey)

    -- Check if system is on cooldown
    if Game.getStorageValue(raids.raidStorage) > os.time() then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You must wait ".. showTimeLeft(Game.getStorageValue(raids.raidStorage) - os.time(), true) ..", before you can start another boss raid.")
        item:getPosition():sendMagicEffect(CONST_ME_POFF)
    return false
    end
    player:sendBossRaidWindow(raids)
    return true
end

This is not start_bossRaid.lua, lol.
 
You need to re-read that ;d it is the same script.

edit: It works now thanks alot man :)

You posted the action script not the lib where the error was lol thats what his saying.
 
You posted the action script not the lib where the error was lol thats what his saying.
Oh lol no problem my bad haha xD also i have one more problem, i dont know if it will be easy to fix or hard ;P

TWWxu0W.png


Code:
local raids = {
-- Config
    raidStorage = 12345,
    cost = 500000,
    cooldown = 300,
    moneyMsg = "You dont have enough money.",
    mainTitle = "Pick a Raid!",
    mainMsg = "Pick the raid you wish to start. Each raid will cost you 500k",
-- End Config  

    -- Table of available raids
    [1] = {raid = 'Demodras'},
    [2] = {raid = 'Ethershreck'},
    [3] = {raid = 'Ferumbras'},
    [4] = {raid = 'Furyosa'},
    [5] = {raid = 'Ghazbaran'},
    [6] = {raid = 'Horned Fox'},
    [7] = {raid = 'Mad Mage'},
    [8] = {raid = 'Morgaroth'},
    [9] = {raid = 'Necropharus'},
    [10] = {raid = 'Orshabaal'},
    [11] = {raid = 'Raging Mage'},
    [12] = {raid = 'The Old Widow'},
    [13] = {raid = 'Zanakeph'},
    [14] = {raid = 'Zulazza the Corruptor'}
}

function onUse(player, item, fromPosition, itemEx, toPosition, isHotkey)

    -- Check if system is on cooldown
    if Game.getStorageValue(raids.raidStorage) > os.time() then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You must wait ".. showTimeLeft(Game.getStorageValue(raids.raidStorage) - os.time(), true) ..", before you can start another boss raid.")
        item:getPosition():sendMagicEffect(CONST_ME_POFF)
    return false
    end
    player:sendBossRaidWindow(raids)
    return true
end
 
Oh lol no problem my bad haha xD also i have one more problem, i dont know if it will be easy to fix or hard ;P

TWWxu0W.png


Code:
local raids = {
-- Config
    raidStorage = 12345,
    cost = 500000,
    cooldown = 300,
    moneyMsg = "You dont have enough money.",
    mainTitle = "Pick a Raid!",
    mainMsg = "Pick the raid you wish to start. Each raid will cost you 500k",
-- End Config 

    -- Table of available raids
    [1] = {raid = 'Demodras'},
    [2] = {raid = 'Ethershreck'},
    [3] = {raid = 'Ferumbras'},
    [4] = {raid = 'Furyosa'},
    [5] = {raid = 'Ghazbaran'},
    [6] = {raid = 'Horned Fox'},
    [7] = {raid = 'Mad Mage'},
    [8] = {raid = 'Morgaroth'},
    [9] = {raid = 'Necropharus'},
    [10] = {raid = 'Orshabaal'},
    [11] = {raid = 'Raging Mage'},
    [12] = {raid = 'The Old Widow'},
    [13] = {raid = 'Zanakeph'},
    [14] = {raid = 'Zulazza the Corruptor'}
}

function onUse(player, item, fromPosition, itemEx, toPosition, isHotkey)

    -- Check if system is on cooldown
    if Game.getStorageValue(raids.raidStorage) > os.time() then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You must wait ".. showTimeLeft(Game.getStorageValue(raids.raidStorage) - os.time(), true) ..", before you can start another boss raid.")
        item:getPosition():sendMagicEffect(CONST_ME_POFF)
    return false
    end
    player:sendBossRaidWindow(raids)
    return true
end


https://otland.net/threads/function-time-formatting-x-days-1-minute-and-x-seconds-left.213896/
 
Oh lol no problem my bad haha xD also i have one more problem, i dont know if it will be easy to fix or hard ;P

TWWxu0W.png


Code:
local raids = {
-- Config
    raidStorage = 12345,
    cost = 500000,
    cooldown = 300,
    moneyMsg = "You dont have enough money.",
    mainTitle = "Pick a Raid!",
    mainMsg = "Pick the raid you wish to start. Each raid will cost you 500k",
-- End Config 

    -- Table of available raids
    [1] = {raid = 'Demodras'},
    [2] = {raid = 'Ethershreck'},
    [3] = {raid = 'Ferumbras'},
    [4] = {raid = 'Furyosa'},
    [5] = {raid = 'Ghazbaran'},
    [6] = {raid = 'Horned Fox'},
    [7] = {raid = 'Mad Mage'},
    [8] = {raid = 'Morgaroth'},
    [9] = {raid = 'Necropharus'},
    [10] = {raid = 'Orshabaal'},
    [11] = {raid = 'Raging Mage'},
    [12] = {raid = 'The Old Widow'},
    [13] = {raid = 'Zanakeph'},
    [14] = {raid = 'Zulazza the Corruptor'}
}

function onUse(player, item, fromPosition, itemEx, toPosition, isHotkey)

    -- Check if system is on cooldown
    if Game.getStorageValue(raids.raidStorage) > os.time() then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You must wait ".. showTimeLeft(Game.getStorageValue(raids.raidStorage) - os.time(), true) ..", before you can start another boss raid.")
        item:getPosition():sendMagicEffect(CONST_ME_POFF)
    return false
    end
    player:sendBossRaidWindow(raids)
    return true
end

as @president vankk said install that function i keep forgetting its not inbuilt to tfs..
 
Back
Top