View Single Post
Mergon
Senior Member
 
Join Date: Sep 2012
Location: Ottawa, Canada
Posts: 788

Old April 19th, 2016, 12:16 PM
I am trying to find the fields (or array) that tracks how many spells a hero can cast per spell level.

ie: 5th level caster - 4 x 1st, 3 x 2nd, 2 x 3rd

I'm trying to create an item that grants +1 to the number of 1st level spells a hero can cast.

For example a hero who is a 5th level caster would have 5 x 1st, 3 x 2nd, 2 x 3rd with this item.

I've found a set of children on hero called: SlotHold1 through SlotHold9 that I thought would do the trick.Each has a field named MaxAllow that I thought could e incremented, but I've had no luck.

Here is the code I am using atm:

Phase: Post-Level, Priority: 21000

Quote:
~ If not equipped, get out now!
doneif (field[gIsEquip].value = 0)

~ If not attuned, get out now!
doneif (field[gIsAttuned].value = 0)

~ if not a spellcaster, get out now!
doneif (tagis[Hero.Caster] = 0)

~perform linkage[table].setfocus
~doneif (state.isfocus = 0)

var iLevel as number
iLevel = herofield[tMaxCaster].value

if (iLevel >= 1) then
hero.child[SlotHold1].field[MaxAllow].value += 1
endif

if (iLevel >= 3) then
hero.child[SlotHold2].field[MaxAllow].value += 1
endif

if (iLevel >= 5) then
hero.child[SlotHold3].field[MaxAllow].value += 1
endif

if (iLevel >= 7) then
hero.child[SlotHold4].field[MaxAllow].value += 1
endif
This items should add +1 to the number of spells that the wielder could cast per level of spells he can cast to a max of 4th level spells.

Watch your back, Conserve your ammo,
and NEVER cut a deal with a dragon!
Mergon is offline   #1 Reply With Quote