Skip to content

feat: Add support for the Serpentine Helm (#429)#522

Open
Infinitay wants to merge 2 commits intoTicTac7x:plugin-chargesfrom
Infinitay:add-serpentine-helm
Open

feat: Add support for the Serpentine Helm (#429)#522
Infinitay wants to merge 2 commits intoTicTac7x:plugin-chargesfrom
Infinitay:add-serpentine-helm

Conversation

@Infinitay
Copy link
Copy Markdown

  • Added support for tracking the charges on the Serpentine Helm

I also added support for the different variants, but I was unable to test it. Though if the Echo Venator Bow PR is anything to go by, it should work. Note, the way the Serp helm works is that the moment you get into combat, you lose 10 scales, followed by another 10 for every 90 ticks which you remain in combat. I wasn't comfortable with hacking in a way to handle this, so I didn't implement it. Additionally, I'm not sure how Jagex handles grace periods because lets say you just finished fighting one NPC. You won't lose 10 immediately when you get into combat with another NPC. If you have any ideas or if you'd like to work on it yourself, that would be wonderful.

Closes #429


java_qtjhueARrQ.mp4

The preview doesn't show the automatic degrading while in combat because I would've exceeded upload file size limit.

- Added support for tracking the charges on the Serpentine Helm
@TicTac7x
Copy link
Copy Markdown
Owner

TicTac7x commented Mar 26, 2026

Check the file https://github.com/TicTac7x/runelite-plugins/blob/plugin-charges/src/main/java/tictac7x/charges/items/barrows/_BarrowsItem.java, it also uses same 90 ticks in combat trigger for degrading, might be exactly the same to add it for this one.

            // Degrade in combat.
            new OnCombat(90).isEquipped().decreaseCharges(1)

@Infinitay
Copy link
Copy Markdown
Author

Yea I did see it, however it wasn't decreasing the charges. I believe it was because I'm setting the SerpentineHelm to a ChargedItemWithStorage due to being able to store the Zulrah scales.

@TicTac7x
Copy link
Copy Markdown
Owner

Since it has storage, you need to remove the specific item (scales) from it, you can do it like so:

new OnCombat(90).isEquipped().consumer(() -> storage.remove(ItemId.ZULRAH_SCALES, 10)

Comment thread src/main/java/tictac7x/charges/items/helms/H_SerpentineHelm.java Outdated
@Infinitay
Copy link
Copy Markdown
Author

Since it has storage, you need to remove the specific item (scales) from it, you can do it like so:

new OnCombat(90).isEquipped().consumer(() -> storage.remove(ItemId.ZULRAH_SCALES, 10)

Oh I figured it's equivalent to what I was already doing with fetching the StorageItem and calling #decreaseQuantity on it. Though, I'll change it out to your snippet instead since it's cleaner.

- Added separate config entries for Magma helm and Tanzanite helm
- Created subclasses H_MagmaHelm and H_TanzaniteHelm from H_SerpentineHelm to track the various variants
- Refactored H_SerpentineHelm to only track the base Serpentine helm
    - Reduced the TriggerItems to base Serpentine helm
    - Created a new constructor with matching parameters as ChargedItemWithStorage to be referenced in the subclasses
		- Moved existing logic into this new constructor except for the TriggerItems
- Modified OnScriptPreFired consumer to check against this.itemId instead of hardcoded Serpentine helm's ID
- Simplified OnCombat consumer to use Storage#remove
@Infinitay
Copy link
Copy Markdown
Author

feat(serpentine-helm): Split Serpentine helm variants into subclasses

  • Added separate config entries for Magma helm and Tanzanite helm
  • Created subclasses H_MagmaHelm and H_TanzaniteHelm from H_SerpentineHelm to track the various variants
  • Refactored H_SerpentineHelm to only track the base Serpentine helm
    • Reduced the TriggerItems to base Serpentine helm
    • Created a new constructor with matching parameters as ChargedItemWithStorage to be referenced in the subclasses
      • Moved existing logic into this new constructor except for the TriggerItems
  • Modified OnScriptPreFired consumer to check against this.itemId instead of hardcoded Serpentine helm's ID
  • Simplified OnCombat consumer to use Storage#remove

@Infinitay
Copy link
Copy Markdown
Author

image https://discord.com/channels/301497432909414422/448811926315728896/1488997128687583453

Someone on the RL Discord was kind enough to test the mutagen serp helm depleting of all charges mid combat, so that trigger should be working.

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.

2 participants