• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.
Resource icon

TFS 1.4.2 [Revscript] Boosted Daily Creatures with boosted creature showcase

leo18dff

Banned User
Joined
Mar 27, 2023
Messages
225
Reaction score
93
leo18dff submitted a new resource:

TFS 1.4.2 [Revscript] Boosted Daily Creatures with boosted creature showcase - Boosted creatures Exp + Loot

Simply but functional boosted creatures that replicates the boosted monsters at X spawn position, change the monsters with your server monsters.

--------------------------------------------------------------------------------------
CREATE TABLE boosted_monsters (
id int NOT NULL AUTO_INCREMENT,
monster_name varchar(255) NOT NULL,
date date NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4...

Read more about this resource...
 

Attachments

Last edited:
i believe you forgot to increase exp and loot rate eventcallbacks wasn't in your revscript.
 
It's like building a car but forgetting to put in the engine...
He's a banned user btw.
i'm going to share it in his favor tbh, i also saw many codes by him that was used in many ots so i don't care banned or not he is a contributor

just add this into your file it will add the exp bonus in case the monster you killed is boosted
LUA:
local GainExperienceEvent = EventCallback
GainExperienceEvent.onGainExperience = function(player, source, exp, rawExp)
    if source:isMonster() then
        for i = 1, #boostedMonsters do
            if source:getName():lower() == boostedMonsters[i]:lower() then
                exp = exp + (exp * boostedMonstersExperienceMultiplier)
            end
        end
    end
    return exp
end
GainExperienceEvent:register()

loot: edit your onDropLoot eventcallback or mainly in scripts/monsters.lua inside the monsterLoot loop where it calls the items add this part

Code:
   for i = 1, #monsterLoot do
                local itemType = ItemType(monsterLoot[i].itemId)
                local boostedMonsters = getBoostedMonsters()
                for i = 1, #boostedMonsters do
                    if player and self:getName():lower() == boostedMonsters[i]:lower() then
                        chance = math.max(100000, chance * boostedMonstersLootChanceMultiplier)
                    end
                end
        end

replace those into global.lua incase they won't be readable from scripts folder or events since its a rev and made them global variables as well
Code:
boostedMonsters = {}
boostedMonstersExperienceMultiplier = 1.5
boostedMonstersLootChanceMultiplier = 2

function getBoostedMonsters()
    return boostedMonsters
end
 
Last edited:
i'm going to share it in his favor tbh, i also saw many codes by him that was used in many ots so i don't care banned or not he is a contributor

just add this into your file it will add the exp bonus in case the monster you killed is boosted
LUA:
local GainExperienceEvent = EventCallback
GainExperienceEvent.onGainExperience = function(player, source, exp, rawExp)
    if source:isMonster() then
        for i = 1, #boostedMonsters do
            if source:getName():lower() == boostedMonsters[i]:lower() then
                exp = exp + (exp * boostedMonstersExperienceMultiplier)
        end
    return exp
end
GainExperienceEvent:register()

loot: edit your onDropLoot eventcallback or mainly in scripts/monsters.lua inside the monsterLoot loop where it calls the items add this part

Code:
            for i = 1, #monsterLoot do
                local itemType = ItemType(monsterLoot[i].itemId)
                local boostedMonsters = getBoostedMonsters()
                for i = 1, #boostedMonsters do
                    if player and self:getName() == boostedMonsters[i] then
                        chance = math.max(100000, chance * boostedMonstersLootChanceMultiplier)
                    end
                end

replace those into global.lua incase they won't be readable from scripts folder or events since its a rev and made them global variables as well
Code:
boostedMonsters = {}
boostedMonstersExperienceMultiplier = 1.5
boostedMonstersLootChanceMultiplier = 2

function getBoostedMonsters()
    return boostedMonsters
end
Btw, you have a few ends missing in both your first two code blocks 👍
 
Back
Top