canary icon indicating copy to clipboard operation
canary copied to clipboard

[Feature] Item tiers and new skills (Onslaught, Ruse and Momentum) from 12.80

Open omeranha opened this issue 2 years ago • 28 comments

Note: This pull request is not yet complete, it is in the testing and development phase, thank you.

The forge system part will be completed in another pull request, and focused after I finish these!

New Item Tiers and classifications

image image Added functions item:getTier() item:addTier(tier)

need a tiered item? use the commited script, you can copy to OTservBR-Global datapack if you want

New skills

All informations avaliable in Tibia Fandom Onslaught(Fatal): https://tibia.fandom.com/wiki/Onslaught Ruse(block hits): https://tibia.fandom.com/wiki/Ruse Momentum(cooldown reduction): https://tibia.fandom.com/wiki/Momentum

Missing

  • [x] Missing some item tier bytes.
  • [x] Market saving tier attribute. and more, much more things.

Type of change

  • [X] New feature (non-breaking change which adds functionality)

omeranha avatar Apr 30 '22 00:04 omeranha

Global tibia examples:

You see a lion rod (magic level +2, critical hit chance 10%, critical extra damage +35%). Imbuements: (Powerful Void 1:24h, Powerful Epiphany 1:24h). Classification: 4 Tier: 1 (0.50% Onslaught).

Classification: 2 Tier: 1 (2.00% Momentum).

Classification: 3 Tier: 1 (0.50% Ruse).

rusaskii avatar Apr 30 '22 17:04 rusaskii

BUG: Crash Server when looking at an NPC item

tutbarao avatar Jun 17 '22 19:06 tutbarao

forged items can't be used as a hotkey

tutbarao avatar Jul 08 '22 10:07 tutbarao

forged items can't be used as a hotkey

The packet got longer and includes u8 tier now. Also you have to assign upgraded item again because the hotkey on action bar is set to equip "tier 0 armor"

Zbizu avatar Jul 09 '22 09:07 Zbizu

forged items can't be used as a hotkey

The packet got longer and includes u8 tier now. Also you have to assign upgraded item again because the hotkey on action bar is set to equip "tier 0 armor"

where should i change this to fix it?

tutbarao avatar Jul 09 '22 09:07 tutbarao

@tutbarao here is how I did it for hotkey equip: https://github.com/Zbizu/forgottenserver/commit/2a18fc8ba813c2f38f87367fbc0e8350783a4f44#diff-eb01d79b279ebf659ed73216c0b3c490685221c9358e058ce55a1c8ab4e99c35R1145

I don't remember if there was anything I changed for hotkey use though.

Zbizu avatar Jul 10 '22 23:07 Zbizu

Thanks, is there any scripts that add dust loot drop chance on all monsters?

tutbarao avatar Jul 11 '22 04:07 tutbarao

when I click and select "sliver" or "exalted core" client crashes with "2022-07-16, 23:15:02: Error while processing network packet not enough bytes (28777) available at position 25". Did I miss something or maybe you have the same issue? image

wojciech-dybikowski avatar Jul 16 '22 21:07 wojciech-dybikowski

Now the tier no longer appears when looking at the item it shows tier = [] and the hotkey is only functional for tier 1 item. above tier 1 it doesn't work

tutbarao avatar Jul 17 '22 11:07 tutbarao

Now the tier no longer appears when looking at the item it shows tier = [] and the hotkey is only functional for tier 1 item. above tier 1 it doesn't work

stop using the comment section as custom support, the pull request is in draft, that's = to not completed yet please wait for everything to be done then you can test, I'll mark your comments as outdated

omeranha avatar Jul 17 '22 15:07 omeranha

when I click and select "sliver" or "exalted core" client crashes with "2022-07-16, 23:15:02: Error while processing network packet not enough bytes (28777) available at position 25". Did I miss something or maybe you have the same issue? image

working as should there!

omeranha avatar Jul 17 '22 15:07 omeranha

When unequipping with hotkey the item with an infinite bag "loot pouch" with +1 page. Item disappears when unequipped. This bug happens with any item, even non-forged items.

tutbarao avatar Aug 04 '22 10:08 tutbarao

Would be great if we have the getClassification() method in lua, what do you think? item_functions.cpp

