Well, it's in large part macros. Macros with liquids plugin to make the 2x2 areas, macros to place dwarves, macro to count the alive dwarves of a given side (that is, single down-arrow and find how many down-arrows you need)
For code, few lines changed in
-- Make a skill or skills of a unit Legendary +5
-- by vjek
local help = [====[
make-legendary-all-units
========================
Makes all units legendary in one skill, a group of skills, or all
skills. View groups with ``make-legendary classes``, or all skills with
``make-legendary list``. Use ``make-legendary MINING`` when you need something
dug up, or ``make-legendary all`` when only perfection will do.
]====]
-- this function will return the number of elements, starting at zero.
-- useful for counting things where #foo doesn't work
function count_this(to_be_counted)
local count = -1
local var1 = ""
while var1 ~= nil do
count = count + 1
var1 = (to_be_counted[count])
end
count=count-1
return count
end
function getName(unit)
return dfhack.df2console(dfhack.TranslateName(dfhack.units.getVisibleName(unit)))
end
function make_legendary(skillname)
local units = df.global.world.units.active
for index, unit in pairs(units) do
local skillnamenoun,skillnum
--unit=dfhack.gui.getSelectedUnit()
if unit==nil then
print ("No unit under cursor! Aborting with extreme prejudice.")
return
end
if (df.job_skill[skillname]) then
skillnamenoun = df.job_skill.attrs[df.job_skill[skillname]].caption_noun
else
print ("The skill name provided is not in the list.")
return
end
if skillnamenoun ~= nil then
utils = require 'utils'
skillnum = df.job_skill[skillname]
utils.insert_or_update(unit.status.current_soul.skills, { new = true, id = skillnum, rating = 20 }, 'id')
print (getName(unit) .. " is now a Legendary "..skillnamenoun)
else
print ("Empty skill name noun, bailing out!")
return
end
end
end
function PrintSkillList()
local count_max = count_this(df.job_skill)
local i
for i=0, count_max do
print("'"..df.job_skill.attrs[i].caption.."' "..df.job_skill[i].." Type: "..df.job_skill_class[df.job_skill.attrs[i].type])
end
print ("Provide the UPPER CASE argument, for example: PROCESSPLANTS rather than Threshing")
end
function BreathOfArmok()
local units = df.global.world.units.active
for index, unit in pairs(units) do
if unit==nil then
print ("No unit under cursor! Aborting with extreme prejudice.")
return
end
local i
local count_max = count_this(df.job_skill)
utils = require 'utils'
for i=0, count_max do
utils.insert_or_update(unit.status.current_soul.skills, { new = true, id = i, rating = 20 }, 'id')
end
print ("The breath of Armok has engulfed "..getName(unit))
end
end
function LegendaryByClass(skilltype)
local units = df.global.world.units.active
for index, unit in pairs(units) do
if unit==nil then
print ("No unit under cursor! Aborting with extreme prejudice.")
return
end
utils = require 'utils'
local i
local skillclass
local count_max = count_this(df.job_skill)
for i=0, count_max do
skillclass = df.job_skill_class[df.job_skill.attrs[i].type]
if skilltype == skillclass then
print ("Skill "..df.job_skill.attrs[i].caption.." is type: "..skillclass.." and is now Legendary for "..getName(unit))
utils.insert_or_update(unit.status.current_soul.skills, { new = true, id = i, rating = 20 }, 'id')
end
end
end
end
function PrintSkillClassList()
local i
local count_max = count_this(df.job_skill_class)
for i=0, count_max do
print(df.job_skill_class[i])
end
print ("Provide one of these arguments, and all skills of that type will be made Legendary")
print ("For example: Medical will make all medical skills legendary")
end
--main script operation starts here
----
local opt = ...
local skillname
if opt then
if opt=="list" then
PrintSkillList()
return
end
if opt=="classes" then
PrintSkillClassList()
return
end
if opt=="all" then
BreathOfArmok()
return
end
if opt=="Normal" or opt=="Medical" or opt=="Personal" or opt=="Social" or opt=="Cultural" or opt=="MilitaryWeapon" or opt=="MilitaryAttack" or opt=="MilitaryDefense" or opt=="MilitaryMisc" then
LegendaryByClass(opt)
return
end
skillname = opt
else
print(help)
return
end
make_legendary(skillname)
If you don't want Legendary +5, just edit the 20 for skill level in code to something lower. More realistic to set different skill levels, tbh, legendary armour user being far rarer than legendary observer.
And custom script to change all weapons in game at once.
local weapons = df.global.world.items.other.WEAPON
local weaponraws = df.global.world.raws.itemdefs.weapons[1]
-- which weapon it is in the raws, currently battle axe. Starts with 0
for index, weapon in pairs (weapons) do
-- weapon.mat_index = 3 --copper, indexed like weapons
weapon.sharpness = 10000
weapon.quality = 5 --masterful
weapon.subtype.id = weaponraws.id
weapon.subtype.subtype = weaponraws.subtype
weapon.subtype.name = weaponraws.name
weapon.subtype.name_plural = weaponraws.name_plural
weapon.subtype.size = weaponraws.size
weapon.subtype.skill_melee = weaponraws.skill_melee
weapon.subtype.attacks = weaponraws.attacks
weapon.subtype.flags.HAS_EDGE_ATTACK = weaponraws.flags.HAS_EDGE_ATTACK
weapon.subtype.raw_strings = weaponraws.raw_strings
for index, value in pairs(weapon.subtype.base_flags) do
value = weaponraws.base_flags[index]
end
end
The difference between 7/3 and 5/5 is two coin flips, so I'd try to run those trials with more dwarves (am not fan of large daggers myself, though). Also, remember that you can save in arena and that dwarf trances change/lopside the course of battle in case of multiple vs multiple rather than 1 vs 1.
Finally, remember that you can save arena and then run it multiple times.
So... tests
LD50 testgroup
Dwarves are LVL 5 : Fighter Axeman Observer Discipline Dodger
Naked with Copper Axe
Goblins are LVL 3 : Fighter Axeman Observer Discipline Dodger
Naked with Copper Axe
Test 1 : Versus 6 goblins
Results : Inconclusive, the dwarfs win without casualties
Test 2 : Versus 12 goblins
Results : Goblins win with 8 casualties
Test 3 : Versus 9 goblins
Results : 3 dwarf died. Survivors show minor wounds.
Test 3-a : Versus 9 goblins
Results : Similar, 3 dwarfs died. Minor wounds on two survivors, the third is unscaved.
Test 3-b : Versus 9 goblins
Results : One single dwarf died, another two has major wounds. Minor wounds on two other, last is unscaved
Test 3-c : Versus 9 goblins
Results : Three dead dwarves. Other three are unscaved.
Test 3-d : Versus 9 goblins
Results : Three dead dwarves, two lightly wounded, one unscaved
Conclusion : For our testgroup, the LD50 appears to be set at 9 goblins. The abnormal 3-b result appears to be
the consequence of spawning goblin in two lines instead of one. More tests are probably needed, but for now,
I believe we can set the LD50 to 9 versus level 3 goblins armed with axes.
LD50 dual axes
Dwarves are LVL 5 : Fighter Axeman Observer Discipline Dodger
Naked with 2 Copper Axes
Goblins are LVL 3 : Fighter Axeman Observer Discipline Dodger
Naked with Copper Axe
Test 1 : Versus 9 goblins
Results : Two dwarves dead, one lightly injured.
Test 2 : Versus 11 goblins
Results : Two dead dwarves, one minor wound, one major wound, two unscaved
Test 3 : Versus 13 goblins
Results : Goblins win with 9 casualties.
Test 4 : Versus 12 goblins
Results : Goblins win with 11 casualties
Note : At this point I'm tempted to put the LD50 of the dual axers to some 11.5.
11 is slightly not enough, 12 is a bit too much. More tests are needed.
Test 5 : Versus 11 goblins
Results : Dwarves win with a single casualty and a major wound.
Test 6 : Versus 12 goblins
Results : Dwarves win with two casualties and one major wound.
Test 6b : Versus 12 goblins
Results : Dwarves win with one casualty and two major wounds.
Note : We may have underestimated the power of a second axe. Increasing LD
Test 7 : Versus 13 goblins
Results : Goblins win with two casualties.
Conclusion : While the results are less consistant than our testgroup, the LD50 clearly has improved over it.
At this level we estimate that adding a second axe increases the LD50 from 9 to around 12 versus weak,
unarmored melee enemies.
However we predict that even against this kind of enemies, which are the best case scenario for dual wielders,
shields and axe should improve the LD even further.
LD50 Shield user
Dwarves are LVL 5 : Fighter Axeman Observer Discipline Dodger
are LVL 1 : Shield user
Naked with Copper Axes and Wooden Shield
Goblins are LVL 3 : Fighter Axeman Observer Discipline Dodger
Naked with Copper Axe
Test 1 : Versus 11 goblins
Results : Dwarves win with one casualty and two major wounds.
Test 2 : Versus 13 goblins
Results : Goblins win with 5 casualties
Test 3 : Versus 12 goblins
Results : Dwarves win with 4 casualties, one major and one minor wound.
Temporary conclusion because I'm really tired it's 2 am ugh :
We can confirm that versus melee enemies, dual wielders and axe and shields perform roughly similarly, with a Lvl3 Goblin LD50 between 11 and 12 per 6 dwarves.
Both represent a substential improvement to having nothing in the left hand, which set their Gob3 LD50 to exactly 9.
More tests are needed to confirm those results, obviously, before we try the tedious tasks of establishing the LD50 of those three groups versus a mix of melee and ranged goblins.
Im as surprized as you are, actually. I was expecting shield users to vastly outperform dual wielders. But versus melee enemies, they perform similarly.