Affixes and Effects – The Basics
An Effect is exactly what it sounds like. It makes something happen. These guys are responsible for flat damage (a la Magma Spear), stun effects, passive skill bonuses and many other actions that can occur in TL2. In fact, they regulate the majority of erm… effects… that can take place.
An Affix is packaging for Effects. Affixes allow multiple Effects to be applied together, scaled together (as with skill level) and more. Affixes allow you to set inclusion or exclusion lists so your effects don't apply to certain unittypes. Generally, it's good to always package your Effects into Affixes.
Important to understanding Affixes and Effects is to understand how to find all of the variables that affect them. Basically, you'll find them working in a hierarchy that goes like this:
Top Level (item, skill, unit, etc)>Affix>Effect>Variables(Graph/Stat)
You find affixes applied to units, items, weapons, skills. So let's go to Glaive Throw and find that skill's affix:
Glaive Throw actually has another Effect attached, too, but for now let's just work with the WANDERER_GLAIVE_THROW affix.
Next step is to find it in the Affix Editor. So go open that, tug on the Group dropdown bar and select SKILLS, and find yourself here:
You'll see an Effects list to the right. These are the bread and butter of what the Affix is doing. In the second field of the effects, you'll notice the column name is 'Effect' indicating what type of Effect it is… this is our next lead in figuring out what EXACTLY these affixes are doing. Percent Speed and Interrupt are very straightforward and the Add Stat seems to be vestigial (it does nothing), so let's look at Damage, since it's the most interesting Effect here.
Now, open the Effects Editor and find Damage.
Here it is:
Mostly, this just shows us how TL2 displays the Effect on an item or in a skill. What we're interested in is the Graphs section in the middle. For the Damage Effect, the associated graph is DAMAGE_MONSTER. Notice the graph is listed twice. That's because the graph is linked to both the MIN and the MAX values. Now, let's find DAMAGE_MONSTER in the Graph Editor.
And voila, we have all the associated files and values used for the WANDERER_GLAIVE_THROW affix's damage effect. Now, to understand how these all work, let's get deeper into Effects.
Let's go over the fields found in EFFECTS and then hit the quirks of the different categories of EFFECT.
It's good to type in a name for most effects. It is critical in certain cases. When you MUST enter a name is when you need to make an effect NOT STACK with other identical effects. Imagine playing a multiplayer match with two Embermages. Each takes the Elemental Boon spell. Each casts that spell and now they both have DOUBLE the bonuses from Elemental Boon (~70% bonus damage, ~75% damage reduction to all elemental effects). It gets out of hand really fast. Thankfully, in those effects, they have a name set, and also EXCLUSIVE is set to TRUE. They don't stack.
Also, if you wanted to make an archetypal 'effect' used widely in your mod, like Burning or Frozen in TL2, it would be good to give all intended effects the same name. Why? Because then you could implement counters to those effects by using the REMOVEEFFECT effect. REMOVEEFFECT works on all effects of the same EFFECTNAME. So, if all poison effects were called 'poison', you could use a skill to remove any poison effect on a character.
This sets the category of effect, e.g. damage, stun, etc.
Activation determines how and to whom the effect is applied. There are 3 main types, Dynamic, Passive and Transfer. Perhaps someone else can elaborate and clarify, but as I understand it, this is the difference:
-I don't know the difference between Passive and Dynamic effects. How they both seem to work to me is that they apply the effect to the target directly. So, if BlackMage casts Fireball on Fighter and Fireball applies a dynamic damage effect that deals 10 damage, Fighter suffers that 10 damage.
However, in Runic's vanilla TL2 files, Dynamic and Passive are used consistently in two different ways. Dynamic applies short-term effects (including short term buffs and debuffs). Passive is used for long-term bonuses and modifiers, especially passive skills. Passive effects almost always have a duration of ALWAYS.
-Now, Transfer works like this. Say BlackMage casts Firesword on Fighter, which applies a Transfer damage effect of 10 points of fire damage, Fighter will cause 10 points of fire damage to enemies he hits as long as the effect lasts.
These are the standard variables associated with most effects. If the two values are different, they will randomly pick a number within the range before being applied. If both are the same, the effect will only display one value on the tooltip of whatever it is associated with.
In the case of a Damage effect, this will be the MIN/MAX damage to be dealt. However, these values are modified by the associated graph and three other fields: USEOWNERLEVEL, STATNAME and STATPERCENT. Also, DURATION can affect damage as well. See the end of this section for the formulas that calculate the final value.
Sets the duration. Possibilities are 0, INSTANT, ALWAYS or any number of your choice. Note that ALWAYS just means until the Effect ends. This can occur because its associated affix or skill's duration ends or the effect is forcibly removed. For damage over time skills, the damage is PER second and not divided by the duration.
This value is important for Effects that pertain to skills with multiple levels. For example, the CAST SKILL effect will read this to determine which skill level to cast.
For the love of all that is sweet and creamy, don't ever use MAGIC as a DamageType. It's another speck of dust that wasn't picked up before the game was packaged. It is broken as it doesn't have any associated armor or damage reduction. It does not mean 'skill damage'. It is its own damage type like Fire or Ice.
That said, DamageType just sets what kind of damage is being affected by a Damage effect or passive boost (e.g. Percent Damage). This needs to be set for damagetype specific effects to work at all.
I don't entirely understand this field. I have not gotten it to do anything. Stat modifiers always seem to read from the caster.
Here you can hook a UnitTheme (fun particle effects like auras, burning, bleeding, etc) to the effect that will appear on the affected character for the duration of the effect. Note: Transfer effects will place the unit theme on the character that suffers the consequences of the effect, not the bearer of the effect. So in the example above, Fighter would NOT get the unit theme, the monster he bashes will.
This allows you to modify the final value of the effect by a stat which must be declared in the Stat Editor. The stat is read from the caster. For example, the Engineer's Coup de Grace skill uses 'Character Strength' here, which modifies the damage dealt by the Engineer's Strength stat. This value is a multiplier combined with MIN/MAX unless STATMODIFIERISBONUS is set to true. Then it's additive.
Sometimes, with skills, EFFECT LEVEL can be typed here to modify the effect's product by the AFFIXLEVEL set in a skill. The effect level can be found in the skill editor, usually under an event type of some sort and listed under the AFFIX itself.
If using a stat, this is another variable you can set to modify the final product. If STAMODIFIERISBONUS is false, this will be multiplied with everything else in the formula. If it's true, then only the value associated with STATNAME is multiplied by statpercent and then this value is added to the product. Stat percent is divided by 100 to get the actual % of the stat to use, E.G. a stat percent of 100 would be 100% of the stat, while 200% would use double the value of the stat.
An example of this would be an affix with “stat : effect level”. “stat percent 100”, “damage bonus 5-5” and an effect level of 2 . If stat modifier is bonus is set to false, then the game would read this as (damage bonus 5) * (Effect level 2) * (stat percent 100) / 100, or a damage bonus of 10.
If the stat modifier was set to bonus : true, then it would be (damage bonus 5) + [ (Effect level 2) * (stat percent 100) / 100 ], or a damage bonus of 7. With a stat percent of 200, the final damage bonus would be 9.
This is most useful for using one affix to generate multiple values for a skill with multiple levels, without needing to make an affix for each individual skill level. For example, if you wanted a skill that gives you a 5% damage bonus per level, you would create an affix that would have a damage bonus of 5 (min and max), set the STATNAME to EFFECT LEVEL, and STATPERCENT to 100, while setting STAT MODIFIER IS BONUS to false. Then create a skill in the skill editor with 15 (or however many levels you want) and assign each level to the affix, but set the effect level in the affix from 1-15.
So at level 5, the game would see an effect level of 5, multiply it by 5%, and give you a 25% damage bonus.
Setting STAT MODIFIER IS BONUS to true can be used when you want an affix to start off at a high value (e.g. a damage bonus of 10%) and then have it scale with a smaller value each level (E.G. 2% per level). In this case, you would set the starting damage bonus to 10, and set the STAT PERCENT to 100. Then in the skill editor, you could set the affix levels to multiples of 2. So at level 4, the affix would have an effect level of 2, and it would be 10% (base) + [ 8 (effect level) * 1 (stat percent) ] or 18%.
Note that for skills, you can typically set them to MASTERY GRAPH instead which will scale it automatically based on the min/max values entered, but there are some situations in which you cannot use graphs as they will not work properly (e.g. spells, which do not function like normal skills) and using STAT NAME and STAT PERCENT might be more helpful.
I'm not sure exactly what this does. It may play a particle effect upon activation of the skill, but UnitTheme does the same thing and allows for more control of a particle effect. So… if anyone else knows why we'd use this, I'm keen to know.
This sets what icon to use on the HUD while this effect is active on a character or monster. Particularly useful for things like bleeds or buffs.
If true, this effect will stay on the target permanently, lasting through exiting the game and coming back in. Particularly important for permanent modifiers that are applied directly to a unit file.
If set to TRUE, this effect will override any other effect with the same EFFECTNAME. They will not stack and only one will ever be active on a particular target. Set to FALSE if you'd like the effects to stack.
Type in a graph name here to replace the associated graph. This allows you to modify the product in a very flexible way. Graphs applied in this way will always be modified by the AFFIXLEVEL set at the skill level, allowing for excellent control of scaling. Unless of course, USEOWNERLEVEL is set to TRUE, then OWNERLEVEL overrides or at least makes EFFECTLEVEL silly.
An example is having a skill scale per level of the skill using the MASTERY GRAPH. A typical value is 50 for the min/max values, which would equate to 2% per level of the skill. Note that many effect use a graph by default even if it is not listed in the affix (e.g. the max hp effect). Even if you have no graph entered, using something like max hp and a value of 10 will cause the game to use 10% * the HP at your current level OR the item level (whichever is more applicable) which can be found in the player generic HP graph.
For example, a level 20 item with max hp 10 in the editor would calculate the max hp bonus as 10% * 1000 (assuming the value in the hp graph is 1000 at level 20), giving you a 100 hp bonus, regardless of what level you are. Unfortunately the editor does not tell you what graphs the game will use by default.
Look at the Engineer's forcefield affixes to understand this field better. Essentially, this links the duration of two effects so that if one ends, they both end. You can see how this would be important for Forcefield. There are two effects in that affix, one for the damage absorb and the other for the knockback resist. The EFFECTNAME of the damage absorb effect is typed into the LINKNAME of the knockback resist effect. When the damage absorb is depleted before its duration, it ends and, because it's linked, the knockback resist ends, too.
This may be useful for other effects that can end earlier than their max duration.
Just what it means, if you input a 1 here, it removes all associated graphs from the final product's formula. This can be useful if you want to give a flat bonus without having it modified by the default graphs, e.g. a max hp bonus of 1000 instead of 1000% of a graph value.
If set to 1, this modifies the graph by the owner's level. Take a look at the DAMAGE_MONSTER graph. You'll see it has over 100 'levels'. That's the damage that will be dealt at each character level if the USEOWNERLEVEL field is set to 1. Note that for some reason, this does not appear to work correctly for healing effects, for example the HP healed by the engineer's healing bot is set to use the owner's level, but it will not change as you level up.
This is a percent which modifies the target's armor during the damage calculation. It also supposedly modifies the caster's crit chance with the particular effect if it deals damage.
If set to true this forces the effect to expire on the death of the owner.
Here is how the final value of the effect is calculated. There are many modifiers, some which are particular to certain effect types and hidden. I'm not going to go over them all, yet. I probably should sometime soon, though.
The standard formula, at least for damage effects, is the following:
And of course, MAX could be substituted for MIN to find the top of the range.
WANDERER_GLAIVE_THROW's damage calculation is a little different because USEOWNERLEVEL is set to TRUE. It looks like this:
So, taking the numbers for a level 1 character, this effect's minimum damage is this:
Minimum should be 10 damage. This will be further modified during the damage calculation by the character's damage bonuses from Focus, buffs and items, then by the target's resistances and armor.
If STATMODIFIERISBONUS is set to true, then:
[(MAX)(GRAPH) + (STATVALUE)(STATPERCENT)]/100
To be continued:
Effect Categories and Quirks