• 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

Adding custom curse to Oracle

ElvenDragon

New member
I'm adding a custom curse to Oracle, and I got it mostly working, there are just 2 things I can not figure out how to do.

1) Give it a bonus revelation at level 10
2) A choice of one of 2 spells at level 15

Could anyone could point me in the right direction to do this, kind of new to all of this.
 
Access question

Looking into things a bit further, I found something similar to this should work:

Code:
~If we are level 10 or above then
~add one Relation 
~Note: This is the dirty way of doing this
~      because we are assuming certain values, at certain spots.
~      will fix once we get it working.

if (#levelcount[Oracle] >= 10) then
      root.field[cCustTeTot].arrayvalue[9] += 1
      root.field[cCustTeTot].arrayvalue[10] += 1
      root.field[cCustTeTot].arrayvalue[14] += 1
      root.field[cCustTeTot].arrayvalue[18] += 1
      endif

But it gives errors about being unable to reliably access bootstrap source of my curse.
Makes sense because it probably trying to access cCustTeTot of it and not the class.
So question is, what so I need to do to be able edit something in the oracle class on the character, so I can change it?
 
Ok, Making headway:

Code:
~If we are level 10 or above then
~add one Relation 
~Note: This is the dirty way of doing this
~      because we are assuming certain values, at certain spots.
~      will fix once we get it working.

if (#levelcount[Oracle] >= 10) then
      hero.childfound[cHelpOra].field[cCustTeTot].arrayvalue[9] = 4
      hero.childfound[cHelpOra].field[cCustTeTot].arrayvalue[10] = 5
      hero.childfound[cHelpOra].field[cCustTeTot].arrayvalue[14] = 6
      hero.childfound[cHelpOra].field[cCustTeTot].arrayvalue[18] = 7
      endif

This works.
However, 2 things of note:
field[cCustTeTot].arrayvalue is not treated as a number by default so the += plan does not work.
We are also assuming that this table will never change.

Both these problems I feel could be fixed with a foreach loop, but foreach statements in HL are a little odd compared to what I'm use to, but I'm still trying to figure it out.
 
Part 1 done

Ok, that part is done, though I had a hard time trying to figure out a foreach, so I cheated and used a while loop, would of basically worked the same either way.

Code:
~ Because may need the levelcount later
var lvlc as number
lvlc = #levelcount[Oracle]

~If we are level 10 or above then
~add one Relation 
if (lvlc >= 10) then
~t will be our current value within the array
 var t as number
~lc is our loop count/array index, arrays start at 0, not one so.
 var lc as number
 lc = 0

~ now we will loop up till our current level
 while (lc < lvlc)
~get the current value
  t = hero.childfound[cHelpOra].field[cCustTeTot].arrayvalue[lc]
~check to see if it's more then 0
  if (t > 0) then
~it is,so set +1, put the new value in the array.
   t += 1
   hero.childfound[cHelpOra].field[cCustTeTot].arrayvalue[lc] = t
   endif
~increase our loop count by one
  lc += 1
~and start the loop again
  loop
~loop is complete, so we dare now done.
 endif

Please note, I did try to start the loop count at 9 (Level 10), but for some reason that wasn't working properly, so I had to change it to start at 0 (level 1).
 
Last edited:
Back
Top