• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Spell] A heal and a few auras

Status
Not open for further replies.
Level 3
Joined
Sep 7, 2013
Messages
40
Hi guys

I'm creating two spells which have raised a few problems-

The first is a death coil-esque ability that damages the target based on the Hero's Intelligence, and heals her based on her Agility. I triggered the damage part easily enough, but am a bit stuck figuring out how to trigger the heal. For reference, the heal is 2/2.75/3.5/4.25 times her Agility.

The second, which I have no clue how to do, is a bunch of auras rolled into the one ability. Activating the spell toggles between the auras. The auras, for reference, are: Conviction (basically Command Aura), Holy Fire (Thorns aura), Faith (damage reduction/increased regeneration), Resistance (bonus magic resistance), Iron Will (improved armour) and Crusade (dealing damage grants an absorb shield). Not sure if that knowledge is necessary, but just in case.
Intended result: Learning the skill automatically starts on Conviction Aura. Activating the skill toggles to Holy Fire, toggling that turns on Faith, to Iron Will, to Crusade, to Conviction. There is no mana cost, but there is a 28/25/22/19/16/13/10 second cooldown.

I get the feeling that this will involve a spellbook mechanic, but really I have no idea.

Any help would really be appreciated!
 
Level 25
Joined
Sep 26, 2009
Messages
2,378
First ability:
That has a very easy solution or a very complicated one, depending on how you imagine your spell.
First, the heal: There are basically two options for the amount of heal. Either a static amount, meaning that if spell's basic damage is 200/300/400, the spell will heal 200/300/400 * 2/2.5/etc. agility.
The second option is dynamic amount. That means the actual damage the enemy unit suffered from this spell, as every unit has some kind of basic spell resistance and armor which reduce spell damage taken. So for example the actual damage unit took could be reduced by 15%... that means 170/255/340. Not to mention that if you kill the enemy unit with this spell, the amount will be even less (e.g. if hero has 150 hp and you use rank3 of the spell, the actual damage taken is obviously 150, not 340).

Now also it is important to know if your spell fires a projectile or if it is instant spell (no projectile fired). Because you most likely want the spell to heal your caster when it hits the target, not when you send it flying. So knowing that is important since a projectile can complicate the spell a bit.

----
Second spell:
This can be done very easily. Make one ability which will serve as an ability just for switching auras. Make the aura spells as non-hero abilities.

Now you will need a little bit of triggering. First, create an "ability" variable and check the "array" box to create an ability array. I will call this array "Aura_arr". Also create an integer variable called "maxAuras". Now create a trigger that fires upon map initialization (there is an even named like that) and do this:
  • Map Ini
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Set Aura_arr[1] = Conviction
    • Set Aura_arr[2] = Holy Fire
    • ...
    • Set Aura_arr[6] = Crusade
    • Set maxAuras = 6 //notice, this is the amount of auras in the array
Now, I don't know what type of map you do, so it's hard to solve this bit of problem. Anyway, the general idea would be to create another integer variable for your unit (or an integer array if multiple units can use it at the same time) called for example currentAura.
When a hero casts the aura changing spell, you do this:
1) Remove ability - remove Aura_arr[currentAura]
2) Increase currentAura by 1. Also check if currentAura > maxAuras. If yes, set currentAura TO 1.
3) Add ability - add Aura_arr[currentAura]

This will add and show the aura you currently have. IMO that is beneficial to you so that the player at least knows what current aura he has (it is possible to hide them via spellbook tho).
 
Level 4
Joined
Jun 30, 2014
Messages
72
Oh, w0w!

A triggered ability that even I can make if someone shows me how. Thank you for the codeless(!), scriptless(!) spellbook-esque system. Thank you for widening the limits of my skills. (I mean, I hope you don't mind my using this. Also, wearing my heart on my sleeve here.)
+rep Nichilus
:vw_love:
 
Last edited:
Status
Not open for further replies.
Top