Skip to content

Purging Staff Spec at Yama#130

Closed
Lexer747 wants to merge 2 commits into
ngraves95:mainfrom
Lexer747:pr-80-purging-staff-spec
Closed

Purging Staff Spec at Yama#130
Lexer747 wants to merge 2 commits into
ngraves95:mainfrom
Lexer747:pr-80-purging-staff-spec

Conversation

@Lexer747
Copy link
Copy Markdown
Collaborator

@Lexer747 Lexer747 commented Apr 16, 2026

Summary

Stacks on #129

Fixes #80

Some reasoning about why this is hard coded to Yama, there's 3 pieces to the purging staff puzzle:

  1. Are we specing on this attack?
  2. How much damage are we hitting?
  3. How much hp does our target have?

If we can answer all three questions we can solve the spec. This PR currently answers (1.) and (2.) albeit quite poorly and in a brittle way [1], however the 3rd question is actually the hardest 😅 because the client isn't given an NPC's health directly only a funny ratio number:

	/**
	 * Gets the health of the actor in {@link #getHealthScale()} units.
	 *
	 * The server does not transmit actors' real health, only this value
	 * between zero and {@link #getHealthScale()}. Some actors may be
	 * missing this info, in which case -1 is returned.
	 */
	int getHealthRatio();

	/**
	 * Gets the maximum value {@link #getHealthRatio()} can return
	 *
	 * For actors with the default size health bar this is 30, but
	 * for bosses with a larger health bar this can be a larger number.
	 * Some actors may be missing this info, in which case -1 is returned.
	 */
	int getHealthScale();

Therefore the best way to tackle question 3. is just to hard code the hp values we care about and IMO the only relevant usage of the purging staff spec is void flares so that's all this PR tackles.

Also this leads me to next PR which will be the 1 tick speed up when you perfectly the dodge the shadow meteors because the plugin still gets confused by that during P3.


Implementation

Add a new variable speed implementor and change the signature to include the hp and spec [1].

This new class will only work when in the yama region and it does the following things:

  • Tracks the phase of yama (so that we can infer the void flare starting health)
  • Tracks void flare's we attack and their current hp
  • Finally if the current attack would kill a void flare and the spec has drained by 25% then we reduce the speed by 2 ticks [2].

[1] = Note these still need work as they will pass stale data ATM
[2] = this also needs work if you eat during those 3 ticks the plugin is bugged see wiki for details

Testing

https://www.youtube.com/watch?v=VISRalz_6nE

@Lexer747 Lexer747 changed the title #80 Purging Staff Spec at Yama Purging Staff Spec at Yama Apr 16, 2026
@Lexer747 Lexer747 marked this pull request as ready for review April 16, 2026 19:24
@Lexer747 Lexer747 requested review from ngraves95 April 16, 2026 19:24
@Lexer747 Lexer747 force-pushed the pr-80-purging-staff-spec branch from 715d8eb to 9cd012c Compare May 9, 2026 10:37
@Lexer747 Lexer747 mentioned this pull request May 10, 2026
@Lexer747 Lexer747 closed this May 10, 2026
Lexer747 added a commit that referenced this pull request May 10, 2026
## Summary

Supersedes #130, this has all the same functionality but also handles the shadow crashing :) this makes Yama fully functional with the plugin and it shouldn't mis-count anymore!

This is the first feature which is working outside the `onGameTick` as it's graphics object based.

### Yama Shadow Crash

This is implemented unfortunately in `onRender` since we use the literal graphics of the fireballs to determine, if the player is in the correct tile and the timing is right. Timing was easy as we can just look for animation frame to be the correct tick. The location was a bit trickier since this was the first time I've really thought about that part of the client API.

Because this is being called in `onRender` we make sure to return early if the player is not in the correct region and yama isn't actually in P3. However once those conditions are true there is some wasteful computation as every cycle we re-compute all the fireball lines, however I don't think this takes long enough to actually affect performance negatively.

### Purging Staff

Original description for Purging staff spec:

Some reasoning about why this is hard coded to Yama, **there's 3 pieces to the purging staff puzzle**:

1. Are we specing on this attack?
2. How much damage are we hitting?
3. How much hp does our target have?

If we can answer all three questions we can solve the spec. This PR currently answers (1.) and (2.) albeit quite poorly and in a brittle way [1], however the 3rd question is actually the hardest 😅 because the client isn't given an NPC's health directly only a funny ratio number:
```java
	/**
	 * Gets the health of the actor in {@link #getHealthScale()} units.
	 *
	 * The server does not transmit actors' real health, only this value
	 * between zero and {@link #getHealthScale()}. Some actors may be
	 * missing this info, in which case -1 is returned.
	 */
	int getHealthRatio();

	/**
	 * Gets the maximum value {@link #getHealthRatio()} can return
	 *
	 * For actors with the default size health bar this is 30, but
	 * for bosses with a larger health bar this can be a larger number.
	 * Some actors may be missing this info, in which case -1 is returned.
	 */
	int getHealthScale();
```
Therefore the best way to tackle question 3. is just to hard code the hp values we care about and IMO the only relevant usage of the purging staff spec is void flares so that's all this PR tackles.

Also this leads me to next PR which will be the 1 tick speed up when you perfectly the dodge the shadow meteors because the plugin still gets confused by that during P3.

-----

#### Implementation

Add a new variable speed implementor and change the signature to include the hp and spec [1].

This new class will only work when in the yama region and it does the following things:
* Tracks the phase of yama (so that we can infer the void flare starting health)
* Tracks void flare's we attack and their current hp
* Finally if the current attack would kill a void flare and the spec has drained by 25% then we reduce the speed by 2 ticks [2].

[1] = Note these still need work as they will pass stale data ATM
[2] = this also needs work if you eat during those 3 ticks the plugin is bugged see wiki for details

fixes #80

## Testing
Melee testing: https://youtu.be/nTnF5Pd0gBI
Mage testing: https://youtu.be/viyEn7mcdDw

Range i don't care about
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Purging Staff special attack support.

1 participant