Suprcode / Zircon

Legend of Mir 3 - Official Public Zircon Source
337 stars 256 forks source link

Sin Spell - Massacre #84

Closed phoenixvdp closed 1 year ago

phoenixvdp commented 1 year ago

There's an issue with the base version of this code that can allow a player under certain circumstances to cascade the effects across a map doing increasingly more damage. During testing, we managed to almost do a full map wipe due to the way it can cascade onto additional targets. I'm pretty sure it should have both an upper damage limit and a total cascading targets limit. either way, as it stands it can be (and apparently has always been) exploited.

Lanaya97 commented 1 year ago

Let's create a road map to fix spells and other known bugs in the main source code.

phoenixvdp commented 1 year ago

Some additional information based on discord discussions: firstly the explanation. You get Massacre skill at level 67. It is a passive skill, once you have it, it triggers in the code whenever you kill something as an assassin and have the skill massacre (any level). It triggers 100% of the time when a mob dies from damage owned by the assassin. It only triggers on dead mobs (doesn't trigger on players) When it triggers, it hits; (base version: any number of mobs in a 2-tile radius) with the power of; (base version: a percentage of the mobs total HP)

...IF.. any of those massacred mobs die, the massacre trigger loops back to the start and applies the same, this means that mobs inflicted with a previous massacre can also be re-massacred, its a guaranteed infinite loop of death until all connect mobs are killed, but can be started by a single kill with no limitations. The damage amount also continues to grow through each iteration of the loop, if you have packed maps or huge lures, it's not uncommon to see damage values in the 100k-1mil range

Lanaya97 commented 1 year ago

Does it make sense to make it only trigger when the player kills a mob through direct attack?

phoenixvdp commented 1 year ago

I think it would be better scaled if there was a way to cap the total targets, or potentially only allow a mob to be massacred once in a chain. some sort of condition check to show a mob has already received a 'massacre' attack recently

Lanaya97 commented 1 year ago

Sounds good too, I will work on this spell soon and test what solution could be the most optimized and balanced.

Suprcode commented 1 year ago

Drasterically lowering the magic power of this skill seems to fix the main issue. It takes a percentage of the damage over the HP of monster you just killed, and passes that to the next monster ignoring their defences.

So if a monster has 200 HP, you do 300 damage, 100 damage will be passed to the next monster.

If you reduce the power of this skill to say 5% each level, then only 5 damage of that 100 would be passed to the next monster.

Try that adjustment, and if it doesn't help comment again and I can take another look at a different approach.