int ItemFunctions::luaItemGetClassification(lua_State* L) { const Item* item = getUserdata<Item>(L, 1); if (!item) { reportErrorFunc(getErrorDesc(LUA_ERROR_ITEM_NOT_FOUND)); pushBoolean(L, false); return 1; }

lua_pushnumber(L, item->getClassification()); return 1; }

item_functions.hpp

registerMethod(L, "Item", "getClassification", ItemFunctions::luaItemGetClassification);`

and

`static int luaItemGetClassification(lua_State* L);

carlospess0a avatar Aug 11 '22 13:08 carlospess0a

Hello, I just downloaded the current src with version 12.86. I added all the changes posted here. I tried several times to be sure that I did not make a mistake when adding them and it causes me an error when I try to log in 1 character, the server closes and only shows 1 message in the console (segmentation fault) the problem in windown and now in ubuntu 20.04

image

luiscaldera avatar Aug 20 '22 09:08 luiscaldera

outra coisa é que alguns items como "spellbook of dark mysteries" por algum motivo não para ser add ao market

Did you check your client with Asset Editor?

carlospess0a avatar Aug 29 '22 20:08 carlospess0a

Não sei se aqui é o lugar certo, dois erros nesse pr é, só da para criar offerts no market de itens que podem receber tier, e o outro só da para equipar quiver pela hotkey se não tiver nada na mão, por favor o pr é muito bom para ter esses dois bugs

Luccoo avatar Sep 05 '22 22:09 Luccoo

quando um item com tier é vendido no market, ele perde o tier

Luccoo avatar Sep 09 '22 18:09 Luccoo

os items não perdem mais tier quando são vendidos no market mais ainda não é possível criar oferta de items que tem NÃO POSSUEM classificação tier

Luccoo avatar Sep 23 '22 22:09 Luccoo

same bug with me

tutbarao avatar Oct 03 '22 23:10 tutbarao

os items não perdem mais tier quando são vendidos no market mais ainda não é possível criar oferta de items que tem NÃO POSSUEM classificação tier

que não possuem classificação tier ou que não possuem o upgradeclassfication? eu consegui por um item que tem tier 0 sem problema algum

dudantas avatar Oct 06 '22 17:10 dudantas

os items não perdem mais tier quando são vendidos no market mais ainda não é possível criar oferta de items que tem NÃO POSSUEM classificação tier

que não possuem classificação tier ou que não possuem o upgradeclassfication? eu consegui por um item que tem tier 0 sem problema algum

Qualquer item que nao tenha a classificação tier nao pode ser adicionado ao market. Exemplo: steel boots nao pode ser adicionado ao market pois nao possue tier.

tutbarao avatar Oct 06 '22 17:10 tutbarao

Qualquer item que nao tenha a classificação tier nao pode ser adicionado ao market. Exemplo: steel boots nao pode ser adicionado ao market pois nao possue tier.

Acabei de arrumar, fica a vontade para testar. Também botei para aparecer todas as classificações no market, na hora de pôr para vender.

dudantas avatar Oct 06 '22 18:10 dudantas

Eu tenho esse erro agora na source ao criar uma oferta no market de uma steel boots ou qualquer outro item sem tier.

`[error] Query: SELECT `id`, `amount`, `price`, `tier`, `created`, `anonymous`, (SELECT `name` FROM `players` WHERE `id` = `player_id`) AS `player_name` FROM `market_offers` WHERE `sale` = 0 AND `itemtype` = 3554 AND `tier` =
[2022-06-10 17:48:33.312] [error] Message: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
[2022-06-10 17:48:33.313] [error] Query: SELECT `id`, `amount`, `price`, `tier`, `created`, `anonymous`, (SELECT `name` FROM `players` WHERE `id` = `player_id`) AS `player_name` FROM `market_offers` WHERE `sale` = 0 AND `itemtype` = 3554 AND `tier` =
[2022-06-10 17:48:33.314] [error] Message: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
[2022-06-10 17:48:33.315] [error] Query: SELECT `id`, `amount`, `price`, `tier`, `created`, `anonymous`, (SELECT `name` FROM `players` WHERE `id` = `player_id`) AS `player_name` FROM `market_offers` WHERE `sale` = 1 AND `itemtype` = 3554 AND `tier` =
[2022-06-10 17:48:33.315] [error] Message: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
[2022-06-10 17:48:33.316] [error] Query: SELECT `id`, `amount`, `price`, `tier`, `created`, `anonymous`, (SELECT `name` FROM `players` WHERE `id` = `player_id`) AS `player_name` FROM `market_offers` WHERE `sale` = 1 AND `itemtype` = 3554 AND `tier` =
[2022-06-10 17:48:33.316] [error] Message: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1`

