forgottenserver icon indicating copy to clipboard operation
forgottenserver copied to clipboard

Feature: Breakable mana shield

Open ArturKnopik opened this issue 3 years ago • 9 comments

New config

  • useBreakableManaShield: bool
  • manaShieldBarForAll: bool

New Lua function

  • player:setManaShieldBar: allows to use mana shield bar as something else (e.g. boss fight timer)

Modified lua script

  • data/spells/scripts/support/magic_shield.lua: give possibility to use old mana shield and breakable mana shield

image

  • [x] I have followed [proper The Forgotten Server code styling][code].
  • [x] I have read and understood the [contribution guidelines][cont] before making this PR.
  • [x] I am aware that this PR may be closed if the above-mentioned criteria are not fulfilled.

ArturKnopik avatar Dec 14 '21 17:12 ArturKnopik

I like the changes, but I would like a global config for the old and new PVP (after balancing), so we could only use one config for all future changes. Another thing is, maybe we could split this request in two, as the magic shield and the rooted condition have no connection. Do not take my comment as negative review, it's just my opinion, thank you very much for bringing the changes!

I ended up finding that you didn't add any spells that break the magic shield, nor did you add the potion system to retrieve it, is this going to be added in the future or has it been forgotten?

omarcopires avatar Dec 15 '21 03:12 omarcopires

locking player in place could be a cool gm feature, having root condition optional to support both old and new clients

emil92b avatar Dec 15 '21 13:12 emil92b

spells and potion related to config settings TODO: remove condition root, apply Zbizu changes

ArturKnopik avatar Dec 15 '21 20:12 ArturKnopik

boolean[MANASHIELD_BREAKABLE_FOR_ALL] = getGlobalBoolean(L, "manaShieldBarForAll", false); this setting is to fast enable mana shield bar for all vocations/players

ArturKnopik avatar Dec 19 '21 08:12 ArturKnopik

Don't forget to add useBreakableManaShield and manaShieldBarForAll to config.lua.dist I think we should use the mana shield as the default as we are on protocol 12.80+

omarcopires avatar Dec 21 '21 17:12 omarcopires

manaShieldBarForAll is optional setting for custom things, useBreakableManaShield enable feature for ed and ms(like RL tibia)

ArturKnopik avatar Dec 21 '21 19:12 ArturKnopik

@ArturKnopik ok I tested it today, it seems to be working fine

EPuncker avatar Mar 10 '22 18:03 EPuncker

Since we're in the v12+ client territory, it is expected to see the mana shield bar, therefore all mana shields should be "breakable". If someone wants "unbreakable" they can probably make it up with a mana limit equal to player's mana easily.

only mage mana shields are breakable, old shield still exist from energy rings (limited to paladins/knight now) and it can't be breakable, not all vocations have breakable mana shield but mages

EPuncker avatar Mar 13 '22 21:03 EPuncker

my approach is to deliver something that can be easily customized without requiring a change in the source code why 2 configurations? useBreakableManaShield - enables new functionality for mana shield manaShieldBarForAll - does not check xml options, everyone has it turned on by default, it helps a little when you have more vocations (example: 12-16), combining with player:setManaShieldBar can be used as boss timer etc... xml option + useBreakableManaShield can turn new mana shield bar for specific profession

ArturKnopik avatar Mar 14 '22 17:03 ArturKnopik

Sorry for 100 years of waiting, totally forgot about this PR

ArturKnopik avatar Nov 21 '22 16:11 ArturKnopik

yo guys, lets test this and give feedback, lets merge this!

EPuncker avatar Apr 04 '23 21:04 EPuncker

yo guys, lets test this and give feedback, lets merge this!

everything worked great, except the utamo vita spell in revscript, it said "you have the wrong vocation to cast this spell", but once I moved it to XML it worked just fine

omarcopires avatar Apr 04 '23 23:04 omarcopires

@EPuncker i forgot revert fix for debug build after master merge, i will revert this changes + fix formatting @omarcopires i will check it today

krecikondexin avatar Apr 05 '23 07:04 krecikondexin

Looking at the current code, I noticed that there is compatibility with the old formula being maintained. However, in my opinion, maintaining this compatibility only increases the amount of code and may be unnecessary for those who do not wish to use the old formula. Additionally, several changes have been made to configuration parameters and spells since version 1.3, including cooldowns and item limits. Therefore, I believe it is important to question whether we really need to maintain this compatibility or if it would be better to simplify the code and remove the old formula, allowing us to focus only on the newer versions. What do you think.

omarcopires avatar Apr 05 '23 18:04 omarcopires

@omarcopires string_view issue appear again - fixed @EPuncker reverted string_view fix

@omarcopires for me old mana shield is viable for EVO and FUN ots, personally i developed 12+ OTS(FUN) with old mana shield

ArturKnopik avatar Apr 05 '23 18:04 ArturKnopik

I performed tests in several scenarios and did not encounter any issues within the game. The shield and icon were added and broken as expected, and the "utamo vita" spell now functions correctly. It is worth noting that the tests were only performed with the "druid" class.

image

omarcopires avatar Apr 05 '23 18:04 omarcopires

there are 5 failing checks, can you verify them please?

EPuncker avatar Apr 05 '23 21:04 EPuncker

Screenshot from 2023-04-06 14-24-33 Fails not related to my changes.

krecikondexin avatar Apr 06 '23 12:04 krecikondexin