[v1.3.0+] Use Alchemist Gems From Inventory

A place to post your add ons and ideas for them

Moderator: Moderator

Post Reply
Message
Author
Zizzo
Sher'Tul Godslayer
Posts: 2517
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

[v1.3.0+] Use Alchemist Gems From Inventory

#1 Post by Zizzo »

Dunno if anyone else does this, but I like to keep some low-tier alchemist gems around to use for talents like Gem Portal or Refit Golem, saving my high-tier gems for bombs. It's kind of annoying swapping wielded gems every time, so I whipped up a new addon Use Alchemist Gems from Inventory. This affects the talents:
  • Refit Golem
  • Gem Portal
  • Throw Bomb
  • Shockwave Bomb
  • Thunderclap
(Let me know if I've missed any…) On the right-click binding menu for the talent (or via the Talents dialog), you can choose the new option "Prompt for alchemist gems to use with this talent"; with that in place, when you use the talent, an inventory dialog will pop up listing your alchemist gems in inventory and in your quiver, allowing you to choose which ones to use. Canceling out of this dialog will cancel the talent usage.

Now, to make this work, the internal implementation has to actually physically swap the selected gems into the quiver before using the talent and back out afterward, so you'll see log messages to that effect (I've tried to make an effort to avoid triggering Swift Hands' cooldown; let me know if I got that wrong or missed something related). And yes, technically this is probably sort of cheating, so it probably won't be going into ZOmnibus.

[And for addon developers, if your addon adds talents that use alchemist gems and you want them to be bindable with this talent, all you need to do is add a 'uses_alchemist_gems' field to your talent definition; its value should be either the number of gems needed or a function(self,t) that returns the number of gems needed.]

[Technical notes:]

Code: Select all

Hooks:
  ToME:load [to mark talents that use alchemist gems]
Superload:
  mod.class.Actor:
    hasAlchemistWeapon() [to change alchemist gems for talent description purposes]
    preUseTalent() [to prompt for and wield alchemist gems]
    postUseTalent() [to re-wield original alchemist gems]
  mod.dialog.UseTalents:
    use() [overloaded, to add our binding to the appropriate talents]
"Blessed are the yeeks, for they shall inherit Arda..."

Zizzo
Sher'Tul Godslayer
Posts: 2517
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.3.0+] Use Alchemist Gems From Inventory

#2 Post by Zizzo »

Quickie release 1a, adding a warning popup to the character creation dialog to prevent this addon from being used with the (for now) mutually incompatible Arcane Combat Tweaks addon.
"Blessed are the yeeks, for they shall inherit Arda..."

Zizzo
Sher'Tul Godslayer
Posts: 2517
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.3.0+] Use Alchemist Gems From Inventory

#3 Post by Zizzo »

Release v2 uses the new UseTalents:generate and UseTalents:use hooks added by DarkGod (thanks again!) to add our "Prompt for alchemist gems to use with this talent" command to the right-click menu of talents that use alchemist gems. There should be no visible change in functionality, but we're now compatible with Arcane Combat Tweaks (for all your really eclectic Adventurer needs :wink: ) — if you upgrade both addons at the same time.

[And another reminder here: if you're using this addon together with Restart Sustains or ZOmnibus, be sure to upgrade those addons when you upgrade this one.]

Also, as long as I was in the neighborhood, I added markers to the hotkey icons of any talents that you've bound to prompt for alchemist gems, as a convenient reminder:
bind-mark.png
bind-mark.png (26.94 KiB) Viewed 4788 times
"Blessed are the yeeks, for they shall inherit Arda..."

Zizzo
Sher'Tul Godslayer
Posts: 2517
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.3.0+] Use Alchemist Gems From Inventory

#4 Post by Zizzo »

Been playing around with Werekracken's Earth Mage class, mostly on the strength of having extra regeneration and detrimental effect removal talents that cost alchemist gems. Of course, these are exactly the sort of talents that I keep low-level alchemist gems around for, so in v2b we mark the Earth Mage's Liquefaction, Rejuvenation and Cleansing Crystals talents as usable with our gem-swap binding.
"Blessed are the yeeks, for they shall inherit Arda..."

Post Reply