tutbarao avatar Oct 06 '22 20:10 tutbarao

@tutbarao você precisa rodar o migrations https://github.com/opentibiabr/otservbr-global/pull/799

#Edit Realmente ta dando bug, já já vejo oq é

dudantas avatar Oct 06 '22 22:10 dudantas

Eu tenho esse erro agora na source ao criar uma oferta no market de uma steel boots ou qualquer outro item sem tier.

`[error] Query: SELECT `id`, `amount`, `price`, `tier`, `created`, `anonymous`, (SELECT `name` FROM `players` WHERE `id` = `player_id`) AS `player_name` FROM `market_offers` WHERE `sale` = 0 AND `itemtype` = 3554 AND `tier` =
[2022-06-10 17:48:33.312] [error] Message: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
[2022-06-10 17:48:33.313] [error] Query: SELECT `id`, `amount`, `price`, `tier`, `created`, `anonymous`, (SELECT `name` FROM `players` WHERE `id` = `player_id`) AS `player_name` FROM `market_offers` WHERE `sale` = 0 AND `itemtype` = 3554 AND `tier` =
[2022-06-10 17:48:33.314] [error] Message: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
[2022-06-10 17:48:33.315] [error] Query: SELECT `id`, `amount`, `price`, `tier`, `created`, `anonymous`, (SELECT `name` FROM `players` WHERE `id` = `player_id`) AS `player_name` FROM `market_offers` WHERE `sale` = 1 AND `itemtype` = 3554 AND `tier` =
[2022-06-10 17:48:33.315] [error] Message: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
[2022-06-10 17:48:33.316] [error] Query: SELECT `id`, `amount`, `price`, `tier`, `created`, `anonymous`, (SELECT `name` FROM `players` WHERE `id` = `player_id`) AS `player_name` FROM `market_offers` WHERE `sale` = 1 AND `itemtype` = 3554 AND `tier` =
[2022-06-10 17:48:33.316] [error] Message: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1`

Fixado, vê o último commit, por gentileza.

image

dudantas avatar Oct 06 '22 23:10 dudantas

Mais algum bug? Precisamos que testem bem, amanhã começarei a desenvolver a statistics e aí estará pronto para mergear. Só dependerá dos testes.

dudantas avatar Oct 06 '22 23:10 dudantas

Everything working perfect, i would just suggest that tiered items should not be able to be sold on npcs

guispiller avatar Oct 16 '22 21:10 guispiller

Found a new issue on market related to tiers. How to reproduce, with an example of Plate armor (you can use any item).

1 - create a buy offer of a plate armor tier 0 with Player A. 2 - Get 1 Plate armor Tier 1 on first slot of a depot box, and one plate armor Tier 0 at the second slot of the same depot box. 3 - Sell the plate armor tier 0 to the buy offer at the market.

Result: As the first slot is the Tier 1 armor, this one will be sold. So, player A will receive a Tier 0 armor, and player B will sell a Tier 1 armor. This can occur also if there are tiered items of the same at mailbox, and lower tiered on depot box. It is not checking the tier, it's just selling the first one

guispiller avatar Oct 22 '22 17:10 guispiller

Found a new issue on market related to tiers. How to reproduce, with an example of Plate armor (you can use any item).

1 - create a buy offer of a plate armor tier 0 with Player A. 2 - Get 1 Plate armor Tier 1 on first slot of a depot box, and one plate armor Tier 0 at the second slot of the same depot box. 3 - Sell the plate armor tier 0 to the buy offer at the market.

Result: As the first slot is the Tier 1 armor, this one will be sold. So, player A will receive a Tier 0 armor, and player B will sell a Tier 1 armor. This can occur also if there are tiered items of the same at mailbox, and lower tiered on depot box. It is not checking the tier, it's just selling the first one

Thanks for reporting. Please, test this commit: https://github.com/opentibiabr/canary/pull/366/commits/d0d3482da484f1beb9d3966a65210fc4faebf26a

I tested it, and it seems to have fixed the problem.

dudantas avatar Oct 22 '22 20:10 dudantas

I found a bug: Cannot cancel market offers. When you click the cancel button, nothing happens.

tutbarao avatar Oct 24 '22 14:10 tutbarao