View druidism.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Enables nature merit system and reactions that utilize nature merit. | |
--[[ | |
--New system: | |
effectiveskill(for taming) = skill | |
respectvalue = ((skill*5)^2) | |
interestvalue = merit/10 | |
floor((1-((petvalue/2)/respectvalue))*100) = prob of success in a respect conflict | |
same thing with interestvalue to determine likelihood of taming |
View creature_sscc_examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
creature_sscc_examples | |
[OBJECT:CREATURE] | |
Special classes for use with the SoulShuffle and ConstructCreature scripts: | |
DFHACK_CONSTRUCTCREATURE_CASTECOLORS - Uses the caste color system to make creatures show up with the color of their construction material. See below. | |
DFHACK_CONSTRUCTCREATURE_ITEMCORPSE - Causes the creature's itemcorpse to take on the same material as its first defined material. | |
DFHACK_SOULSHUFFLE_SCUTTLE_ON_REMOVAL - The creature will die when its soul is removed. | |
DFHACK_SOULSHUFFLE_VANISH_ON_REMOVAL - The creature will vanish into smoke when its soul is removed. |
View ghostly.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Turn ghost on or off | |
local unit=dfhack.gui.getSelectedUnit() | |
if unit == nil then | |
unit = df.unit.find(df.global.ui_advmode.player_id) | |
end | |
if unit then | |
if unit.flags1.dead then |
View timestream.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Multiplies the speed of calendar time by the specified value. The parameter can be any positive number, though going over 10 is likely to cause bugs. 1 is normal speed. | |
args={...} | |
local rate=tonumber(args[1]) | |
local prev_tick = 0 | |
if rate == nil then | |
rate = 1 | |
elseif rate < 0 then | |
rate = 0 | |
end |
View add-exp.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Gives a unit a certain amount of experience in a certain skill, leveling them up as appropriate. Intended for autosyndrome. Params: Unit id, skill name, exp. amount, max level (20 by default). | |
local args = {...} | |
local ok = true | |
--local unit=dfhack.gui.getSelectedUnit() | |
local unit = df.unit.find(tonumber(args[1])) | |
local skillname = args[2] | |
local amount = args[3] | |
local maxlevel = args[4] | |
if maxlevel == nil then maxlevel = 20 end |
View hfspit.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---Creates a pit under the target leading straight to the Underworld. Type '?' for help. | |
args={...} | |
if args[1] == '?' then | |
print("First parameter is target unit id, or 0 to select a location with the cursor.\n Second parameter is size of the pit in all directions.\n Third parameter is 1 to wall off the sides of the pit on all layers except the underworld, or anything else to leave them open. (Leaving them open may allow flying cave-dwellers to path to your fortress if you have normal access to the caverns)\n Fourth parameter is 1 to add stairs. Note that stairs are a bit buggy, as they will not reveal the bottom until you dig somewhere, but will still allow underworld creatures to path to your fortress.") | |
return | |
end | |
if args[1] ~= nil then |
View construct-creature.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Uses a reaction to spawn a living creature that uses the materials of the reagents as body components. Reactions must begin with LUA_HOOK_CONSTRUCTCREATURE | |
--[[ | |
You can have as many reagents as you like. | |
Reagents starting with USE will replace materials used in the creature, in the order that they are defined. | |
Make sure that each USE reagent consists of one item only. Otherwise, the second item taken will be counted as the second material. | |
Using tools as intermediary reagents is probably your best option for expensive creatures. | |
The product field determines the creature produced, where the material is CREATURE_MAT:(your creature):NONE. The probability should be set at 0 to avoid actually creating a boulder. | |
If you want to select a specific caste, the product field should have a PRODUCT_DIMENSION for the caste. | |
However, to make the creature's color show up based on its material, the creature must have 16 castes, one for each color. |
View exile.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Sends units away into the wild | |
args={...} | |
local targetUnit=dfhack.gui.getSelectedUnit() | |
if targetUnit == nil and args[2] ~= 'all' then | |
local targetUnit = df.unit.find(tonumber(args[2])) | |
end | |
group = args[1] |
View slam.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Slam a unit into the ground | |
args={...} | |
local unit=dfhack.gui.getSelectedUnit() | |
if unit == nil then | |
local unit = df.unit.find(tonumber(args[2])) | |
end | |
local strength=args[1] | |
if unit == nil then |