Skip to content

Conversation

@ErwinsExpertise
Copy link
Collaborator

This pull request implements a complete and accurate server-side calculation for the Meso Explosion skill, ensuring that damage is based on the actual mesos consumed and using the official formula. It also adds a correct implementation for the Pickpocket skill, allowing mesos to drop from mobs when the skill procs. Additionally, constants for Meso Explosion's damage formula are now centralized, and client-reported damages are validated to prevent abuse.

Meso Explosion Skill Calculation:

  • Server-side calculation for Meso Explosion now uses the actual mesos consumed, applies the official formula, and validates client-reported damages within a tolerance to prevent exploits (channel/damage_calc.go, channel/handlers_client.go, constant/damage.go) [1] [2] [3] [4] [5].
  • Meso Explosion formula constants are defined in constant/damage.go for maintainability and clarity.

Pickpocket Skill Implementation:

  • Added logic to proc Pickpocket on mob damage, rolling for meso drops according to skill level and dropping mesos at the mob's position for the player (channel/pools.go).

Client Damage Validation:

  • Client-reported damage for Meso Explosion is now checked against a calculated maximum with a variance tolerance, replacing it with the server-calculated value if outside the allowed range (channel/damage_calc.go, channel/handlers_client.go) [1] [2].

channel/pools.go Outdated
}

dropPos := pool.instance.calculateFinalDropPos(v.pos)
pool.dropPool.createDrop(dropSpawnNormal, dropTimeoutNonOwner, mesoAmount, dropPos, true, damager.ID, 0)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Hucaru for some reason this drop is raining from the sky vs dropping from monster pos as normal drops do. Any idea what's wrong?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I follow exactly. Is it acting like Ludi bonus stage drop? Or is the drop starting in the sky instead of the ground? Are you able to post a screenshot so I can see the problem?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it falls from the top of the screen.
https://prnt.sc/6GrltJCe5E7V

Copy link
Owner

@Hucaru Hucaru Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you test with this set to zero https://github.com/Hucaru/Valhalla/blob/master/channel/field.go#L1041 ? I suspect this is passing a cross product check in the foothold above code for a foothold it shouldn't

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I attempted with that and it's still raining. The drop seems to be making it to the correct foothold, however, the animation isn't right.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://prnt.sc/qs0yL-inQAzF

It looks like the drop is coming from a single mob and spreading to all that are hit? I'm assuming this mob is likely the first in the slice, but we are using the indexed position so that doesn't really make sense?

Copy link
Owner

@Hucaru Hucaru Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this might happen when there is a mob that shares the same spawn id as the character on the map.

A quick check would be to to have 2 characters with low id's e.g. 1 and 2 and see if when pickpocket is enabled the drops originate from different monsters. When creating the mesos from pickpocket print the mob spawn id you are hitting and find the origin mob and confirm it has the same id as the character.

A quick hack solution would be to start indexing character id's in the database at 1000 cycle mob IDs up to 1000 instead of max int32. This is very dirty and should just be a final resort.

I think the reason this doesn't happen when a mob dies is because we remove the mob before me make the drop.

Copy link
Owner

@Hucaru Hucaru Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this ends up being the issue don't fix in this PR as player character storage in server might need a rework to be part of life pool

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it seems to mostly work fine with any character past the first index.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, then leave it for now and raise a bug ticket to keep track of it. Exact conditions need to be determined before a proper fix can be determined.

@ErwinsExpertise ErwinsExpertise merged commit a5589c8 into Hucaru:master Jan 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants