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

Setting the level of Item ability.

Status
Not open for further replies.

SpasMaster

Hosted Project: SC
Level 23
Joined
Jan 29, 2010
Messages
1,969
Hello guys!

I have a question about a triggered ability that I made. It's really simple and everything seems to be perfect, but as usual it isn't... Basically I made an ability based off on Roar [Called Avenging Wrath]. I edited the object editor field of the ability to give 25% bonus damage. That's working fine. With a trigger I add item abilities to the hero (Intelligence and Strength, Attack Speed and Armor.) and set their level to the level of the Roar ability. And when the Roar buff is gone, I remove them.

Here is what happens:
•The abilities are added properly.
•But they aren't set to the level of the Roar ability.

How to fix this? : /


Triggers:

[trigger="Avenging Wrath"]Avenging Wrath
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Avenging Wrath
Actions
Set AvengingWrath_Caster = (Triggering unit)
Set AvengingWrath_Ability[1] = Avenging Wrath Armor
Set AvengingWrath_Ability[2] = Avenging Wrath Atk Speed
Set AvengingWrath_Ability[3] = Avenging Wrath Stats
Unit - Add AvengingWrath_Ability[1] to (Triggering unit)
Unit - Set level of AvengingWrath_Ability[1] for (Triggering unit) to (Level of Avenging Wrath for (Triggering unit))
Unit - Add AvengingWrath_Ability[2] to (Triggering unit)
Unit - Set level of AvengingWrath_Ability[2] for (Triggering unit) to (Level of Avenging Wrath for (Triggering unit))
Unit - Add AvengingWrath_Ability[3] to (Triggering unit)
Unit - Set level of AvengingWrath_Ability[3] for (Triggering unit) to (Level of Avenging Wrath for (Triggering unit))
Trigger - Turn on Avenging Wrath 2 <gen>
Trigger - Turn off (This trigger)
[/trigger]

[trigger="Avenging Wrath 2"]Avenging Wrath 2
Events
Time - Every 0.50 seconds of game time
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(AvengingWrath_Caster has buff Avenging Wrath ) Equal to True
Then - Actions
Else - Actions
Unit - Remove AvengingWrath_Ability[1] from AvengingWrath_Caster
Unit - Remove AvengingWrath_Ability[2] from AvengingWrath_Caster
Unit - Remove AvengingWrath_Ability[3] from AvengingWrath_Caster
Trigger - Turn on Avenging Wrath <gen>
Trigger - Turn off (This trigger)
[/trigger]
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
Hello guys!

I have a question about a triggered ability that I made. It's really simple and everything seems to be perfect, but as usual it isn't... Basically I made an ability based off on Roar [Called Avenging Wrath]. I edited the object editor field of the ability to give 25% bonus damage. That's working fine. With a trigger I add item abilities to the hero (Intelligence and Strength, Attack Speed and Armor.) and set their level to the level of the Roar ability. And when the Roar buff is gone, I remove them.

Here is what happens:
•The abilities are added properly.
•But they aren't set to the level of the Roar ability.

How to fix this? : /


Triggers:

[trigger="Avenging Wrath"]Avenging Wrath
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Avenging Wrath
Actions
Set AvengingWrath_Caster = (Triggering unit)
Set AvengingWrath_Ability[1] = Avenging Wrath Armor
Set AvengingWrath_Ability[2] = Avenging Wrath Atk Speed
Set AvengingWrath_Ability[3] = Avenging Wrath Stats
Unit - Add AvengingWrath_Ability[1] to (Triggering unit)
Unit - Set level of AvengingWrath_Ability[1] for (Triggering unit) to (Level of Avenging Wrath for (Triggering unit))
Unit - Add AvengingWrath_Ability[2] to (Triggering unit)
Unit - Set level of AvengingWrath_Ability[2] for (Triggering unit) to (Level of Avenging Wrath for (Triggering unit))
Unit - Add AvengingWrath_Ability[3] to (Triggering unit)
Unit - Set level of AvengingWrath_Ability[3] for (Triggering unit) to (Level of Avenging Wrath for (Triggering unit))
Trigger - Turn on Avenging Wrath 2 <gen>
Trigger - Turn off (This trigger)
[/trigger]

