Senior Member
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265
|
Another Complete Warrior Feat.
Does anyone have any idea how to script the Improved Weapon Familiarity Feat to assign all Exotic weapons associated with the race of a character as Martial weapons instead, including any weapons that contain the name of the race too EG:- Elven Thinblade= Martial weapon for Elves. I've looked at the Exotic weapon proficiency feat for ideas, and the Dwarven Urgrosh weapon but I can only see the Easy if Race tick box to make the individual weapon one proficiency lower than needed. I found this code elsewhere on the forum but it refers to bootstrapping, at the moment i don't know how or what Bootstrapping is. Code:
if (hero.tagis[Hero.ProfMart] <> 0) then var result as number result = hero.assign[WepProf.wGythka] endif |
#1 |
Senior Member
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265
|
Found an old file with this Improved Weapon Familiarity script i'd entered a year and a half ago!
Code:
Eval Script Phase first Priority 1000 index 1 var result as number result = hero.assign[Hero.ProfMart] Code:
Pre Req Base attack +1 Required if (child[Attack].field[tAtkBase].value >= 1) then @valid = 1 endif Last edited by bodrin; March 1st, 2009 at 10:37 AM. |
#2 |
Senior Member
|
I'm not sure myself but need to work this one out as well. I do know how to check for race:
@valid=tagis[Race.Elf] This is from one of my weapon group feats: Axes (from the Unearthed Arcana): Code:
perform hero.assign[WepProf.wHandaxe] perform hero.assign[WepProf.wBattleaxe] perform hero.assign[WepProf.wGreataxe] perform hero.assign[WepProf.wWaraxeDw] var hasfeats as number hasfeats = hero.pickexists[fWGrpSpear] + hero.pickexists[fWGrpDbl] if (hasfeats = 2) then if (hero.pickexists[wUrgroshDw] = 0) then perform hero.assign[WepProf.wUrgroshDw] endif perform hero.assign[WepProf.wAxeOrcDbl] endif |
#3 |
Senior Member
|
So I would guess this would work for example:
Code:
var israce as number israce = tagis[Race.Elf] if (israce > 0 ) then perform hero.assign[WepProf.wThinBlade] endif |
#4 |
Senior Member
|
Also decided to check to make sure they have the martial weapon proficiency. So, code, final version for elf is:
Code:
~ If you're an elf you're proficient with Elven weapons. var israce as number var hasfeat as number israce = tagis[Race.Elf] hasfeat = #hasfeat[fWepMart] + #hasfeat[fMartial] if (israce > 0 ) then if (hasfeat > 0) then perform hero.assign[WepProf.wThinBlade] perform hero.assign[WepProf.wLightBld] perform hero.assign[WepProf.wDoubleBow] endif endif |
#5 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Note that you'll need hero.tagis[Race.Elf], rather than tagis[Race.Elf] - your proficiency isn't an elf.
and to simplify: if (hero.tagis[Race.Elf] <> 0 then will work just as well as declaring a variable, setting the variable, and then testing the variable. |
#6 |
Senior Member
|
Ah, good eye...corrected. Yeah, I just prefer to use the same method rather than a variable for one thing and a tag for another. To each his own.
|
#7 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
if (#hasfeat[fWepMart] + #hasfeat[fMartial] <> 0) then
works, too. |
#8 |
Senior Member
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265
|
Thank you for the help on this one.
Here's the full working script for my Elven Thinblade and Lightblade. I'll integrate the Gnome, Orc, Half Elf, Dwarf and other races later. Code:
~ If you're an elf you're proficient with Elven weapons. var hasfeat as number if (hero.tagis[Race.Elf] <> 0) then if (#hasfeat[fWepMart] + #hasfeat[fMartial] <> 0) then perform hero.assign[WepProf.wElvLigBla] perform hero.assign[WepProf.wElvThiBla] endif endif |
#9 |
Senior Member
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265
|
Hers a strange one guys!
The following code for the Improved Weapon Familiarity feat worked perfectly until I added the Half-Orc race. On a test character with all the Race weapons added the Axe, Orc Double isn't assigned to the Half-Orc as proficient, the other races, Elf, Half-Elf and so on do get assigned correctly. Changing the race in real time worked superbly until, as stated, the Half-Orc. Current Script! Code:
~ If you're an elf you're proficient with Elven weapons. var hasfeat as number if (hero.tagis[Race.Elf] <> 0) then if (#hasfeat[fWepMart] + #hasfeat[fMartial] <> 0) then perform hero.assign[WepProf.wElvLigBla] perform hero.assign[WepProf.wElvThiBla] endif endif ~ If you're an Dwarf you're proficient with Dwarven weapons. var hasfeat as number if (hero.tagis[Race.Dwarf] <> 0) then if (#hasfeat[fWepMart] + #hasfeat[fMartial] <> 0) then perform hero.assign[WepProf.wWaraxeDw] perform hero.assign[WepProf.wUrgroshDw] endif endif ~ If you're an Gnome you're proficient with Gnomish weapons. var hasfeat as number if (hero.tagis[Race.Gnome] <> 0) then if (#hasfeat[fWepMart] + #hasfeat[fMartial] <> 0) then perform hero.assign[WepProf.wHammerGnm] endif endif ~ If you're a Half-Orc you're proficient with Orcish weapons. var hasfeat as number if (hero.tagis[Race.HalfOrc] <> 0) then if (#hasfeat[fWepMart] + #hasfeat[fMartial] <> 0) then perform hero.assign[WepProf.wAxeOrcDbl] endif endif I assigned the Easy if race to the Elven thinblade and the lightblade but the Gnome hammer and the Dwarven weapons are classed as martial for the race anyway. It was only when the Orc Axe flagged as non proficient and I removed the Easy if race tick from the Thinblade and Lightblade that I realised this. Anymore Ideas? |
#10 |
|
|