• 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

Scaling Dragon Orbs

Kalladar

Well-known member
I wanted to create an artifact similar to the dragon orbs, but have the AC bonus scale with the users level instead of adding the dragon's full natural ac. I was trying something like:

If (hero.herofield(tLevel) >= 20 then
(focus.field[tACNatural].value = 20)

Elseif (hero.herofield(tLevel) >= 15 then
(focus.field[tACNatural].value = 15)

Elseif (hero.herofield(tLevel) >= 10 then
(focus.field[tACNatural].value = 10)

Elseif (hero.herofield(tLevel) >= 5 then
(focus.field[tACNatural].value = 5)

This doesn't work as desired. What am I missing?

Any help would be great.

Thanks,

Kal
 
Phase/Priority?

Also this doesn't seem to be all the code, as you're setting focus somewhere and we can't see to what.
 
I still am trying to use some of the original code which is where the focus comes from. I probably am using it incorrectly. What if I changed it to this?

If (hero.herofield(tLevel) >= 20 then
(hero.herofield[tACNatural].value = 20)

Elseif (hero.herofield(tLevel) >= 15 then
(hero.herofield[tACNatural].value = 15)

Elseif (hero.herofield(tLevel) >= 10 then
(hero.herofield[tACNatural].value = 10)

Elseif (hero.herofield(tLevel) >= 5 then
(hero.herofield[tACNatural].value = 5)

I am going to try this, but what do you think? Will it work?
 
The issue is that you are not closing your parenthesis in the "if/then" lines, and you are using herofield transitions incorrectly. Try:

PostLevel 10000
Code:
if (herofield[tLevel].value >= 20) then
  hero.childfound[ArmorClass].field[tACNatural].value = 20
elseif (herofield[tLevel].value >= 15) then
  hero.childfound[ArmorClass].field[tACNatural].value = 15
elseif (herofield[tLevel].value >= 10) then
  hero.childfound[ArmorClass].field[tACNatural].value = 10
elseif (herofield[tLevel].value >= 5) then
  hero.childfound[ArmorClass].field[tACNatural].value = 5
  endif
 
The issue is that you are not closing your parenthesis in the "if/then" lines, and you are using herofield transitions incorrectly. Try:

PostLevel 10000
Code:
if (herofield[tLevel].value >= 20) then
  hero.childfound[ArmorClass].field[tACNatural].value = 20
elseif (herofield[tLevel].value >= 15) then
  hero.childfound[ArmorClass].field[tACNatural].value = 15
elseif (herofield[tLevel].value >= 10) then
  hero.childfound[ArmorClass].field[tACNatural].value = 10
elseif (herofield[tLevel].value >= 5) then
  hero.childfound[ArmorClass].field[tACNatural].value = 5
  endif
@OP you may want to be doing a += not a =. The above script overrides the natrual armor of the creature and resets it to the above value.

So if a magic item was to give +1 bonus to Natural Armor at Pre-Levels/1000 your script comes in at Post-Levels/10000 an wipes out the +1 with the above value. Is that what you want to do?

If you want to stack with other bonuses to Natural Armor you need to "add" to the existing values instead:
Code:
if (herofield[tLevel].value >= 20) then
  hero.childfound[ArmorClass].field[tACNatural].value [B]+=[/B] 20
elseif (herofield[tLevel].value >= 15) then
  hero.childfound[ArmorClass].field[tACNatural].value [B]+=[/B] 15
elseif (herofield[tLevel].value >= 10) then
  hero.childfound[ArmorClass].field[tACNatural].value [B]+=[/B] 10
elseif (herofield[tLevel].value >= 5) then
  hero.childfound[ArmorClass].field[tACNatural].value [B]+=[/B] 5
  endif
 
Thanks. I appreciate the assistance. I get a little lost sometimes when trying to figure out the field names.
 
I believe orbs of dragonkind are one of the few things which overrides rather than enhances natural armor.
 
I believe orbs of dragonkind are one of the few things which overrides rather than enhances natural armor.
Shrug "could" totally be. I just wanted to be clear in what the script was doing. If so "great" if not I sometimes like to be "verbose" and make sure. :)
 
Back
Top