View Full Version : [Extension] Targetable CRIT
Kelrugem
November 26th, 2020, 20:55
Deprecated since the functionality provided here is now integrated in the base code :)
Hi :)
EDIT2: The CRIT stuff is now in the main code! :) So, only about the DMGTYPE stuff, see the EDIT note :)
I have seen that question very frequently, so, I made a very small extension: The effect CRIT is now targetable, that means that you can code things like IFT: CUSTOM(test); CRIT: 19; moreover, it supports the descriptors melee, ranged and opportunity, so, CRIT: 19, melee would only affect melee weapons :)
EDIT: Now DMGTYPE is targetable, too :)
But: It may be incompatible with other extensions (I can rewrite it for better compatibility but I have no time right now), and I may not have time to maintain it, hence, I would be very glad when someone could take over.
For devs: It is very easy:
Overwrite AttackManager of the 5e ruleset, search for
local aCritRange = EffectManager5E.getEffectsByType(rSource, "CRIT")
and replace it with
local aCritRange = EffectManager5E.getEffectsByType(rSource, "CRIT", aAttackFilter, rTarget);
Best,
Kelrugem :)
LICENSE: Normally CC-BY-NC for my extensions, i.e. you can use and change it however you want, integrate it in your code and reupload it etc., so you can do everything what you want with these extensions but do not commercialize it :) (and SmiteWorks is allowed to do anything and everything with it :D) But since this code is so simple and straightforward I do not dare to take any copyright over this, so, do what you want with that, but no commercialization :)
EDIT: Now DMGTYPE is targetable, too :) The code change is similar as above, search for the following in the DamageManager:
local aEffects = EffectManager5E.getEffectsByType(rSource, "DMGTYPE", {});
and change to
local aEffects = EffectManager5E.getEffectsByType(rSource, "DMGTYPE", {}, rTarget);
Zacchaeus
November 26th, 2020, 21:04
Nice one :)
LordEntrails
November 26th, 2020, 22:12
Nice.
And since you are hoping someone takes over, perhaps you could list a license (CC-NC or CC-BY-NC) so folks can know and carry that forward? :)
There's always that link in my sig to help you decide which license to use.
Kelrugem
November 26th, 2020, 22:17
Nice.
And since you are hoping someone takes over, perhaps you could list a license (CC-NC or CC-BY-NC) so folks can know and carry that forward? :)
There's always that link in my sig to help you decide which license to use.
Yeah, my license stuff is in my general extension thread, but I clarified it here again in the first post since it is for 5e :)
Dudin
December 21st, 2020, 16:51
Hey Kelrugem,
I was trying to see if I could use your extension to make the coding of a 5e Short Sword of Life Stealing work better.* The magic sword is supposed to do an additional 3D6 damage if you hit with a critical swing.* Right now I have it as an effect on the PC holding the sword as "Shortsword of Life Stealing;DMG: 3d6 necrotic, critical;" so that it adds the 3D6 when it they crit.* The only drawback is that when they use a different weapon like a bow, they may forget this blanket effect is on and it will apply the 3D6 despite it not being with the sword.* Would this extension be able to make it exclusive to melee?* I tried using the effect "Shortsword of Life Stealing;DMG: 3d6 necrotic, melee, critical;" thinking the melee tag would work as you wrote, but to no luck.* Any advice?**
Kelrugem
December 21st, 2020, 17:31
Hey Kelrugem,
I was trying to see if I could use your extension to make the coding of a 5e Short Sword of Life Stealing work better.* The magic sword is supposed to do an additional 3D6 damage if you hit with a critical swing.* Right now I have it as an effect on the PC holding the sword as "Shortsword of Life Stealing;DMG: 3d6 necrotic, critical;" so that it adds the 3D6 when it they crit.* The only drawback is that when they use a different weapon like a bow, they may forget this blanket effect is on and it will apply the 3D6 despite it not being with the sword.* Would this extension be able to make it exclusive to melee?* I tried using the effect "Shortsword of Life Stealing;DMG: 3d6 necrotic, melee, critical;" thinking the melee tag would work as you wrote, but to no luck.* Any advice?**
My extension does not do something in that regard, but with the native code you could try Shortsword of Life Stealing;DMG: 3d6 necrotic, critical, melee; instead :) critical is treated as damage type by FG, so, list it with the damage types before you add descriptors like melee :) However, it will still apply to other melee weapons :)
There is this extension: https://www.fantasygrounds.com/forums/showthread.php?40833-5E-Advanced-Effects-(items-npcs-characters)
That should allow to attach certain effects just to certain weapons :) But I heard of that it is a bit incompatible with the recent changes of the 5e ruleset (the finesse stuff etc.), so, you may need to test it a bit :)
Dudin
December 22nd, 2020, 01:24
I don't know if FGU recognizes "melee" natively. I tried using DMG: 3d6 necrotic, critical, melee; as you said in a bare campaign with zero extensions on. It still would do it regardless of whether it was a ranged or melee ability. I already use the extension you point to, but it just allows you to attach the same effect to a weapon. It doesn't make that effect only apply to that exact weapon. I may just have to make the extra 3d6 an extra attack/power on the PC's sheet and have them roll it when they get a nat 20. Thanks for the help though :)
Kelrugem
December 22nd, 2020, 01:31
I don't know if FGU recognizes "melee" natively. I tried using DMG: 3d6 necrotic, critical, melee; as you said in a bare campaign with zero extensions on. It still would do it regardless of whether it was a ranged or melee ability. I already use the extension you point to, but it just allows you to attach the same effect to a weapon. It doesn't make that effect only apply to that exact weapon. I may just have to make the extra 3d6 an extra attack/power on the PC's sheet and have them roll it when they get a nat 20. Thanks for the help though :)
Ah, I know why, because the range descriptor comes before the damage type! :D So, use DMG: 3d6 melee, necrotic, critical; Sorry, I mixed up the order :)
About the extension: Yes, but there is some checkmark next to weapons' effects, "Action Only" or something like that; you need to mark that in order that that effect is only used for that weapon :) (when it worked correctly, you should see in the CT something like "Applied by: [Weapon name]" :) )
Dudin
December 22nd, 2020, 01:53
The "action only" trick worked. From the description given to the option, I didn't realize it would make the effect only apply to the item it is housed on. It is only working on the sword now. Thanks for your help! :)
Kelrugem
December 27th, 2020, 03:31
DMGTYPE is now targetable, too, so, stuff like IFT: TYPE(undead); DMGTYPE: radiant is now possible :)
Kelrugem
February 16th, 2021, 22:48
Reuploaded the extension for compatibility with the new version of FG :) Only download the new version if you already got the most recent update (at the time of this post) :)
Teknykk
February 17th, 2021, 02:09
I just tested the most recent version in both Classic and Unity, and the CRIT: 19 tag works with IFT clauses, but when I do get a critical hit and roll damage on the target, it doesn't roll the damage and instead brings up an error as shown below. It also does the same thing on a normal hit with the damage roll. Any idea what this might be?
Script execution error: [string "scripts/manager_action_damage.lua"]:137: attempt to index global 'ActorManager2 (a nil value)
Kelrugem
February 17th, 2021, 02:32
I just tested the most recent version in both Classic and Unity, and the CRIT: 19 tag works with IFT clauses, but when I do get a critical hit and roll damage on the target, it doesn't roll the damage and instead brings up an error as shown below. It also does the same thing on a normal hit with the damage roll. Any idea what this might be?
Script execution error: [string "scripts/manager_action_damage.lua"]:137: attempt to index global 'ActorManager2 (a nil value)
Oh, yes, thanks, I've reuploaded :) I forgot that part; I think I have accidentally updated some other version with this and not the one I actually wanted to upload :D Should hopefully now work :)
Teknykk
February 17th, 2021, 02:56
Yup, it works fine now. Cheers! ;)
Rino
March 5th, 2021, 14:13
This extension works nicely in FGU :) thx :)
Kelrugem
April 6th, 2021, 22:13
I updated to the most current version of FG :) (since I am not a 5e user: Feel free to inform me when there was an 5e update such that I can check for incompatibilities; especially when something with respect to damage or attack stuff gets updated :) )
Kelrugem
April 20th, 2021, 20:47
New update of the extension because of this update: https://www.fantasygrounds.com/filelibrary/patchnotes_ruleset.html :)
This means, the CRIT stuff is now in the main code! :) (thanks :) ) So, the extension is now only about the targetability of DMGTYPE, although the extension will keep its name such that you can still simply copy&paste after a download :)
Kelrugem
April 27th, 2021, 19:13
I now deprecate this extension, since DMGTYPE is officially now targetable; thanks Moon Wizard :)
See: https://www.fantasygrounds.com/forums/showthread.php?68069-FG-Ruleset-Updates-2021-04-27
So, you can unload the extension now :D
Powered by vBulletin® Version 4.2.1 Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.