Magic

Magic

190k Downloads

Weird XP cost behavior

omgitsKit opened this issue · 4 comments

commented

Hello!

I’m trying to make a custom magic system that uses xp as casting resource. For testing purposes I’ve recreated Magic Missile with a cost of 5 xp points.

For some reason, in some cases, the first cast seems to consume 1 extra point, making, for example, a player only able to cast the spell 3 times while having 20 points when they’re supposed to cast 4 times.

It’s very inconsistent, and I noticed that this happens with 15, 20 and 50 points (haven’t tested beyond that). It consumes the intended value at 5, 10 and 25 - 45 for example.

commented

Would you be able to share your spell config here?

commented

Sure! It's very straight foward tho, since I just replaced the mana cost to xp: 5 in every level.

Additionally, I've noticed the same issue with different spells and same numbers. For instance, a spell costing 10 xp sometimes would consume 11 xp.

missilexp.json

commented

Thank you!

And can I also ask, what are you using to check player's XP? A command?

commented

so sorry for the late reply. I used both vanilla /xp query and the placeholder %player_current_exp% from the Player Module (PlaceholderAPI)