Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - D&D 5th Edition SRD (http://forums.wolflair.com/forumdisplay.php?f=89)
-   -   Proficiency Bonus on an item (http://forums.wolflair.com/showthread.php?t=63241)

Imastir September 24th, 2019 11:14 PM

Proficiency Bonus on an item
 
Hi all,
I'm trying to create a ring that gives a general proficiency bonus to a char.
But i have tried to find out the coding behind it but i'm not too great in programming, could someone provide me the code to insert so the bonus is Added to all the stats where proficiency comes into play ?

Thanks in advance,
Imastir

dungeonguru September 25th, 2019 07:05 AM

This is a head scratcher.

It should be as easy as:

Code:

hero.child[ProfBonus].field[Bonus].value += 1
but that's not working for me... It might be that the proficiency bonus can't be globally modified or I haven't figured out timing yet.

You can try a workaround like:

Timing - post-attributes/10000
Code:

      doneif (field[gIsEquip].value = 0)
      doneif (field[gIsAttuned].value = 0)

      foreach pick in hero where "Helper.Proficient"
        eachpick.field[Bonus].value += 1
        nexteach

The code snippet won't change the proficiency bonus globally shown, but every thing you have a proficiency for will reflect it, and it probably won't work for tools.

dungeonguru September 25th, 2019 08:26 AM

Followup, I figured out you can manipulate the end total directly, just not the way that makes the most sense:

Post-levels/10000 timing:
Code:

      doneif (field[gIsEquip].value = 0)
      doneif (field[gIsAttuned].value = 0)
      ~ add 1 to total proficiency bonus.
      hero.child[ProfBonus].field[tProfBonus].value += 1

The first two lines check to see if the item is equipped and attuned, then it adds 1 to the total bonuses added to proficiency.

Imastir September 26th, 2019 04:05 AM

Wow, thanks for the quick response, the last code seems to work :D
Saves, abilities, spell casting,... all seem to change correctly.

Thanks for that, wouldn't have figured it out by myself

Ty,
Imastir

Lj Stephens September 26th, 2019 05:21 AM

Awesome! Thanks Dungeonguru!

Fenris447 September 26th, 2019 05:33 AM

Guru, I'm curious how your code will interact with stuff like Jack of All Trades and Remarkable Athlete. Granted, I'm not sure OP has thought about that either. Just something to mull over.

Mergon September 26th, 2019 05:48 AM

One way to find out is to play with the Proficincy adjustment added by ShadowChemosh. :)

dungeonguru September 26th, 2019 06:15 AM

@Fenris477: Jack of all Trades & Remarkable Athlete add the tag Helper.ProfHalf to the skills at post-level 10000. The timing of my example is set at the same time, so I suspect it would be better to run the proficiency adjustment earlier than Post-Level 10000. :D

@Mergon: I forget about the adjustments, but I see ShadowChemosh put his in during the First timing phase. ALSO, as a disclaimer, I don't use the community files so I forget to look at them unless I hit something I can't figure out after fooling with it for a while.

End of day, should probably run it when ShadowChemosh puts it in timing although in my mind there are some reasons to run it post-levels (maybe at 5000).

Mergon September 26th, 2019 06:18 AM

<smile>


All times are GMT -8. The time now is 02:24 AM.

Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.