If by attack power you mean unit's damage, then you will need to "tailor" a system that fits the unit that uses the spell.
You will need to save this prematurely somewhere:
- Damage Base (set up in Object Editor)
- Damage Number of Dices (in OE as well)
- Damage Sides per Dice (in OE)
- Unit's main attribute
- "Constant X" = Attack bonus per point in main attribute (found in Gameplay Constants) - this is a constant, it doesn't change throughout the game and is the same for everyone, but it is important to know the amount to get correct damage.
Hero's basic damage = Damage Base + [Main attribute*constant_X] + [Number of Dices -- (Number of Dices * Sides per Dice)]
For example the Paladin hero unit:
- Damage Base: 0
- Damage Number of Dices: 2
- Damage Sides per Dice: 6
- Main attribute: Strength
- constant X: 1
At level 10, the Paladin has 46 strength, so his damage would be:
Damage = 0 + [46*1] + [2 -- 2*6] = 48--58
This is quite simple if only 1 unit-type can have the Pyroblast spell, if many different units would have this spell, you would need to save the required datas somewhere and load them when needed.
However if you want to include bonus damage from items and abilities, then the system would get complicated quite a lot imo.
You would need to catch when your hero picks/drops items that increase his damage (either by directly increasing damage or by increasing main attribute) and make e.g. "Bonus dmg" variable that saves that amount. For spells you would need to catch when the Paladin is targeted by specific spells that increase damage and once again save that amount. You would also need to handle auras that increase damage (Trueshot aura, etc.)
The auras/buffs could be handled a bit differently by checking if unit has that specific buff and if yes, increase damage... but I'm not sure if you can get level of ability from the buff (in case the ability that places buff on your hero has more levels)