magemonkeystudio / divinity

GNU General Public License v3.0
10 stars 8 forks source link

[Bug]: Mechanic "Damage Lore" does not work with items created with prorpgitems #95

Closed sakimoe closed 2 years ago

sakimoe commented 2 years ago

Is there an existing issue for this?

Current Behavior

When creating a sword with prorpgitems, regardless of the damage the sword has, when I use a SkillApi ability using the Damage lore mechanic, the damage done is not what it should. For example, create a sword using Rpgitems with 20 damage, and an ability using the damage lore mechanic that should do 50% of the weapon's damage equivalent to 10 damage, but instead when using the ability it deals 20 damage as if it were taking 100% of the weapon's damage... It is ruled out that it is due to my regular expression, Since my ability works perfectly if instead of using an item made with rpgitems I grab a vanilla item and add a lore with the /lore add command, when doing this the ability does 50% of the damage correctly. In turn, this problem occurs with skills that use higher values ​​such as 150% or 200% of weapon damage. image This is an item generated with prorpgitems \u2694 Daño: {value} This is the regex that I use, I have tried without \u2694 but it does not work either, in turn I tried removing the color codes and it still does not work

Expected Behavior

I suppose it is a problem directly related to Prorpgitems, since as mentioned in the above, the Damage lore mechanic works perfectly if a vanilla item is used with a custom lore image

Steps To Reproduce

  1. Create a skill with the mechanic of Damage lore
  2. Create an item with prorpgitems
  3. In engine.yml change: image
  4. In Damage.yml change: image
  5. Everything else is by default, the only changes I made was to translate the names Attachments file of my item and skill: Skill 1.txt espada_comun.txt

Environment

- Server Software: Paper Spigot 1.17.1
- ProSkillAPI Version: 1.1.7.11-ALPHA
- ProMCCore Version: 1.0.3.5-ALPHA
- Plugins: 
ItemMods, LuckPerms, custom-ore-generator, PlaceholderAPI, ClearLag, KnokkoCore, ProtocolLib, LibsDisguises, CustomItems, Vault, eRankUP, WorldEdit, Essentials, RiseCore, HolographicDisplays, WorldGuard, Multiverse-Core, Citizens, MythicMobs, EconomyShopGUI, ModelEngine, Terra, ProMCUtilities, ProRPGCrafting, ProMCCore, Kingdoms, ProRPGItems, ProSkillAPI, BeautyQuests

latest.log

No response

Anything else?

No response

sakimoe commented 2 years ago

I have verified that if I use a sword or any vanilla item and use the /qrpg set damage command, the same thing happens, the skill's damage is not applied correctly, so it is most likely that it is a problem with the damage of the items created with prorpgitems or the compatibility it has with proskillapi

sakimoe commented 2 years ago

Hi again, I found perhaps the source of the error, as the damage lore mechanics could not be solved, I used the Value lore mechanics as a substitute and I directly used the Damage mechanics, but I found that if in the Damage mechanics I left the active knockback option: image The damage is bug and happens the same as with Damage lore, the damages with multipliers greater than 1 (1.5 = 150% for example) go very high, so they do much more damage than they should and if less damage is used a 1 (0.5 = 50%) the damage is not applied and instead takes the total damage of the item (If I have a weapon with 10 damage and I do a skill with 50% weapon damage, the 10 total damage of the weapon is applied instead of 50% so it ignores the multiplier entirely).

Edit: I don't know if the damage lore mechanic has something similar to what happens with Value lore and knockback, so I suppose that could be the error that occurs

lordsrubka5 commented 2 years ago

This is not just the issue for your values, I have the dame probem in issue promcteam/proskillapi#177

goflishMC commented 2 years ago

This might be related to a similar issue I noticed.

Prorpgitems does extra damage when using skillapi skills based on damage in the lore of the item from rpgitems plugin. (even without using damage lore mechanic in skillapi you can still damage a player, you can test this by doing cast trigger, then any target, then use the skill within range of another player while holding an item in your hand from rpgitems that has damage lore from rpgitems custom damage)

it adds the values in the lore to whatever damage is set in skillapi skills, if skillapi has no damage set, it will still damage the target based on the items lore.

Travja commented 2 years ago

My thoughts here are that it's actually firing damage events through RPGItems, causing it's damage system to inflict damage, overriding the skill damage in a way. This'll be an interesting bug to figure out.

goflishMC commented 2 years ago

@Travja

an easy way to test this is to make a skillapi skill that has a cast trigger and any target

then make an rpgitem with some physical damage on it

hold the rpgitem in your hand and then do /class cast at a mob or another player

Travja commented 2 years ago

So I'm currently working on a fix to this... but there's a bit of a caveat. I have it mostly working. I'm just trying to decide if it's a good thing to have RPGItems' crit chance/modifier apply for skills being cast or not. Right now it's modifying the damage done based on equipped items, but I did get it to stop adding the equipped item's damage to the skill damage. Thoughts on crit damage and possibly other modifiers being applied when skill damage is done? Or should it just be skill damage?

sakimoe commented 2 years ago

I would prefer that only the damage of the ability be done, that of giving critical I prefer to control it separately, if it is not a mess then balancing the damage of the abilities, or what could be done if that "critical" is required is to use Value multiply or some mechanics to simulate that critical damage