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

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
 
Does anyone know how to get the view like in the example youtube video where hovering over items shows stats?

This what my view currently looks like when I try to look at something

I'd like to remove the redundant messaging

I would like it to read like this

You see a common brass armor (Arm:8).
Item Level:0
It weighs 80.00oz.




I have tried messing with the entries from this step but having no luck:
  • Find Player:eek:nLook.
  • Add after local description = "You see " .. thing:getDescription(distance)
    Lua:
    description = onItemUpgradeLook(self, thing, position, distance, description



1714236599687.png1714236578817.png




If anyone can help me fix these issues and get this thing going I wouldn't mind sending a small paypal donation. I really wanna have this system going for my own personal server.
 
Last edited:
Does anyone know how to get the view like in the example youtube video where hovering over items shows stats?

This what my view currently looks like when I try to look at something

I'd like to remove the redundant messaging

I would like it to read like this

You see a common brass armor (Arm:8).
Item Level:0
It weighs 80.00oz.




I have tried messing with the entries from this step but having no luck:
  • Find Player:eek:nLook.
  • Add after local description = "You see " .. thing:getDescription(distance)
    Lua:
    description = onItemUpgradeLook(self, thing, position, distance, description



View attachment 84150View attachment 84149




If anyone can help me fix these issues and get this thing going I wouldn't mind sending a small paypal donation. I really wanna have this system going for my own personal server.
Before anything you should first start fixing why the item level is 0. An item with item level 0 won't work because it won't be able to calculate attribute values, or even roll them.

@onTopic if someone wishes to move forward on this system I figured how to link it to shop.php on ZnoteAAC, took me a while to figure it and thanks to @Itutorial I could finally achieve it.

First create a new table called "grado" or something, that holds the value of our item level.
For that just create a new row in znote_shop_orders with INT 11 and set their default value to 0.

imagewrfa.png

Then just go to shop .php and there add an additional check using:

PHP:
if ($buy['grado']) {
                    mysql_insert("INSERT INTO `znote_shop_orders` (`account_id`, `type`, `itemid`, `count`, `time`, `grado`) VALUES ('$cid', '". $buy['type'] ."', '". $buy['itemid'] ."', '". $buy['count'] ."', '$time', '". $buy['grado'] ."')");
                } else {
                    mysql_insert("INSERT INTO `znote_shop_orders` (`account_id`, `type`, `itemid`, `count`, `time`) VALUES ('$cid', '". $buy['type'] ."', '". $buy['itemid'] ."', '". $buy['count'] ."', '$time')");                }

Being in context you should use an else if, because shop system already checks for other definitions. Again, if you feel struggled just pm.
Then we assign grado to our item when we trigger the !shop talkaction. We use our functions from the upgrade system corelib to achieve it with lua.

Go to your shop talkaction script (however you have it named)

First we set a local variable for "q_grado"
Lua:
local q_grado = result.getNumber(orderQuery, "grado")
Then we go for:

corelib.png
And we finally use the other kind of items (backpacks, etc) that doesn't have item level, as Miscellaneous items (so they can be added in the Miscellaneous tab).

We have to copy from -- ORDER TYPE 1 to the end, and set player:addItem like it does normally to create a new ORDER TYPE --8 that handles items without item level.

Hope it was clear enought, didn't do really good explaining it but if you know a little php or lua will surely get the point. Regards!
 
Last edited:
Back
Top