Member
Join Date: Oct 2011
Location: Browns Mills, NJ
Posts: 75
|
I'm trying to code a legacy weapon, and want to control the dex bonus it grants as the wielder increases in level.
I tried using if (#totallevelcount[] >= 17) & (#hasfeat[fToBGLDW]) then #enhancementbonus[hero.child[aDEX], 6] elseif (#totallevelcount[] >= 14) & (#hasfeat[fToBL2DW]) then #enhancementbonus[hero.child[aDEX], 4] elseif (#totallevelcount[] >= 7) & (#hasfeat[fToBLLDW]) then #enhancementbonus[hero.child[aDEX], 2] endif but it seems to be crapping out on my use of "& (#hasfeat[xxxx]") as it was working fine before I added that bit. Suggestions? |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Use nested ifs:
Code:
if (#hasfeat[fToBLLDW] <> 0) then if (#totallevelcount[] >= 17) then elseif (#totallevelcount[] >= 14) then elseif (#totallevelcount[] >= 7) then endif endif |
#2 |
Member
Join Date: Oct 2011
Location: Browns Mills, NJ
Posts: 75
|
|
#3 |
Member
Join Date: Oct 2011
Location: Browns Mills, NJ
Posts: 75
|
Okay, so I plug in
if (#totallevelcount[] >= 17) then if (#hasfeat[fToBGLDW] <> 0) then elseif (#totallevelcount[] >= 14) then if (#hasfeat[fToBL2DW] <> 0) then elseif (#totallevelcount[] >= 7) then if (#hasfeat[fToBLLDW] <> 0) then endif endif endif endif but its no longer giving me the +2 DEX at level 7 when the feat is known (or at any level). Did I miss something? NVM. My eyes are tired. LOL Last edited by TalMeta; August 27th, 2012 at 03:49 PM. Reason: duh! |
#4 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Code:
if (#totallevelcount[] >= 17) then if (#hasfeat[fToBGLDW] <> 0) then elseif (#totallevelcount[] >= 14) then if (#hasfeat[fToBL2DW] <> 0) then elseif (#totallevelcount[] >= 7) then if (#hasfeat[fToBLLDW] <> 0) then endif endif endif endif |
#5 |
Member
Join Date: Oct 2011
Location: Browns Mills, NJ
Posts: 75
|
Quote:
|
|
#6 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Don't you want:
Code:
if (#totallevelcount[] >= 17) then if (#hasfeat[fToBGLDW] <> 0) then endif elseif (#totallevelcount[] >= 14) then if (#hasfeat[fToBL2DW] <> 0) then endif elseif (#totallevelcount[] >= 7) then if (#hasfeat[fToBLLDW] <> 0) then endif endif |
#7 |
Thread Tools | |
Display Modes | |
|
|