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

Boss Spawn Sign - Saying if it is spawned or not.

Kibidon777

New Member
Joined
Oct 16, 2011
Messages
68
Reaction score
0
I currently have 2 bosses on my server.

1. Dragon Lord King
2. Undead King

They are set to spawn every 10 minutes. I was wondering if there was a way I could script a sign, or possibly an above text effect, that would in pseudocode

If [bossname] = killed then set sign = is not spawned
wait 10 minutes
set sign [bossname] has spawned

or

set text above effect. [bossname] has spawned.
or
[bossname] has not spawned.

Thank you for the help!

Sincerely,
Kibidon
 
Thanks! :) I am also trying to set it up so that I can have my VPS restart once every 24 hours and do a server save kind of like normal tibia. I was wondering if there is anyway to use local server time in global events, so that it saves, and says that it is restarting and to come back in 10 minutes. Is this possible?

By that I mean I want it to restart at 04:00 local server time everyday.
 
Last edited by a moderator:
Emm.... I think so... You mae a global event on time in 3:50... Send text message... then addEvent (saveServer, 10 * 60 * 1000), kick all players.... then closeserver, then save, then open server.... That's all i think... :/

Could you say me how you send the effecto of the sign to the position please?
Thank you.

This should work for the first script you needed:
Code:
local config = {
    ["Dragon Lord King"] = {aniPos = {x=1000,y=1000,z=7}, signEffect = 56, textEffect = math.random(1, 254)},
    ["Undead King"] = {signPos = {x=1000,y=1000,z=7}, signEffect = 56, textEffect = math.random(1,254)}
    }
function onThink(interval, lastExecution, thinkInterval)
    for k, v in pairs(config) do
        if getCreatureByName(k) then
            doSendMagicEffect(v.aniPos, v.signEffect)
            doSendAnimatedText(v.aniPos, " "..k.." is spawned.", v.textEffect)
        else
            doSendAnimatedText(v.aniPos, " "..k.." is not spawned.", v.textEffect)
        end
    end
return true
end


Sorry all if i had spammed, but was for get info about the script the man wanted, i posted script cause i dont get any fast answer to questions....

Sorry for bad english...
 
Last edited by a moderator:
I should have told you, but I am using TFS 0.3.6. I appreciate the help, but I got these errors.

[30/10/2011 14:30:30] [Error - GlobalEvent Interface]
[30/10/2011 14:30:30] data/globalevents/scripts/spawnedbosses.lua:eek:nThink
[30/10/2011 14:30:30] Description:
[30/10/2011 14:30:30] attempt to index a nil value
[30/10/2011 14:30:30] stack traceback:
[30/10/2011 14:30:30] [C]: in function 'doSendMagicEffect'
[30/10/2011 14:30:30] data/globalevents/scripts/spawnedbosses.lua:8: in function <data/globalevents/scripts/spawnedbosses.lua:5>
[30/10/2011 14:30:30] [Error - GlobalEvents::think] Couldn't execute event: Boss Spawn Checker
 
Dont know what happened, but if someone could help...

Are you sure you configure it well?
["name of monster" = {aniPos = pos where effects will be shown, signEffect = number of the effect to be shown, textEffect = color of the effect (i make a math random to be random, but you can change math.random(1, 254) for a number from 1 to 254... xD
 
[30/10/2011 14:53:50] [Error - GlobalEvent Interface]
[30/10/2011 14:53:50] data/globalevents/scripts/spawnedbosses.lua:eek:nThink
[30/10/2011 14:53:50] Description:
[30/10/2011 14:53:50] attempt to index a nil value
[30/10/2011 14:53:50] stack traceback:
[30/10/2011 14:53:50] [C]: in function 'doSendMagicEffect'
[30/10/2011 14:53:50] data/globalevents/scripts/spawnedbosses.lua:8: in function <data/globalevents/scripts/spawnedbosses.lua:5>
[30/10/2011 14:53:50] [Error - GlobalEvents::think] Couldn't execute event: BossChecker

And my file:
local config = {
["Dragon Lord King"] = {aniPos = {x=1000,y=1000,z=7}, signEffect = 31, textEffect = math.random(1)},
["Undead King"] = {signPos = {x=1001,y=817,z=7}, signEffect = 31, textEffect = math.random(1)}
}
function onThink(interval, lastExecution, thinkInterval)
for k, v in pairs(config) do
if getCreatureByName(k) then
doSendMagicEffect(v.aniPos, v.signEffect)
doSendAnimatedText(v.aniPos, " "..k.." is spawned.", v.textEffect)
else
doSendAnimatedText(v.aniPos, " "..k.." is not spawned.", v.textEffect)
end
end
return true
end

and my global events file:

<?xml version="1.0" encoding="UTF-8"?>
<globalevents>
<globalevent name="save" interval="900" event="script" value="save.lua"/>
<globalevent name="clean" interval="7200" event="script" value="clean.lua"/>
<globalevent name="shop" interval="30" script="shop.lua"/>

<globalevent name="serverstart" type="start" event="script" value="start.lua"/>
<globalevent name="playersrecord" type="record" event="script" value="record.lua"/>

<globalevent name="EffectTile1" interval="1" event="script" value="effect1.lua"/>
<globalevent name="Tp" interval="-1" script="effects.lua"/>
<globalevent name="donateReminder" interval="60" script="donatereminder1.lua"/>
<globalevent name="reklama" interval="2200" event="script" value="message.lua"/>
<globalevent name="BossChecker" interval="-1" script="spawnedbosses.lua"/>


<!-- <globalevent name="timer_example" time="21:35" event="script" value="my_script.lua"/> -->
</globalevents>
 
Back
Top