• 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

sorry if i'm in the way, but the problem started after supporting the events upgrade on the creature =/
Because you had disabled onTargetCombat event and had bad code inside that event.
Here is fixed code.
Lua:
function Creature:onTargetCombat(target)
    target:registerEvent("ItemSetsHealth")
    target:registerEvent("UpgradeSystemHealth")
    target:registerEvent("UpgradeSystemDeath")
    if self:getStorageValue(STORAGEVALUE_WAR_GREENPLAYER_BOOL) == 1 then
        if target:getStorageValue(STORAGEVALUE_WAR_REDPLAYER_BOOL) == 1 then
            return RETURNVALUE_NOERROR
        elseif target:getStorageValue(STORAGEVALUE_WAR_REDPLAYER_BOOL) == 0 then
            self:sendCancelMessage("You cannot attack someone that is on your team.")
            return false
        end
    elseif self:getStorageValue(STORAGEVALUE_WAR_REDPLAYER_BOOL) == 1 then
        if target:getStorageValue(STORAGEVALUE_WAR_GREENPLAYER_BOOL) == 1 then
            return RETURNVALUE_NOERROR
        elseif target:getStorageValue(STORAGEVALUE_WAR_GREENPLAYER_BOOL) == 0 then
            self:sendCancelMessage("You cannot attack someone that is on your team.")
            return false
        end
    end
end
 
got 1 new error in the upgrade, i created the item, when I click on it it gives this error on the console.

1589592527038.png



edit: i managed to solve the problem, it was being the crystals that i was trying to use, i only got 4 types of crystals that work.
 
Last edited:
got 1 new error in the upgrade, i created the item, when I click on it it gives this error on the console.

View attachment 45653



edit: i managed to solve the problem, it was being the crystals that i was trying to use, i only got 4 types of crystals that work.
 
Hi I am quite new to the community and I just found this system today. VERY HAPPY WITH IT!

I may say I am just stuck with something that might be a noob error coming from me...when I relog with my character, it loses all the skill bonuses and maybe it happens the same with other bonuses that are not visible through the skills UI. When I re-equip the items the bonuses come back, but I do not think thats good, either a problem of this so polished system.

Maybe I missundertood an installation step or else...if you could help me out with that I would really apreciate it! :D

On the other hand I tested out changing an equipment for another with other skill enchantments and it correctly worked, the system swapped the numbers, so only missing that login stuff...I suppose it is the "us_onLogin" function that might be working different for my server.

I am using the 12.31 Tibia Client and the OtservBR one! Hope my first post explains good enough hehehe...! 😅😂
 
Hi I am quite new to the community and I just found this system today. VERY HAPPY WITH IT!

I may say I am just stuck with something that might be a noob error coming from me...when I relog with my character, it loses all the skill bonuses and maybe it happens the same with other bonuses that are not visible through the skills UI. When I re-equip the items the bonuses come back, but I do not think thats good, either a problem of this so polished system.

Maybe I missundertood an installation step or else...if you could help me out with that I would really apreciate it! :D

On the other hand I tested out changing an equipment for another with other skill enchantments and it correctly worked, the system swapped the numbers, so only missing that login stuff...I suppose it is the "us_onLogin" function that might be working different for my server.

I am using the 12.31 Tibia Client and the OtservBR one! Hope my first post explains good enough hehehe...! 😅😂

You are using latest version from Github, right?
 
You are using latest version from Github, right?
Yes, actually It is the same one as the first page in this post right? Hope I am not wrong...

Must add another "problem".

When I use the Fortune Crystal & Faith Crystal doesn't reroll the attributes/enchantments, maybe it is due to my weapons, since it doesn't say that is UNIDENTIFIED, but it does say it when I try to add more enchantments...quite weird. The bad part of my issues is that are not code errors, so can't send you any "guide" for that.

--------------------

