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

Changing Ability data with triggers.

Status
Not open for further replies.
Level 5
Joined
Mar 24, 2020
Messages
80
Hi guys,

I've been trying to change ability data using triggers. I think this is quite a new function?

Anyways, basically I want the ability to deal damage based on the Hero's attributes.

This spell is based on flame strike, and the damage is based on the Hero's intelligence. How do I set up triggers to change the data just as the spell is being cast?

This is what i've got so far, and it doesn't work.

  • Set Damage
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Pyromage - [|cffffcc00Flame Strike|r]
    • Actions
      • Ability - Set Ability: (Unit: (Triggering unit)'s Ability with Ability Code: Pyromage - [|cffffcc00Flame Strike|r] )'s Real Level Field: Maximum Damage ('Hfs6') of Level: 1 to ((Real((Intelligence of (Triggering unit) (Include bonuses)))) x 3.00)
      • Ability - Set Ability: (Unit: (Triggering unit)'s Ability with Ability Code: Pyromage - [|cffffcc00Flame Strike|r] )'s Real Level Field: Half Damage Dealt ('Hfs3') of Level: 1 to ((Real((Intelligence of (Triggering unit) (Include bonuses)))) x 1.00)
      • Ability - Set Ability: (Unit: (Triggering unit)'s Ability with Ability Code: Pyromage - [|cffffcc00Flame Strike|r] )'s Real Level Field: Full Damage Dealt ('Hfs1') of Level: 1 to ((Real((Intelligence of (Triggering unit) (Include bonuses)))) x 2.00)
Cheers
 

Uncle

Warcraft Moderator
Level 63
Joined
Aug 10, 2018
Messages
6,457
So your Level field is actually incorrect because Blizzard wanted to make things as confusing as possible for GUI users.

These Ability field values are indexed starting at 0 like so:
Level 0 = Level 1
Level 1 = Level 2
Level 2 = Level 3
etc...

So you're changing the stats of the ability for Level 2 instead of Level 1.

A setup like this can be helpful to avoid making this mistake in the future.
  • Actions
    • Set Variable Lvl = ((Level of (Ability being cast) for (Triggering unit)) - 1)
    • Ability - Set Ability: (Unit: (Triggering unit)'s Ability with Ability Code: (Ability being cast))'s Integer Level Field: Number of Waves ('Hbz1') of Level: Lvl to 50
    • Ability - Set Ability: (Unit: (Triggering unit)'s Ability with Ability Code: (Ability being cast))'s Integer Level Field: Number of Shards ('Hbz3') of Level: Lvl to 50
 
Level 5
Joined
Mar 24, 2020
Messages
80
So your Level field is actually incorrect because Blizzard wanted to make things as confusing as possible for GUI users.

These Ability field values are indexed starting at 0 like so:
Level 0 = Level 1
Level 1 = Level 2
Level 2 = Level 3
etc...

So you're changing the stats of the ability for Level 2 instead of Level 1.

A setup like this can be helpful to avoid making this mistake in the future.
  • Actions
    • Set Variable Lvl = ((Level of (Ability being cast) for (Triggering unit)) - 1)
    • Ability - Set Ability: (Unit: (Triggering unit)'s Ability with Ability Code: (Ability being cast))'s Integer Level Field: Number of Waves ('Hbz1') of Level: Lvl to 50
    • Ability - Set Ability: (Unit: (Triggering unit)'s Ability with Ability Code: (Ability being cast))'s Integer Level Field: Number of Shards ('Hbz3') of Level: Lvl to 50

Thanks dude! It's really good to know how these types of triggers work. Will defo save that set up for future reference!
 
Status
Not open for further replies.
Top