• 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

Shadow Assassin

Manalishi66

Well-known member
Trying to add the Shadow Assassins "Daggermaster" ability but ran into a problem. The ability grants a +1 bonus (attack and damage) when using any light weapon, the bolas and shuriken at 5th. Then +2 at 9th, +3 at 13th and finally +4 at 17th. My script so far is....

var bonus as number
bonus = field[xCount].value
bonus = round(bonus, 0,1)

field[listname].text = "Daggermaster +" & bonus
field[livename].text = "Daggermaster +" & bonus

~ Loop through all weapons of a specific fighter type
foreach pick in hero from BaseWep where "wClass.Light"
~ Set the bonus on each weapon found
eachpick.field[Bonus].value = bonus
nexteach

the problem is the bonus adds +4 at 5th instead of +1, +8 at 8th instead of +2, etc. How do I fix this and also how to I add the shuriken and bolas too?. Also daggermaster is bootstraped at the above mentioned levels. Please help me finish this.

Thanks!
Donald
 
You need a first copy stop in there, take a look at the Monk's Unarmed Strike special ability and see if you can see what it looks like.
 
Looked at monk and thought this could work, but I get "One or more "if" statements is missing the closing "endif" on line 31". Help!


if (field[xIndex].value <= 5) then
field[listname].text = "Daggermaster +1"
elseif (field[xIndex].value = 9) then
field[listname].text = "Daggermaster +2"
elseif (field[xIndex].value = 13) then
field[listname].text = "Daggermaster +3"
elseif (field[xIndex].value = 17) then
else
field[listname].text = "Daggermaster +4"
endif

~ only perform the rest on the first copy
doneif (tagis[Helper.FirstCopy] = 0)

~ Get our daggermaster damage

~ Loop through all weapons of a specific fighter type
foreach pick in hero from BaseWep where "wClass.Light"

if (field[xAllLev].value < 4) then
eachpick.field[Bonus].value = 1
elseif (field[xAllLev].value < 8) then
eachpick.field[Bonus].value = 2
elseif (field[xAllLev].value < 12) then
eachpick.field[Bonus].value = 3
elseif (field[xAllLev].value < 16) then
else
eachpick.field[Bonus].value = 4
endif
 
Mixing foreach and if...endif can confuse the error reporting. What appears to be missing is the nexteach line to close your foreach.

Also, are you sure you want field[Bonus].value = some value, and not += some value? Won't "equal to" overwrite any bonuses that are coming from other things?
 
Those are some complex scripts for something that is not that complex actually. Your first script was very close.

Here is the basic class special script I always start from:
Post-Levels/10000:
Code:
~Set the list name
field[listname].text = field[thingname].text & " " & signed(field[xIndex].value)

~ If we're not shown, just get out now
doneif (tagis[Helper.ShowSpec] <> 1)
~ if we've been disabled, get out now
doneif (tagis[Helper.SpcDisable] <> 0)

field[abValue].value += field[xCount].value
field[livename].text = field[thingname].text & " " & signed(field[abValue].value)
This script is made so that to increase the bonus you simply bootstrap the class special multiple times to the class. So in your case it would be 5th, 9th, 13th and 17th. So it is bootstrapped four times to the class.

Now then as you need to give the final "bonus" in field[abValue].value to all light weapons we add in the foreach loop from your first script. We also add in the Helper.FirstCopy logic so we only perform the foreach loop once.
Code:
~Set the list name
field[listname].text = field[thingname].text & " " & signed(field[xIndex].value)

~ If we're not shown, just get out now
doneif (tagis[Helper.ShowSpec] <> 1)
~ if we've been disabled, get out now
doneif (tagis[Helper.SpcDisable] <> 0)

field[abValue].value += field[xCount].value
field[livename].text = field[thingname].text & " " & signed(field[abValue].value)

~ only perform the rest on the first copy
doneif (tagis[Helper.FirstCopy] = 0)

~ Loop through all light weapons
foreach pick in hero from BaseWep where "wClass.Light"
   ~ give a bonus 
   eachpick.field[Bonus].value += field[abValue].value
nexteach
 
Back
Top