Code: Select all
<b>Convert Spell slots into Sorcery Points:</b>
<br>
[h:slot = input("slot|1,2,3,4,5|Convert Spell slot level|LIST|VALUE=STRING SELECT=0")]
[h: abort(slot)]
[r, if(slot == 1), CODE: {
[r, if(First > 0 ), CODE: {[h:First=(First-1)][h:SorceryPoints=(SorceryPoints+1)]Converted Level 1 spell slot into 1 Sorcery Point};{No available Spell slots}]};{}]
[r, if(slot == 2), CODE: {
[r, if(Second > 0 ), CODE: {[h:Second=(Second-1)][h:SorceryPoints=(SorceryPoints+2)]Converted Level 2 spell slot into 2 Sorcery Point};{No available Spell slots}]};{}]
[r, if(slot == 3), CODE: {
[r, if(Third > 0 ), CODE: {[h:Third=(Third-1)][h:SorceryPoints=(SorceryPoints+2)]Converted Level 3 spell slot into 3 Sorcery Point};{No available Spell slots}]};{}]
[r, if(slot == 4), CODE: {
[r, if(Fourth > 0 ), CODE: {[h:Fourth=(Fourth-1)][h:SorceryPoints=(SorceryPoints+2)]Converted Level 4 spell slot into 4 Sorcery Point};{No available Spell slots}]};{}]
[r, if(slot == 5), CODE: {
[r, if(Fifth > 0 ), CODE: {[h:Fifth=(Fifth-1)][h:SorceryPoints=(SorceryPoints+2)]Converted Level 5 spell slot into 5 Sorcery Point};{No available Spell slots}]};{}]
<br>
Sorcery Points remaining: [r:SorceryPoints]
Convert Spell slots into Sorcery Points:
Converted Level 1 spell slot into 1 Sorcery Point
Sorcery Points remaining: 5
The issue I'm having is that it will only give the first result in the list no matter which value I choose. Is there something I'm missing or is it just not possible with this code? I don't think I will be able to figure out turning SP into slots if I can't figure this out.