• 🏆 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!

Attribute Based Hero Spells

Status
Not open for further replies.
Level 4
Joined
Feb 24, 2018
Messages
71
I need some help in making attribute based hero spells.For example

StormBolt
Events
Unit - A unit Finishes casting an ability
Conditions
(Ability being cast) Equal to Storm Bolt
Actions
Set Strength = (Strength of (Casting unit) (Include bonuses))
Set Convert = (Real(Strength))
Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Convert x 5.00) damage of attack type Spells and damage type Normal
or

AoE Heal
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Mass Heal
Actions
Set Inteligence = (Intelligence of (Casting unit) (Include bonuses))
Set Convert = (Real(Inteligence))
Set UnitGroup = (Units within 600.00 of (Target point of ability being cast) matching ((Owner of (Matching unit)) Equal to (Owner of (Triggering unit))))
Game - Display to (All players) the text: (Currently Casting: + (Name of (Ability being cast)))
Unit Group - Pick every unit in UnitGroup and do (Unit - Set life of (Picked Unit) to ((Life of (Picked unit)) + (Convert x 4.00)))
Unit Group - Pick every unit in UnitGroup and do (Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl)
Special Effect - Destroy (Last created special effect)
Custom script: call DestroyGroup(udg_UnitGroup)

I'm confused about how to make these to scale for 10 levels (without making 10 different spells) so I can use them for my heroes.For example first level deals 0.50 x STR , second level deals 0.75 X STR and so on.Thanks !
 
Level 4
Joined
Aug 31, 2011
Messages
88
You can try with this things, which I used in my map.

Basically u set up the integer variable, in my case "Set hadra_level = (0 + (Learned skill level))"


  • Patriarch bonus skill
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Locus of Hadra
    • Actions
      • Set hadra_level = (0 + (Learned skill level))


Then u create the formula for your spell, in my case "(((15.00 x (Real(hadra_level)))" (part of the formula in which variable is used)


  • Mana Refresh
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Triggering unit) Equal to patrirarch
      • (Random integer number between 1 and 100) Less than or equal to 50
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Locus of Hadra
        • Then - Actions
          • Unit - Set mana of patrirarch to ((Mana of patrirarch) + (((15.00 x (Real(hadra_level))) + 60.00) / 2.00))
          • Special Effect - Create a special effect at (Position of patrirarch) using Abilities\Spells\Undead\ReplenishMana\ReplenishManaCasterOverhead.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
 
Level 4
Joined
Aug 31, 2011
Messages
88
Most probably yes, I triggered it cause I used a little complicated system of that so I needed a value stored in variable.
 
Level 4
Joined
Aug 31, 2011
Messages
88
  • Set strenght_dmg = ((Strength of (Casting unit) (Include bonuses)) x (Level of Death Coil for (Casting unit)))
When u declare the variable in this case (strenght_dmg) you can pick Arithmetic which is a function that offers you basic mathematical operations (+,-,*,/), then you pick each value, one is hero attribute (str, agi, int) and second is level of your ability for example death coil.

And yeah in future try to post your triggers in ["trigger"]["/trigger"] brackets without (""). :D
 
Level 4
Joined
Feb 24, 2018
Messages
71
By the way, what about spells with cone effect ? How can I make it work since Unit - Cause (Triggering unit) to damage (Target unit of ability being cast) isn't an option.
 
Level 4
Joined
Aug 31, 2011
Messages
88
I think it will cause problems, cause if you have 2 triggers using the same variable, but different declaration, one will override another. Although you can use for example: Your Strenght variable only and only if u use it in a triggered spells that you will use with only one hero-type.

Try using Damage Area instead of Damage Target, if it doesn't work try with Unit Group and damage each target individually.
 
Level 4
Joined
Aug 31, 2011
Messages
88
It can't be triggered that way, but you can make it if unit dies while having that Buff you can Unit Group targets close to him and damage them with attribute based damage.

Or you can use dummy ability to damage that Unit Group.
 
Level 4
Joined
Feb 24, 2018
Messages
71
  • Incinerate Explode
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) has buff Incinerate) Equal to True
    • Actions
      • Set IncinerateGroup = (Units within 300.00 of (Position of (Dying unit)) matching (((Matching unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True))
      • Unit Group - Pick every unit in IncinerateGroup and do (Unit - Cause (Killing unit) to damage (Picked unit), dealing 500.00 damage of attack type Spells and damage type Normal)
      • Custom script: call DestroyGroup (udg_IncinerateGroup)
Could you tell me what should I change here because it doesn't do any explosion damage.
I can change the damage to be attribute based , but for now the normal 500 explosion damage doesn't seem to work :([/trigger]
 
Level 15
Joined
Jul 9, 2008
Messages
1,552
i believe the issue is dying units cant have buffs

this will take alot of work to do messing around with unit groups and to also ull need to know the hero that the incinerate buff belongs to to get the right attributes to deal damage
 
Status
Not open for further replies.
Top