[trigger="Avenging Wrath 2"]Avenging Wrath 2
Events
Time - Every 0.50 seconds of game time
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(AvengingWrath_Caster has buff Avenging Wrath ) Equal to True
Then - Actions
Else - Actions
Unit - Remove AvengingWrath_Ability[1] from AvengingWrath_Caster
Unit - Remove AvengingWrath_Ability[2] from AvengingWrath_Caster
Unit - Remove AvengingWrath_Ability[3] from AvengingWrath_Caster
Trigger - Turn on Avenging Wrath <gen>
Trigger - Turn off (This trigger)
[/trigger]

I will agree with the above poster, these triggers are fine. Make sure those 3 abilites are not marked as Hero or Item abilities and that they have as many levels as Avenging Wrath with corresponding stats
 

SpasMaster

Hosted Project: SC
Level 23
Joined
Jan 29, 2010
Messages
1,969
I will agree with the above poster, these triggers are fine. Make sure those 3 abilites are not marked as Hero or Item abilities and that they have as many levels as Avenging Wrath with corresponding stats

After doing tons of fancy stuff, and testing stuff out it appears that it's just some kind of world editor bug.

However I found a way around it.

Instead of setting the level of the abilities to the level of Avenging Wrath, here is what I did. It works. :)

[trigger="Avenging Wrath"]Avenging Wrath
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Avenging Wrath
Actions
Set AvengingWrath_Caster = (Triggering unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of (Ability being cast) for (Triggering unit)) Equal to 1
Then - Actions
Set AvengingWrath_Ability[1] = Avenging Wrath Armor (L1)
Set AvengingWrath_Ability[2] = Avenging Wrath Atk Speed (L1)
Set AvengingWrath_Ability[3] = Avenging Wrath Stats (L1)
Unit - Add AvengingWrath_Ability[1] to (Triggering unit)
Unit - Add AvengingWrath_Ability[2] to (Triggering unit)
Unit - Add AvengingWrath_Ability[3] to (Triggering unit)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of (Ability being cast) for (Triggering unit)) Equal to 2
Then - Actions
Set AvengingWrath_Ability[1] = Avenging Wrath Armor (L2)
Set AvengingWrath_Ability[2] = Avenging Wrath Atk Speed (L2)
Set AvengingWrath_Ability[3] = Avenging Wrath Stats (L2)
Unit - Add AvengingWrath_Ability[1] to (Triggering unit)
Unit - Add AvengingWrath_Ability[2] to (Triggering unit)
Unit - Add AvengingWrath_Ability[3] to (Triggering unit)
Else - Actions
Trigger - Turn on Avenging Wrath 2 <gen>
Trigger - Turn off (This trigger)
[/trigger]

[trigger="Avenging Wrath 2"]Avenging Wrath 2
Events
Time - Every 0.50 seconds of game time
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(AvengingWrath_Caster has buff Avenging Wrath ) Equal to True
Then - Actions
Else - Actions
Unit - Remove AvengingWrath_Ability[1] from AvengingWrath_Caster
Unit - Remove AvengingWrath_Ability[2] from AvengingWrath_Caster
Unit - Remove AvengingWrath_Ability[3] from AvengingWrath_Caster
Trigger - Turn on Avenging Wrath <gen>
Trigger - Turn off (This trigger)
[/trigger]
 
Level 29
Joined
Mar 10, 2009
Messages
5,016
The (Level of (Ability being cast) for (Triggering unit)) Equal to 1 and soon really needs to convert to a looping instance for more accuracy and avoid long triggers...

Also, this AvengingWrath_Caster has buff Avenging Wrath ) Equal to True should be:

  • If - Conditions
  • (AvengingWrath_Caster has buff Avenging Wrath ) Equal to false
  • Then - Actions
    • Unit - Remove AvengingWrath_Ability[1] from AvengingWrath_Caster
    • Unit - Remove AvengingWrath_Ability[2] from AvengingWrath_Caster
    • Unit - Remove AvengingWrath_Ability[3] from AvengingWrath_Caster
    • Trigger - Turn on Avenging Wrath <gen>
    • Trigger - Turn off (This trigger)
 
Status
Not open for further replies.
Top