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

CreatureEvent [TFS 1.3 / 1.4] Upgrade System

For example, can I remove some common, rare, epic, and legendary items? Have one script specifically for common items that handle upgrades, enhancements, etc., just for common items, and create another separate script for rare items in the same way, and another for epic items, and so on? Your system is quite extensive. I need to remove them together within the script for rare, common, and epic items. I want to separate each according to the specific item I desire, do you understand?
 
Not many people are using TFS 1.3, not to mention revscripts. It's too fresh.
oops, I installed everything correctly and it seems to be working, I only have two questions left, how do I leave the items without identification? do I have to create new ones?
All items are common, how do I upgrade them to rare?
I'm using version 3.0.3 of the system, revscripts in tfs 1.4
thanks!
Post automatically merged:

For example, can I remove some common, rare, epic, and legendary items? Have one script specifically for common items that handle upgrades, enhancements, etc., just for common items, and create another separate script for rare items in the same way, and another for epic items, and so on? Your system is quite extensive. I need to remove them together within the script for rare, common, and epic items. I want to separate each according to the specific item I desire, do you understand?

I want to do the same thing, separate the items, common, rare and epic
 
The best upgrade system ever. 4 months running it without a single error. Thanks @oen432
The upgrade system is really good, but I had to use another system to define the rarity of items when they drop from monsters, must I be doing something wrong then?
there is no error of any kind.
 
Hi, I have a couple questions. Im using the revscripts from github

1. Where can i change the item level range dropped by creatures?
For instance heros are always dropping 39-41 level items late game creatures, maxed level items. Where can I config so there is more range on the item level dropped?

2. Does this includes the drop of the monster or this is only for "identifying purposes"?
RARITY = {
[COMMON] = {
name = "common",
maxBonus = 1, -- max amount of bonus attributes
chance = 10 -- 1:X chance that item will be common (1 = 100%)
},
[RARE] = {
name = "rare",
maxBonus = 2, -- max amount of bonus attributes
chance = 20 -- 1:X chance that item will be common (1 = 100%)
},
[EPIC] = {
name = "epic",
maxBonus = 3, -- max amount of bonus attributes
chance = 50 -- 1:X chance that item will be common (1 = 100%)
},
[LEGENDARY] = {
name = "legendary",
maxBonus = 4, -- max amount of bonus attributes
chance = 70 -- 1:X chance that item will be common (1 = 100%)

3. Non level items (bought by npcs or quests) when upgraded they lose their original values. Anyway you cant use upgrade gems on 0 level items?

4. Loot always have either a rarity or unindentified, is this how it works? Is there a way that a creature loots a normal item? Have been tunning the "chance" and it seems there is no way to drop non-rarity items.


Great system. Thanks in advance! Any help its appreciated it.
 
Hi, I have a couple questions. Im using the revscripts from github

1. Where can i change the item level range dropped by creatures?
For instance heros are always dropping 39-41 level items late game creatures, maxed level items. Where can I config so there is more range on the item level dropped?

2. Does this includes the drop of the monster or this is only for "identifying purposes"?
RARITY = {
[COMMON] = {
name = "common",
maxBonus = 1, -- max amount of bonus attributes
chance = 10 -- 1:X chance that item will be common (1 = 100%)
},
[RARE] = {
name = "rare",
maxBonus = 2, -- max amount of bonus attributes
chance = 20 -- 1:X chance that item will be common (1 = 100%)
},
[EPIC] = {
name = "epic",
maxBonus = 3, -- max amount of bonus attributes
chance = 50 -- 1:X chance that item will be common (1 = 100%)
},
[LEGENDARY] = {
name = "legendary",
maxBonus = 4, -- max amount of bonus attributes
chance = 70 -- 1:X chance that item will be common (1 = 100%)

3. Non level items (bought by npcs or quests) when upgraded they lose their original values. Anyway you cant use upgrade gems on 0 level items?

4. Loot always have either a rarity or unindentified, is this how it works? Is there a way that a creature loots a normal item? Have been tunning the "chance" and it seems there is no way to drop non-rarity items.


Great system. Thanks in advance! Any help its appreciated it.

I think it is based here within the core.lua, it is taking monster health and experience and rolling based on that.. you can probably play with the settings

Lua:
function MonsterType.calculateItemLevel(self)
    local level = 1
    local monsterValue = self:getMaxHealth() + self:getExperience()
    level = math.ceil(math.pow(monsterValue, 0.478))
    return math.max(1, level)
end

I didn't get to fix non level items, basically what I did was make it so you cannot upgrade vendored items.. to combat this, everything RARE is to be dropped only
 
I think it is based here within the core.lua, it is taking monster health and experience and rolling based on that.. you can probably play with the settings

Lua:
function MonsterType.calculateItemLevel(self)
    local level = 1
    local monsterValue = self:getMaxHealth() + self:getExperience()
    level = math.ceil(math.pow(monsterValue, 0.478))
    return math.max(1, level)
end

I didn't get to fix non level items, basically what I did was make it so you cannot upgrade vendored items.. to combat this, everything RARE is to be dropped only

Thanks yeah i got the problem with common items earned from quests,npcs or other sources I need to find a way, so upgrade gems cant be use on those items.

However I could manage to make a range so the monster can drop an item level from 0 to the monster level, example hero can drop 0-50 level items which makes it more balanced and more fun.

Lua:
 for i = 0, corpse:getCapacity() do
            local item = corpse:getItem(i)
            if item then
                local itemType = item:getType()
                if itemType then
                    if itemType:canHaveItemLevel() then
                        item:setItemLevel(math.min(US_CONFIG.MAX_ITEM_LEVEL, math.random(0, iLvl)), true)
                    end
 
im using nekiros 1.5 downgrade and for some reason the system for gems work but when i look the items have no rarity or nothing

1705155664905.png

github release works.
 
Last edited:
cant seem to get it to work with the quest system i got from here
Lua:
--[[
    Little Quest Chests
    Create By: 𝓜𝓲𝓵𝓵𝓱𝓲𝓸𝓻𝓮 𝓑𝓣
    TFS Version: 1.5
]]--

local actionId = 65535

function onUse(player, chest, fromPos, target, toPos, isHotkey)
    local questId = chest:getUniqueId()
    if not chest:getType():isContainer() then
        error(string.format("[Error - LittleQuestChests::%d] Item %d is not a container.", questId, chest:getId()))
    end

    if player:getStorageValue(questId) ~= -1 then
        player:sendTextMessage(MESSAGE_INFO_DESCR, "It is empty.")
        return true
    end

    -- Replace the following line with the correct method for your server
    local items = getContainerItems(chest)

    if #items == 0 then
        error(string.format("[Error - LittleQuestChests::%d] No items found for quest %d", questId, questId))
    end

    local totalWeight = 0
    for _, item in pairs(items) do
        totalWeight = totalWeight + item:getWeight()
    end

    if player:getFreeCapacity() < totalWeight then
        player:sendCancelMessage(RETURNVALUE_NOTENOUGHCAPACITY)
        return true
    end

    player:setStorageValue(questId, 1)
    player:sendTextMessage(MESSAGE_LOOT, string.format("You have found %s.", chest:getContentDescription()))

    for _, item in pairs(items) do
        local newItem = item:clone()
        item.setRarity(newItem) -- Roll the rarity before adding it to the player
        player:addItemEx(newItem, true)
    end

    return true
end
 
Back
Top