I've been really cracking my brain to find a viable solution to the problem of having a Spelldamage stat in a map I am working on. One solution is to make every single Spelldamage-using spell a triggered spell with a dummy spell as activator, but that means you can't have accurate descriptions of damage in your spell, so I found a way that I think might work. Well, it WILL work, but the question is if its viable and how its use of system resources will be..
When a player selects a hero that uses either +Spelldamage or +Healing, a leaderboard is created for the player listing his +Spelldamage or +Healing. The characters +Spelldamage or +Healing is calculated every second by a looping trigger that activates once a second, and the total +Spelldamage / Healing is equal to Int + Equipment modifiers (i.e. any equipment with + Spelldamage) and buff modifiers (if you have any buffs that affect +Spelldamage).
Here comes the part I'm uncertain about, instead of making the spells triggered spells, I was thinking that it might be possible to make a spell with, lets say, 500 levels. Every time the trigger is run that updates spelldamage, it sets the level of the Spelldamage spells to be equal to the players +Spelldamage. So, lets say that I have a Fireball spell, it causes 50 damage as base and an additional 50 damage every time it is levelled up, plus the players +Spelldamage. We know the spell can't do less than 60 damage, because the hero starts with 10 int, and 50 is the base damage of the spell.
So we set the damage of the level 1 spell to be 60, and then make it a 500 levels spell, increasing damage by 1 every level (if 500 is appropriate, you can always calculate what the spelldamage cap is for your map).
Every time the trigger is run that updates spelldamage, it sets the level of the spell to:
Level of the hero ability (which is a dummy ability placed in a spellbook) x 50
Plus current Spelldamage of the hero
Minus 60 (Since we start the spell at 60 damage as we know it is the minimum damage possible for the spell)
And the result would be that the spell should cause appropriate damage without making it a triggered spell at all.
Now, my question is, if the map has, for example, 4 players with casters heroes, would it cause lag to have a trigger activating once every second like this? Would it cause any lag to have a 500-level ability?
Making the actual 500-level ability isn't a *huge* problem, lots of copy / pasting involved, but not problematic I would think.
When a player selects a hero that uses either +Spelldamage or +Healing, a leaderboard is created for the player listing his +Spelldamage or +Healing. The characters +Spelldamage or +Healing is calculated every second by a looping trigger that activates once a second, and the total +Spelldamage / Healing is equal to Int + Equipment modifiers (i.e. any equipment with + Spelldamage) and buff modifiers (if you have any buffs that affect +Spelldamage).
Here comes the part I'm uncertain about, instead of making the spells triggered spells, I was thinking that it might be possible to make a spell with, lets say, 500 levels. Every time the trigger is run that updates spelldamage, it sets the level of the Spelldamage spells to be equal to the players +Spelldamage. So, lets say that I have a Fireball spell, it causes 50 damage as base and an additional 50 damage every time it is levelled up, plus the players +Spelldamage. We know the spell can't do less than 60 damage, because the hero starts with 10 int, and 50 is the base damage of the spell.
So we set the damage of the level 1 spell to be 60, and then make it a 500 levels spell, increasing damage by 1 every level (if 500 is appropriate, you can always calculate what the spelldamage cap is for your map).
Every time the trigger is run that updates spelldamage, it sets the level of the spell to:
Level of the hero ability (which is a dummy ability placed in a spellbook) x 50
Plus current Spelldamage of the hero
Minus 60 (Since we start the spell at 60 damage as we know it is the minimum damage possible for the spell)
And the result would be that the spell should cause appropriate damage without making it a triggered spell at all.
Now, my question is, if the map has, for example, 4 players with casters heroes, would it cause lag to have a trigger activating once every second like this? Would it cause any lag to have a 500-level ability?
Making the actual 500-level ability isn't a *huge* problem, lots of copy / pasting involved, but not problematic I would think.