EDIT: Should have said, that the crystals "work" since they remove without any error on the server log, but they still do not trigger any effect of their function. Plus I am creating the items with a GOD account, do not know if there is a special command to get an UNIDENTIFIED piece of set, my Dragon Slayers are all common...

You see a common fiery dragon slayer (Atk:35 physical + 9 fire, Def:28)
Item Level: 0
Axe Fighting +1 that has 1000 charges left.
It can only be wielded properly by players of level 0 or higher.
It weighs 82.00 oz.
Item ID: 7748
Decays to: 7402
Client ID: 664
Position: 65535, 64, 2
 
Yes, actually It is the same one as the first page in this post right? Hope I am not wrong...
Download .zip from here

When I use the Fortune Crystal & Faith Crystal doesn't reroll the attributes/enchantments, maybe it is due to my weapons, since it doesn't say that is UNIDENTIFIED, but it does say it when I try to add more enchantments...quite weird. The bad part of my issues is that are not code errors, so can't send you any "guide" for that.
Read about this
 
Download .zip from here


Read about this

Thank you! That really solved the problem, but caused the opposite issue, now when changing my gear being logged in wont change my stats on the fly, I must re-log for the stats to take effect. That was working before, but not the re-log, now totally swapped the issues hahahaha! :eek:o_O😂

EDIT: Ofcourse, while asking I am checking the old and new code that caused this to swap the issues, If I get it in time I'll post the "fix" (actually maybe the problem comes from me again..)

EDIT-2:Nvm! Everything working so far, it just was me using command-generated items by the GOD, that is why everything was working wrongly...sorry for the confusion...
 
Last edited:
Fixes that should be done:

  • Being able to mirror the "base" piece of equipment you mirror in the first place infinity times.
  • Traspassing armor/weapon based attributes to the counterpart equipment "Ex. From sword to boots"
  • Quest/Shop and other sources that are not loot-source that give you equipment, give you "common" equipment with lvl 0
  • On-DeEquip a weapon/gear, sometimes you keep the modifiers and when you equip another weapon you dont get the new ones.

Question:

- How can I create unidentified items with a GM/Admin account and not get the common lvl0 gear I am getting??
 
Being able to mirror the "base" piece of equipment you mirror in the first place infinity times.
No, that's how it's supposed to work, you can mirror one item infinite time, but can't do anything with the one that is created.

Traspassing armor/weapon based attributes to the counterpart equipment "Ex. From sword to boots"
What do you mean? You want this feature or this is a bug you found?

