• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

monster Boost hourly

pisquila

Member
Joined
Nov 14, 2023
Messages
48
Reaction score
5
Is there any way someone can modify this script to change the monster hourly?
Because it changed when the server restarted.
local monsterPosition = {x = 185, y = 195, z = 7}
local lootBoostPosition = {x = 184, y = 195, z = 7}
local expBoostPosition = {x = 186, y = 195, z = 7}

local BOOST_SYSTEM_MONSTER_NAME_STORAGE = 12380
local BOOST_SYSTEM_LOOT_BONUS_STORAGE = 12381
local BOOST_SYSTEM_EXP_BONUS_STORAGE = 12382

string.upperAllFirst = string.upperAllFirst or function (str)
return string.gsub(' ' .. str, '%W%l', string.upper):sub(2)
end

local days = {
["Sunday"] = {"Bones Vip 3", "Crystal Spider Vip 3", "Cyclops Smith Vip 3", "Damaged Worker Golem Vip 3", "Dark Torturer Vip 3", "Demon Vip 3", "Dragon Lord Vip 3", "Dragon Vip 3", "Earth Elemental Vip 3"}, -- Domingo
["Monday"] = {"Bones Vip 3", "Crystal Spider Vip 3", "Cyclops Smith Vip 3", "Damaged Worker Golem Vip 3", "Dark Torturer Vip 3", "Demon Vip 3", "Dragon Lord Vip 3", "Dragon Vip 3", "Earth Elemental Vip 3"}, -- Segunda-feira
["Tuesday"] = {"Bones Vip 3", "Crystal Spider Vip 3", "Cyclops Smith Vip 3", "Damaged Worker Golem Vip 3", "Dark Torturer Vip 3", "Demon Vip 3", "Dragon Lord Vip 3", "Dragon Vip 3", "Earth Elemental Vip 3"}, -- Terça-feira
["Wednesday"] = {"Bones Vip 3", "Crystal Spider Vip 3", "Cyclops Smith Vip 3", "Damaged Worker Golem Vip 3", "Dark Torturer Vip 3", "Demon Vip 3", "Dragon Lord Vip 3", "Dragon Vip 3", "Earth Elemental Vip 3"}, -- Quarta-feira
["Thursday"] = {"Bones Vip 3", "Crystal Spider Vip 3", "Cyclops Smith Vip 3", "Damaged Worker Golem Vip 3", "Dark Torturer Vip 3", "Demon Vip 3", "Dragon Lord Vip 3", "Dragon Vip 3", "Earth Elemental Vip 3"}, -- Quinta-feira
["Friday"] = {"Bones Vip 3", "Crystal Spider Vip 3", "Cyclops Smith Vip 3", "Damaged Worker Golem Vip 3", "Dark Torturer Vip 3", "Demon Vip 3", "Dragon Lord Vip 3", "Dragon Vip 3", "Earth Elemental Vip 3"}, -- Sexta-feira
["Saturday"] = {"Bones Vip 3", "Crystal Spider Vip 3", "Cyclops Smith Vip 3", "Damaged Worker Golem Vip 3", "Dark Torturer Vip 3", "Demon Vip 3", "Dragon Lord Vip 3", "Dragon Vip 3", "Earth Elemental Vip 3"} -- Sábado
}

function onStartup()
local monsters = days[os.date("%A")]
if not monsters then
return true
end


local func = db.query or db.executeQuery
local monster = monsters[math.random(1, #monsters)]
print(monster)
doSetStorage(BOOST_SYSTEM_MONSTER_NAME_STORAGE, monster:lower())
doSetStorage(BOOST_SYSTEM_LOOT_BONUS_STORAGE, math.random(10, 30))
doSetStorage(BOOST_SYSTEM_EXP_BONUS_STORAGE, math.random(10, 30))
doCreateMonster(monster, monsterPosition, false, true)
func("INSERT INTO monster_boost1 (monster, loot1, exp1) VALUES ('"..monster.."', '"..getStorage(BOOST_SYSTEM_LOOT_BONUS_STORAGE).."', '"..getStorage(BOOST_SYSTEM_EXP_BONUS_STORAGE).."')")
return true
end

function onThink()
local monsterName = getStorage(BOOST_SYSTEM_MONSTER_NAME_STORAGE)
if monsterName == EMPTY_STORAGE then
return true
end

local creature = getTopCreature(monsterPosition)
if not creature or creature.uid == 0 then
doCreateMonster(monsterName, monsterPosition, false, true)
elseif getCreatureName(creature.uid):lower() ~= monsterName then
doRemoveCreature(creature.uid)
doCreateMonster(monsterName, monsterPosition, false, true)
end

--doSendAnimatedText(monsterPosition, string.upperAllFirst(monsterName), COLOR_LIGHTBLUE)
doSendAnimatedText(lootBoostPosition, "Loot +" .. getStorage(BOOST_SYSTEM_LOOT_BONUS_STORAGE) .. "%", 194)
doSendAnimatedText(expBoostPosition, "Exp +" .. getStorage(BOOST_SYSTEM_EXP_BONUS_STORAGE) .. "%", 194)

return true
end
 
Back
Top