Set Equip Bonuses
These scripts are an updated version of the open-source partial equip
bonus scripts I released in 2003 (prior to the release of the Legends
of Aranna expansion). They allow you to specify a list of enchantments
that will be applied to the wearer when a given number of items from
the set are equipped, and removed when the items are unequipped. It
can optionally message each equipped set piece so that skrits attached
to these set pieces can react according to the current set equip count,
for customized set behavior (e.g. run speed bonus, buff spell effect).
Essentially, this allows you to create item sets with partial and full
set bonuses for use in both the original Dungeon Siege and Legends of
Aranna. The update is actually a complete rewrite, optimizing some
code, improving the equip change buffering, and makes it easier to
template set managers.
[IMAGE]
Files
- CORE\world\contentdb\components\sets\set_manager.skrit
- CORE\world\contentdb\components\sets\set_piece.skrit
How To Use It
For each item in the set, add the following block to its template,
where my_set_manager is the desired name for your set
manager template:
[set_piece]
{
set_manager = "my_set_manager";
}
Then create the set manager template, specifying all the enchantments
and including a set_manager block, in which you will indicate which
enchantments are to be applied when a given number of set pieces are
equipped. Take the following example template:
[t:template,n:my_set_manager]
{
doc = "My Set Manager";
[magic]
{
state_name = "bonus"; //prefix for all the enchantment names
[enchantments]
{
[bonus_1]
{
alteration = alter_strength;
value = 1;
description = "Adds 1 to Strength";
duration = #infinite;
is_permanent = false;
is_single_instance = false;
}
[bonus_2]
{
alteration = alter_dexterity;
value = 2;
description = "Adds 2 to Dexterity";
duration = #infinite;
is_permanent = false;
is_single_instance = false;
}
[bonus_3]
{
alteration = alter_dexterity;
value = 3;
description = "Adds 3 to Dexterity";
duration = #infinite;
is_permanent = false;
is_single_instance = false;
}
[bonus_4]
{
alteration = alter_dexterity;
value = 6;
description = "Adds 6 to Dexterity";
duration = #infinite;
is_permanent = false;
is_single_instance = false;
}
[bonus_5]
{
alteration = alter_ranged_damage_min;
value = 5;
description = "Adds 5 to Minimum Ranged Damage";
duration = #infinite;
is_permanent = false;
is_single_instance = false;
}
[bonus_6]
{
alteration = alter_ranged_damage_max;
value = 8;
description = "Adds 8 to Maximum Ranged Damage";
duration = #infinite;
is_permanent = false;
is_single_instance = false;
}
[bonus_7]
{
alteration = alter_ranged_damage_min;
value = 10;
description = "Adds 10 to Minimum Ranged Damage";
duration = #infinite;
is_permanent = false;
is_single_instance = false;
}
[bonus_8]
{
alteration = alter_ranged_damage_max;
value = 15;
description = "Adds 15 to Maximum Ranged Damage";
duration = #infinite;
is_permanent = false;
is_single_instance = false;
}
[bonus_9]
{
alteration = alter_nature_magic;
value = 1;
description = "Adds 1 to Nature Magic";
duration = #infinite;
is_permanent = false;
is_single_instance = false;
}
[bonus_10]
{
alteration = alter_nature_magic;
value = 2;
description = "Adds 2 to Nature Magic";
duration = #infinite;
is_permanent = false;
is_single_instance = false;
}
[bonus_11]
{
alteration = alter_max_life;
value = 25;
description = "Adds 25 to Maximum Health";
duration = #infinite;
is_permanent = false;
is_single_instance = false;
}
}
}
[set_manager]
{
//separate each partial equip bonus definition by ';'
//it doesn't matter whether or not the last line has a ';' after it,
//but it is still a string, so you should place quotes around the
//entire set of equip bonus definition lists
equip_bonuses = "1:-1;
2:2,5,6;
3:5,6,1,3,9;
5:7,8,4,1,10,11";
//whenever the set equip count changes, send the following eWorldEvent
//message to each equipped set item (optional)
msg_update = WE_PLAYER_DATA_CHANGED;
}
}
This set manager's equip bonuses string indicates that:
- 1 item equipped will result in the character having no enchantments from this set
- 2 items equipped will result in the character having enchantments 2,5,6 (+2 dex, +5-8 max ranged damage)
- 3 items equipped will result in the character having enchantments 5,6,1,3,9 (+5-8 max ranged damage, +1 str, +3 dex, +1 nature magic)
- 4 items equipped will result in the character having the same enchantments as when there were 3 items equipped
- 5 items equipped will result in the character having enchantments 7,8,4,1,10,11 (+10-15 ranged damage, +6 dex, +1 str, +2 nature magic, +25 max hp)
NOTE: Each equip count bonuses definition is separate from the next. For example,
if I had not specifically stated that 3 equipped items confer +5-8 ranged damage
(which was a bonus also given for 2 equipped items), the wearer would not get
their 2-equipped-items bonuses in addition to their 3-equipped-items bonuses. This
is a actually a feature, because the game doesn't like it if you apply multiple bonuses
of the same alteration type from the same item at the same time. In the aforementioned
example set manager, the ranged damage bonus increases to 10-15 with 5 equipped items,
but you have to specify it independently of the +5-8 you can get from the 3 item bonus.
(i.e., the game will mess up if you try to apply +5-8 and +5-7 to get a total of +10-15)
If you specified a value for msg_update, the set manager will notify all the equipped set
items with the new set equip count whenever the set equip count changes.
Origin Ramblings
In essence, I wanted it to work like Diablo II set items. Below is an excerpt
from
The
Arreat Summit describing how Diablo II set items behave:
Set Items
Rumors persist of unique, distinguished item sets that once belonged
to great champions and heroes from the past. These sets are said to bestow
additional
magic abilities once all its pieces have been found and equipped. Set
items are recognizable by their green names. Once identified, each set
item names
the other pieces required to complete the set. Set Items are uniquely
named and have several magic attributes. When a character is equipped with
all
the items of a Set, additional bonus magic attributes are added as well.
Some Set Items will receive Magic Bonuses for each additional item of
the same Set you equip.
Example:
+150 Defense (2 Set Items)
+50% Fire Resist (3 Set Items)
This indicates that you will receive +150 Defense if you have 2 or more
items of the Set [equipped]. To gain the bonus of +50% Fire Resist you will
need 3 or more items of that Set [equipped].