• 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

Scripting Help: Multiple Options

Sorry, I have no idea how to word this. I need to write a script for a class I'm building, and I'm frankly rather lost. What I'm doing is a modification of the Disruptive Strike/Improved Disruptive Strike from the Hunter class. Improved Disruptive Strike gives the user an additional use of Disruptive Strike as an encounter power per encounter.

The script for Improved Disruptive Strike is as follows:

doneif (activated = 0)
hero.childfound[pRgrDisSho].field[spcMax].value += 1

What I want to do instead is rather than just having the one power, I want the user to be able to select from three different powers. I can use the script to add them all at once, but I don't know how to make it so that the user's selection determines which part of the script is active.
 
Last edited:
I expect it would go something like this, with the parts I don't know how to write out marked by **

if (**the user selects Trick Shot**) then
hero.childfound[pwGSDisSht].field[spcMax].value += 1

elseif (**the user selects Violent Shot**) then
hero.childfound[pwGSViolSh].field[spcMax].value += 1

else (**the user selects Fan the Hammer**) then
hero.childfound[pwGSFtHam].field[spcMax].value +=1
endif
endif
 
I had my lovely and patient coding expert take a look at this, and she said:
Either add the following 3 lines of XML code or, in the editor click the Edit button for “List of Text Items” and enter Trick Shot, Violent Shot & Fan the Hammer in the boxes for rows 0, 1 & 2.
Code:
      <arrayval field="usrArray" index="0" value="Trick Shot"/>
      <arrayval field="usrArray" index="1" value="Violent Shot"/>
      <arrayval field="usrArray" index="2" value="Fan the Hammer"/>
Set your eval script to run at or around Setup 1000, and use the following code:
Code:
  doneif (activated = 0)
  if (compare(field[usrSelect].text, "Trick Shot") = 0) then
    hero.childfound[pwGSDisSht].field[spcMax].value += 1
  elseif (compare(field[usrSelect].text, "Violent Shot") = 0) then
    hero.childfound[pwGSViolSh].field[spcMax].value += 1
  elseif (compare(field[usrSelect].text, "Tan the Hammer") = 0) then
    hero.childfound[pwGSFtHam].field[spcMax].value += 1
  endif
Let me know if this works for you or if you have any problems.
 
Back
Top