Senior Member
Volunteer Data File Contributor
Join Date: Mar 2007
Posts: 1,245
|
At 4th level, the Knight gets an ability called Armor mastery, which lets him move at normal speed in medium and eventually heavy armors. This is what I have got so far, culled from the Mithril scripts and modified a bit.
Phase: First Priority: 11000 ~ If we're medium armor, remove the speed penalty var result as number if (hero.tagis[mClass.Medium] <> 0) then result = delete[mCategory.Slows] endif However, it is not functioning when I equip medium armor, obviously, so how do I fix it? Thanks for your help, as always. |
#1 |
Senior Member
Join Date: Jul 2007
Location: Syracuse, NY (USA)
Posts: 213
|
Are you trying this on a class special? That may explain why it's not working. I think you need to delete the tag mCategory.Slows from the armor itself.
|
#2 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
mCategory.Slows is on the armor. You're looking for the tag on the hero.
(note that for mithral armor, the material is added as a child of the armor, which is how its script can go directly to the parent item.) Use a foreach loop to check every piece of armor. It's not been mentioned in the documentation yet, but note the more efficient assign/delete statement they added an update or two ago. Code:
foreach pick in hero where "EquipType.Armor & mClass.Medium & mCategory.Slows" perform each.delete[mCategory.Slows] nexteach |
#3 |
Senior Member
Lone Wolf Staff
Join Date: Dec 2008
Posts: 4,690
|
Lawful_g wrote:
> > > At 4th level, the Knight gets an ability called Armor mastery, which > lets him move at normal speed in medium and eventually heavy armors. > This is what I have got so far, culled from the Mithril scripts and > modified a bit. > > Phase: First Priority: 11000 > ~ If we're medium armor, remove the speed penalty > var result as number > if (hero.tagis[mClass.Medium] <> 0) then > result = delete[mCategory.Slows] > endif > > However, it is not functioning when I equip medium armor, obviously, so > how do I fix it? Thanks for your help, as always. This script should do the trick: ~ Medium armor doesn't Slow any more foreach pick in hero where "mClass.Medium" perform each.delete[mCategory.Slows] nexteach It goes through each piece of medium armor, and deletes the "slows" tag from it. Hope this helps, -- Colen McAlister, colen@wolflair.com |
#4 |
Senior Member
Volunteer Data File Contributor
Join Date: Mar 2007
Posts: 1,245
|
Thanks for your help, both of you. I've got it working now.
|
#5 |
|
|