Quest/Shop and other sources that are not loot-source that give you equipment, give you "common" equipment with lvl 0
Please read this Oen44/TFS-Upgrade-System (https://github.com/Oen44/TFS-Upgrade-System/wiki/developer-notes)

On-DeEquip a weapon/gear, sometimes you keep the modifiers and when you equip another weapon you dont get the new ones.
That never happened to me... Are you using latest version from GitHub (v2.4.4)? Oen44/TFS-Upgrade-System (https://github.com/Oen44/TFS-Upgrade-System/releases/tag/v2.4.4)

How can I create unidentified items with a GM/Admin account and not get the common lvl0 gear I am getting??
By editing your item creation script. You can find functions that will help you with that here Oen44/TFS-Upgrade-System (https://github.com/Oen44/TFS-Upgrade-System/wiki/developer-notes)
 
No, that's how it's supposed to work, you can mirror one item infinite time, but can't do anything with the one that is created.

Quite a beast of a system, then, is there any way I can disable that? Or make the mirrored stat on a base weapon? If players get a beast of a weapon they will sell it forever, that would really break the game hahahaha! Well its fun to have some beast mode stuff, but not for my server though xD
What do you mean? You want this feature or this is a bug you found?

I think its...neither one of them, what I mean is that maybe it would too OP to get all those weapon attributes to your armor set, shouldnt it be better that it is identified by gear type?

I'll check that now! Thanks!
That never happened to me... Are you using latest version from GitHub (v2.4.4)? Oen44/TFS-Upgrade-System (https://github.com/Oen44/TFS-Upgrade-System/releases/tag/v2.4.4)

Yup! You allready advised me that and got it right away! xD
By editing your item creation script. You can find functions that will help you with that here Oen44/TFS-Upgrade-System (https://github.com/Oen44/TFS-Upgrade-System/wiki/developer-notes)

Cool! I'll check that now!


P.D.: Even if it seams to be mean sometimes, I NEVER, repeat, NEVER, gonna comment on anything in a mean way. So I just give my opinion the best way I know, if I am being rude in anyway just tell me and sorry! Wanted to clarify that just in case! 😅 😂
 
Quite a beast of a system, then, is there any way I can disable that? Or make the mirrored stat on a base weapon? If players get a beast of a weapon they will sell it forever, that would really break the game hahahaha! Well its fun to have some beast mode stuff, but not for my server though xD
That's what this mirroring crystal is for! If you have a very good item and want to sell it, then do it. However, this crystal was intended to be VERY(!) rare, like you have to kill a very hard boss or something. If players have access to that crystal just like that, then you are doing this wrong :D

I think its...neither one of them, what I mean is that maybe it would too OP to get all those weapon attributes to your armor set, shouldnt it be better that it is identified by gear type?
But that's already the case. Example:
Lua:
  [1] = {
    name = "Max HP",
    combatType = US_TYPES.CONDITION,
    condition = CONDITION_ATTRIBUTES,
    param = CONDITION_PARAM_STAT_MAXHITPOINTS,
    VALUES_PER_LEVEL = 3,
    format = function(value)
      return "Max HP +" .. value
    end,
    itemType = US_ITEM_TYPES.HELMET + US_ITEM_TYPES.ARMOR + US_ITEM_TYPES.LEGS + US_ITEM_TYPES.BOOTS -- here
  }
As you can see here, Max HP can be rolled only on Helmet, Armor, Legs and Boots.

That never happened to me... Are you using latest version from GitHub (v2.4.4)? Oen44/TFS-Upgrade-System (https://github.com/Oen44/TFS-Upgrade-System/releases/tag/v2.4.4)
Yup! You allready advised me that and got it right away! xD
Interesting then. I'll have server running this script very soon so I'll be able to test this more and if something like this happens, I'll work on it.
 
That's what this mirroring crystal is for! If you have a very good item and want to sell it, then do it. However, this crystal was intended to be VERY(!) rare, like you have to kill a very hard boss or something. If players have access to that crystal just like that, then you are doing this wrong :D


True, yeah well, not yet online my server, it will take some more time, want to do it properly, as much as I can, for my players mainly! :D
Thats the plan, but just worried in case someone wants to farm that boss or so. Probably just need to do it monthly or even that can only get that crystal from a rare event, but yeah, that would be the solution! Just wanted to be sure there wasn't a way to make the base weapon mirrored to.

But that's already the case. Example:
Lua:
  [1] = {
    name = "Max HP",
    combatType = US_TYPES.CONDITION,
    condition = CONDITION_ATTRIBUTES,
    param = CONDITION_PARAM_STAT_MAXHITPOINTS,
    VALUES_PER_LEVEL = 3,
    format = function(value)
      return "Max HP +" .. value
    end,
    itemType = US_ITEM_TYPES.HELMET + US_ITEM_TYPES.ARMOR + US_ITEM_TYPES.LEGS + US_ITEM_TYPES.BOOTS -- here
  }
As you can see here, Max HP can be rolled only on Helmet, Armor, Legs and Boots.


Yup! Yup! It is, I know, but for the Mind Crystal, thats not the case. You just use it on any gear and will coppy those stats onto the other part of the gear regardless of which type of equipment it is. The same as before, just worried about players, but I'll just make weird difficulty quests and simple systematics that play with this crystals too! xD

Interesting then. I'll have server running this script very soon so I'll be able to test this more and if something like this happens, I'll work on it.

It doesn't happen allways, but if you go doing like weird equipment changes you sometimes end up getting this kind of "error". The thing is that maybe you are seeing the boost but there is allready no boost at all on you. But yeah, it happened to me, so just wanted you to know! :D
 
Yup! Yup! It is, I know, but for the Mind Crystal, thats not the case. You just use it on any gear and will coppy those stats onto the other part of the gear regardless of which type of equipment it is. The same as before, just worried about players, but I'll just make weird difficulty quests and simple systematics that play with this crystals too! xD
Do that, this crystal too should be rare, maybe not as rare as mirror but close to.

It doesn't happen allways, but if you go doing like weird equipment changes you sometimes end up getting this kind of "error". The thing is that maybe you are seeing the boost but there is allready no boost at all on you. But yeah, it happened to me, so just wanted you to know!
I'll keep an eye on this.
 
Hey Oen,

Great system, thanks for sharing!

Everything is working great so far but I have one question regarding the function item:setItemLevel(item_level, true)

I'm using that function to give players the item as a chest reward to avoid the issue of the ItemLevel being 0, but it's duplicating the ItemLevel shown on the weapon.

Is this intended or am I doing it wrong?

01:36 You see a Gladiator's Weapon (Tier 1)
Item Level: 7 (Atk:23, critical hit chance +3%).
Item Level: 7

It can only be wielded properly by players of level 8 or higher.
It weighs 1.00 oz.

Lua:
for i = 1, #setting.itemReward do
        local itemid = setting.itemReward[i][1]
        local count = setting.itemReward[i][2]
        for c = 1, count do
            local newItem = player:addItem(itemid, 1)
            newItem:setItemLevel(1, true)
        end
end
 
Hey Oen,

Great system, thanks for sharing!

Everything is working great so far but I have one question regarding the function item:setItemLevel(item_level, true)

I'm using that function to give players the item as a chest reward to avoid the issue of the ItemLevel being 0, but it's duplicating the ItemLevel shown on the weapon.

Is this intended or am I doing it wrong?

01:36 You see a Gladiator's Weapon (Tier 1)
Item Level: 7 (Atk:23, critical hit chance +3%).
Item Level: 7

It can only be wielded properly by players of level 8 or higher.
It weighs 1.00 oz.

Lua:
for i = 1, #setting.itemReward do
        local itemid = setting.itemReward[i][1]
        local count = setting.itemReward[i][2]
        for c = 1, count do
            local newItem = player:addItem(itemid, 1)
            newItem:setItemLevel(1, true)
        end
end
What is causing this is the name of the item, Gladiator's Weapon (Tier 1), especially that (Tier 1) part.
 
What is causing this is the name of the item, Gladiator's Weapon (Tier 1), especially that (Tier 1) part.

Thank you! Working now.

11:59 You see a common Gladiator's Weapon (Atk:23, critical hit chance +3%).
Item Level: 7
Tier 1.
 
got 1 new error in the upgrade, i created the item, when I click on it it gives this error on the console.

View attachment 45653



edit: i managed to solve the problem, it was being the crystals that i was trying to use, i only got 4 types of crystals that work.

I got this same issue. Did you just change items id?

EDIT: I had to edit my .otb and .dat to allowthe selected crystals to "use with..." function and now it worked =)
 
Last edited:
Lua Script Error: [Event Interface]
data/events/scripts/player.lua:player@onMoveItem
data/lib/crafting/upgrade_system_core.lua:840: attempt to index local 'thing' (a nil value)
stack traceback:
[C]: in function '__index'
data/lib/crafting/upgrade_system_core.lua:840: in function 'onItemUpgradeLook'
data/events/scripts/player.lua:332: in function <data/events/scripts/player.lua:330>
otservbr 1.3
 
Back
Top