-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Breakable mana shield #3848
Conversation
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? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
excellent! I would love to see the magic shield potion and the shield canceling spell tho
locking player in place could be a cool gm feature, having root condition optional to support both old and new clients |
…- all relate to config
spells and potion related to config settings |
…- all relate to config [cleanup]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great! magic shield potion can be added at data/actions/scripts/potions.lua (but please don't move this file to revscriptsys for now 😄) just follow how buff potions where added there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would move the breakable mana values to breakable mana shield condition, it's serialized to database and loaded on login, so you have all the values ready without adding anything to database nor handling these values, same thing with calculcations in game.cpp, you can do them on condition and put whole logic in condition, for example manaCondition->onDamageTaken() and use this inside of game.cpp to reduce mana shield amount and call onConditionEnd inside of it when needed
src/condition.cpp
Outdated
if (!Condition::startCondition(creature)) { | ||
return false; | ||
} | ||
if (auto player = creature->getPlayer()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Player* player
src/condition.cpp
Outdated
|
||
void ConditionManaShield::endCondition(Creature* creature) | ||
{ | ||
if (auto player = creature->getPlayer()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Player* player
src/condition.cpp
Outdated
|
||
void ConditionManaShield::addCondition(Creature* creature, const Condition* addCondition) | ||
{ | ||
if (auto player = creature->getPlayer()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Player* player
src/condition.cpp
Outdated
bool ret = Condition::setParam(param, value); | ||
|
||
switch (param) { | ||
case CONDITION_PARAM_MANASHIELD_BREAKABLE: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing indendation
src/game.cpp
Outdated
manaShield = 0; | ||
} | ||
} | ||
if (targetPlayer->getMana() == 0 && manaShield > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new line
src/game.cpp
Outdated
targetPlayer->removeCondition(CONDITION_MANASHIELD_BREAKABLE); | ||
} | ||
} else { | ||
// Old Mana Shield |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
normal mana shield?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
old system that use all mana and cannot be broken when mana reach value 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think nekiro means to rename "old mana shield" to "normal mana shield"
src/player.h
Outdated
@@ -1280,6 +1296,8 @@ class Player final : public Creature, public Cylinder | |||
uint32_t editListId = 0; | |||
uint32_t mana = 0; | |||
uint32_t manaMax = 0; | |||
uint16_t manaShield = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be probably calculated from the condition you added
@@ -1561,7 +1561,7 @@ void ProtocolGame::sendBasicData() | |||
msg.addByte(spellId); | |||
} | |||
|
|||
msg.addByte(0x00); // is magic shield active (bool) | |||
msg.addByte(player->getVocation()->getMagicShield()); // is magic shield active (bool) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again, check if player has condition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw if a player changes vocation where is this updated?
> Specialised Magic Levels: items will be able to receive a magic level modifier for specific elements, e.g. "fire magic level +2", which means only fire damage spells are boosted. Possible elements include Fire, Earth, Energy, Ice, Holy, Death and Healing. https://tibia.fandom.com/wiki/Updates/12.70.10953
yo guys, lets test this and give feedback, lets merge this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to remove the iologindata changes and related changes
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 |
@EPuncker i forgot revert fix for debug build after master merge, i will revert this changes + fix formatting |
This reverts commit 2c4352d.
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 string_view issue appear again - fixed @omarcopires for me old mana shield is viable for EVO and FUN ots, personally i developed 12+ OTS(FUN) with old mana shield |
there are 5 failing checks, can you verify them please? |
New config
New Lua function
Modified lua script