feat: Add support for the Serpentine Helm (#429)#522
feat: Add support for the Serpentine Helm (#429)#522Infinitay wants to merge 2 commits intoTicTac7x:plugin-chargesfrom
Conversation
- Added support for tracking the charges on the Serpentine Helm
|
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. |
|
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. |
|
Since it has storage, you need to remove the specific item (scales) from it, you can do it like so: |
Oh I figured it's equivalent to what I was already doing with fetching the StorageItem and calling |
- 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
feat(serpentine-helm): Split Serpentine helm variants into subclasses
|

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.