Creating Item Set‐activated Buffs - dredmor-com/dungeons-of-dredmor GitHub Wiki
This page will teach you how to create items that activate a set buff or effect. This is deceptively tedious and difficult the more of them you make, though.
You begin with creating items. Every one of these will have the same kind of trigger - either one that works when you hit something (targetHitEffectBuff), or when you are hit (playerHitEffectBuff). This looks like:
<itemDB>
<item name="Rough Bronze Aspis" iconFile="items/shield_aspis0.png" craftoutput="1">
(...)
<targetHitEffectBuff percentage="100" name="Rough Bronze Aspis On"/>
<!-- This buff only works upon hitting someone. You could also use playerHitEffectBuff, thrownBuff and crossbowShotBuff. -->
</item>
<item name="Bronze Dagger" iconFile="items/dagger_bronze_dagger.png" level="4" type="7">
(...)
<targetHitEffectBuff percentage="100" name="Bronze Dagger On"/>
</item>
</itemDB>
Then, make every item trigger its own dummy buff. This buff will then check for the other buff, and if the buff is there, it puts another buff on you, one that actually makes something.
<spellDB>
<spell name="Rough Bronze Aspis On" type="self">
<!-- Every spell's type must be "self" -->
<buff useTimer="1" time="1" self="1" allowstacking="0" bad="0" icon="skills/placeholder64.png" smallicon="skills/placeholder32.png">
<!-- It's gotta fade away in 1 turn, and it shouldn't stack, and isn't bad. -->
</buff>
<effect type="trigger" amount="1" affectsCorpses="0" requirebuffontrigger="1" requirebuffontriggername="Bronze Dagger On" spell="Bronze Awesomeness"/>
<!-- Check if the other buff (Bronze Dagger On) is there. If there is, cast the set bonus. -->
</spell>
<spell name="Bronze Dagger On" type="self">
<buff useTimer="1" time="1" self="1" allowstacking="0" bad="0" icon="skills/placeholder64_1.png" smallicon="skills/placeholder32_1.png">
<!-- Remember to give every buff its own icon! Buffs are recognized by their icons, not by their name. -->
</buff>
<effect type="trigger" amount="1" affectsCorpses="0" requirebuffontrigger="1" requirebuffontriggername="Rough Bronze Aspis On" spell="Bronze Awesomeness"/>
</spell>
<spell name="Bronze Awesomeness" type="self">
<buff useTimer="0" self="1" allowstacking="0" brittle="5" removable="1" bad="0" icon="skills/placeholder64_2.png" smallicon="skills/placeholder32_2.png">
<!-- The buff is brittle and removable, so it's a defensive buff more or less. -->
<!-- And here are the bonuses that the set is supposed to give you... -->
</buff>
</spell>
</spellDB>
You've already added playerHitBuffs and whatnot to the items. It's not much different in this example. You gotta add another buff, this time for "Bronze Cuirass On". It looks the same as the others, pretty much, and triggers a different buff. The dagger now triggers 2 buffs, the previous one and the one for wearing both the Cuirass and the Dagger.
<spellDB>
<spell name="Rough Bronze Aspis On" type="self">
<buff useTimer="1" time="1" self="1" allowstacking="0" bad="0" icon="skills/placeholder64.png" smallicon="skills/placeholder32.png">
</buff>
<effect type="trigger" amount="1" affectsCorpses="0" requirebuffontrigger="1" requirebuffontriggername="Bronze Dagger On" spell="Bronze Awesomeness"/>
<!-- Requires Bronze Dagger On, this is miniset 1: Dagger and Shield. -->
</spell>
<spell name="Bronze Dagger On" type="self">
<buff useTimer="1" time="1" self="1" allowstacking="0" bad="0" icon="skills/placeholder64_1.png" smallicon="skills/placeholder32_1.png">
<!-- Please note you MUST use different icons for every buff. -->
</buff>
<effect type="trigger" amount="1" affectsCorpses="0" requirebuffontrigger="1" requirebuffontriggername="Rough Bronze Aspis On" spell="Bronze Awesomeness"/>
<effect type="trigger" amount="1" affectsCorpses="0" requirebuffontrigger="1" requirebuffontriggername="Bronze Cuirass On" spell="Bronze Epicness"/>
<!-- Requires Shield to trigger miniset 1: Dagger and Shield, and requires the Armour to trigger miniset 2: Dagger and Armour. -->
</spell>
<spell name="Bronze Cuirass On" type="self">
<buff useTimer="1" time="1" self="1" allowstacking="0" bad="0" icon="skills/placeholder64_2.png" smallicon="skills/placeholder32_2.png">
</buff>
<effect type="trigger" amount="1" affectsCorpses="0" requirebuffontrigger="1" requirebuffontriggername="Bronze Dagger On" spell="Bronze Epicness"/>
<!-- Requires Armour for miniset 2. -->
</spell>
<spell name="Bronze Awesomeness" type="self">
<!-- Miniset 1, Dagger and Shield, just like in the previous example. -->
<buff useTimer="0" self="1" allowstacking="0" brittle="5" removable="1" bad="0" icon="skills/placeholder64_3.png" smallicon="skills/placeholder32_3.png">
<!-- And here are the bonuses that the first two items of the set are supposed to give you... -->
</buff>
</spell>
<spell name="Bronze Epicness" type="self">
<!-- Miniset 2, Dagger and Armour. This one should probably buff you differently. -->
<buff useTimer="0" self="1" allowstacking="0" brittle="5" removable="1" bad="0" icon="skills/placeholder64_4.png" smallicon="skills/placeholder32_4.png">
<!-- And here are the bonuses that the latter two items of the set are supposed to give you... -->
</buff>
</spell>
</spellDB>
Please note that this item set does NOT work if you have the Armour and Shield equipped. It only works in 2 out of 3 ways, because it can only give 2 set bonuses.
This method is pretty much the same as making 3 mini sets, but this time the mini sets do nothing. The big buff only works when you have all 3 pieces. You could use this method with like 6 items, and only apply buffs if the player has 4, 5 or all items. This is the way to make bigger item sets.
Note that it works in some sort of "tiers". The first tier is checking if other first tiers exist, and if they do, they both make up a second tier. In the second tier, they check if the missing first tier exists, and if it does, they make up the final tier, the set bonus.
<spellDB>
<!-- First tier -->
<spell name="Rough Bronze Aspis On" type="self">
<buff useTimer="1" time="1" self="1" allowstacking="0" bad="0" icon="skills/placeholder64.png" smallicon="skills/placeholder32.png"/>
<effect type="trigger" amount="1" affectsCorpses="0" requirebuffontrigger="1" requirebuffontriggername="Bronze Dagger On" spell="Dagger and Shield"/>
<effect type="trigger" amount="1" affectsCorpses="0" requirebuffontrigger="1" requirebuffontriggername="Bronze Cuirass On" spell="Shield and Cuirass"/>
<effect type="trigger" amount="1" affectsCorpses="0" requirebuffontrigger="1" requirebuffontriggername="Cuirass and Dagger" spell="Bronze Set"/>
</spell>
<spell name="Bronze Dagger On" type="self">
<buff useTimer="1" time="1" self="1" allowstacking="0" bad="0" icon="skills/placeholder64_1.png" smallicon="skills/placeholder32_1.png"/>
<effect type="trigger" amount="1" affectsCorpses="0" requirebuffontrigger="1" requirebuffontriggername="Rough Bronze Aspis On" spell="Dagger and Shield"/>
<effect type="trigger" amount="1" affectsCorpses="0" requirebuffontrigger="1" requirebuffontriggername="Bronze Cuirass On" spell="Cuirass and Dagger"/>
<effect type="trigger" amount="1" affectsCorpses="0" requirebuffontrigger="1" requirebuffontriggername="Shield and Cuirass" spell="Bronze Set"/>
</spell>
<spell name="Bronze Cuirass On" type="self">
<buff useTimer="1" time="1" self="1" allowstacking="0" bad="0" icon="skills/placeholder64_2.png" smallicon="skills/placeholder32_2.png"/>
<effect type="trigger" amount="1" affectsCorpses="0" requirebuffontrigger="1" requirebuffontriggername="Rough Bronze Aspis On" spell="Shield and Cuirass"/>
<effect type="trigger" amount="1" affectsCorpses="0" requirebuffontrigger="1" requirebuffontriggername="Bronze Dagger On" spell="Cuirass and Dagger"/>
<effect type="trigger" amount="1" affectsCorpses="0" requirebuffontrigger="1" requirebuffontriggername="Dagger and Shield" spell="Bronze Set"/>
</spell>
<!-- Second tier -->
<spell name="Shield and Cuirass">
<buff useTimer="1" time="1" self="1" allowstacking="0" bad="0" icon="skills/placeholder64_3.png" smallicon="skills/placeholder32_3.png"/>
<effect type="trigger" amount="1" affectsCorpses="0" requirebuffontrigger="1" requirebuffontriggername="Bronze Dagger On" spell="Bronze Set"/>
</spell>
<spell name="Cuirass and Dagger">
<buff useTimer="1" time="1" self="1" allowstacking="0" bad="0" icon="skills/placeholder64_4.png" smallicon="skills/placeholder32_4.png"/>
<effect type="trigger" amount="1" affectsCorpses="0" requirebuffontrigger="1" requirebuffontriggername="Rough Bronze Aspis On" spell="Bronze Set"/>
</spell>
<spell name="Dagger and Shield">
<buff useTimer="1" time="1" self="1" allowstacking="0" bad="0" icon="skills/placeholder64_5.png" smallicon="skills/placeholder32_5.png"/>
<effect type="trigger" amount="1" affectsCorpses="0" requirebuffontrigger="1" requirebuffontriggername="Bronze Cuirass On" spell="Bronze Set"/>
</spell>
<!-- Third tier -->
<spell name="Bronze Set" type="self">
<buff useTimer="0" self="1" allowstacking="0" brittle="5" removable="1" bad="0" icon="skills/placeholder64_6.png" smallicon="skills/placeholder32_6.png">
<!-- BONUSES! -->
</buff>
</spell>
</spellDB>
It's not recommended to make buttloads of item sets, since this could slowly eat your sanity, and you could turn in some form of Kazeto.
Do not EVER think it's easy to make an 8-item set bonus, this is the table for buffs needed to accomplish the amount of items in a set:
Items in Set | Buffs Needed |
---|---|
1 | 1 |
2 | 4 |
3 | 11 |
4 | 26 |
5 | 57 |
6 | 120 |
7 | 247 |
8 | 502 |
9 | 1013 |
10 | 2036 |
(formula for this table is -2 + 2(1 - n) - n)