• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Another Feat

Manalishi66

Well-known member
Got another feat, got most to work, but need to know how to make the chosen skill rank 10+ bonus to apply to the chosen skill not both?

Feat....

You get a +2 racial bonus on all Diplomacy checks. For this feat, choose either the Sense Motive skill or the Bluff skill. This choice is permanent. Gain a +2 racial bonus in the chosen skill. If you have 10 or more ranks in one of these skills, the bonus increases to +4 for that skill.

Code....

#skillbonus[skDiplo] += 2


~ If we're disabled, do nothing
doneif (tagis[Helper.SpcDisable] <> 0)

#applybonus[Bonus, field[usrChosen1].chosen, 2]
perform forward[ClassSkill.?]

~and another two once we're at 10 ranks
if (#skillranks[skBluff] >= 10) then
#skillbonus[skBluff] += 2
endif
if (#skillranks[skSenseMot] >= 10) then
#skillbonus[skSenseMot] += 2
endif
 
Since macros can't really be passed objects, you won't be able to use the macro and reference the usrChosen1 item with it. You can, however, access the proper bonus field directly via the userchosen1 object:

Code:
#racialbonus[skDiplo] += 2

if (field[usrChosen1].chosen.field[skUser].value >= 10) then
   field[usrChosen1].chosen.field[Racial].value += 4
else
   field[usrChosen1].chosen.field[Racial].value += 2
endif

Notice I referenced the 'Racial' field, which is for handling Racial Bonuses. You should always make sure you use the right bonus fields, so that stacking is handled properly.

Note: I did not actually HANDLE the stacking properly here - to do so you'd have to get more complicated checking the current value of the Racial field and setting it only if it is currently less than the new value - not really as important with Racials, as there are limited sources of them. The above does at least show you how to reference the appropriate fields. Below I'll show a completed script with the proper checking:

Code:
#racialbonus[skDiplo] += 2

var bonValue as number

if (field[usrChosen1].ischosen <> 0) then
   if (field[usrChosen1].chosen.field[skUser].value >= 10) then
      bonValue = 4
   else
      bonValue = 2
   endif

   if (field[usrChosen1].chosen.field[Racial].value < bonValue) then
      field[usrChosen1].chosen.field[Racial].value += bonValue
   endif
endif
 
Last edited:
Got another feat, got most to work, but need to know how to make the chosen skill rank 10+ bonus to apply to the chosen skill not both?

Feat....

You get a +2 racial bonus on all Diplomacy checks. For this feat, choose either the Sense Motive skill or the Bluff skill. This choice is permanent. Gain a +2 racial bonus in the chosen skill. If you have 10 or more ranks in one of these skills, the bonus increases to +4 for that skill.

Code....

#skillbonus[skDiplo] += 2


~ If we're disabled, do nothing
doneif (tagis[Helper.SpcDisable] <> 0)

#applybonus[Bonus, field[usrChosen1].chosen, 2]
perform forward[ClassSkill.?]

~and another two once we're at 10 ranks
if (#skillranks[skBluff] >= 10) then
#skillbonus[skBluff] += 2
endif
if (#skillranks[skSenseMot] >= 10) then
#skillbonus[skSenseMot] += 2
endif
So you are on the general right path. You have code though above your doneif and that shouldn't be. You want to always put new code after your doneif. The doneif is your "shut down" code that prevents the script from running if something "else" has disabled your Racial Special.

Code:
~ If we're disabled, do nothing
doneif (tagis[Helper.SpcDisable] <> 0)

~ Give a +2 bonus to Diplomacy 
hero.child[skDiplo].field[Racial].value += 2

Now the next issue is that the +2 should not be hard-coded because we could have +2 or +4 to add. So lets make it soft-coded:
Code:
~ If we're disabled, do nothing
doneif (tagis[Helper.SpcDisable] <> 0)

~ Set initial bonus to +2
field[abValue].value += 2

~ Give a +2 bonus to Diplomacy 
hero.child[skDiplo].field[Racial].value += field[abValue].value
So that is a step in the right direction as now we are no longer hard-coded. Now lets add in the selection for Bluff or Sense Motive
Code:
~ If we're disabled, do nothing
doneif (tagis[Helper.SpcDisable] <> 0)

~ Set initial bonus to +2
field[abValue].value += 2

~ Give a +2 bonus to Diplomacy 
hero.child[skDiplo].field[Racial].value += field[abValue].value
~ Give a +2 bonus to Bluff or Sense Motive
field[usrChosen1].chosen.field[Racial].value += field[abValue].value
So now we are giving a bonus to both Diplomacy and either Bluff or Sense Motive. But we need to give a +4 bonus if we have enough ranks.

Code:
[B][COLOR="Green"]~ If we're disabled, do nothing[/COLOR][/B]
doneif (tagis[Helper.SpcDisable] <> 0)
[B][COLOR="Green"]
~ Set initial bonus to +2[/COLOR][/B]
field[abValue].value += 2

[B][COLOR="Green"]~ If Bluff or Sense Motive is 10+ ranks we increase to +4[/COLOR][/B]
if (field[usrChosen1].chosen.field[skUser].value >= 10)
  field[abValue].value += 2
[B][COLOR="Green"]~ If Diplomacy is 10+ ranks we increase to +4[/COLOR][/B]
elseif (hero.child[skDiplo].field[skUser].value >= 10
  field[abValue].value += 2
endif

[B][COLOR="Green"]~ Give a Racial bonus to Diplomacy [/COLOR][/B]
hero.child[skDiplo].field[Racial].value += field[abValue].value
[B][COLOR="Green"]~ Give a Racial bonus to Bluff or Sense Motive[/COLOR][/B]
field[usrChosen1].chosen.field[Racial].value += field[abValue].value

Just a note Fuzzy like Andrew mentioned racial bonuses stack. Also almost everything has a abValue and you should use that instead of making up new fields. For one it standardizes the code and allows outside scripts to modify the value. Or outside Things to get the value. Plus its memory space that is already defined for each "Thing" so we are not using up "new" memory that has to be garbage collected.

For setting a bonus field instead of a "if" statement its easier to use a maximum() function instead. This is actually all the #applybonus[] macros are doing under the covers. In example:
Code:
field[usrChosen1].chosen.field[Racial].value = maximum(field[usrChosen1].chosen.field[Racial].value,bonValue)

you also should be able to use field[usrChosen1].chosen with the #racialbonus[] macro
While you can use "each", "eachpick", "eachthing" in a macro field[usrChosen1].chosen is usually not liked by macros as it they get confused on the "field" part. :(
 
Fuzzy, don't Racial bonuses stack like untyped bonuses?

Ha.. yeah, of course they do.. I was focused on the scripting I forgot to pay attention to the actual rules.. :-) So yeah, my script then would work, just getting rid of the check for < bonValue, and change the = bonValue to += bonValue:

Code:
#racialbonus[skDiplo] += 2

var bonValue as number

if (field[usrChosen1].ischosen <> 0) then
   if (field[usrChosen1].chosen.field[skUser].value >= 10) then
      bonValue = 4
   else
      bonValue = 2
   endif

   field[usrChosen1].chosen.field[Racial].value += bonValue
endif

I couldn't really tell from your rule text, if the +4 for >= 10 ranks applies to the diplo skill as well as the chosen skill.
 
Last edited:
Back
Top