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

[Solved] Triggered spell

Status
Not open for further replies.
Level 9
Joined
Feb 20, 2014
Messages
409
Hi,
I created triggered ability increasing base damage during 10 seconds.
It works but after 10 seconds the damage doesn't go to their initial value.
So what's wrong in my last action?

  • Events
    • Unit - A unit Begins casting an ability
  • Actions
    • Set baseDMGE = (Base Damage of (Target unit of ability being cast) for weapon index 1)
    • Set baseDMG = (Real(baseDMGE))
    • Set TargetigUnit = (Target unit of ability being cast)
    • Wait 0.10 seconds
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Level of The Chosen One for (Triggering unit)) Equal to 1
      • Then - Actions
        • Unit - Set Base Damage of (Target unit of ability being cast) to ((Base Damage of (Target unit of ability being cast) for weapon index 1) x 10) for weapon index: 1
        • Wait 10.00 seconds
        • Unit - Set Base Damage of TargetigUnit to ((Base Damage of TargetigUnit for weapon index 1) / 10) for weapon index: 1
      • Else - Actions
 
Is there any particular reason why you first refer to "Target unit of ability being cast" and then after 10 seconds you refer to "TargetigUnit"? Maybe you should try to print a chat message with Base Damage of TargetigUnit as a string to see the actual values and how/if they change before and after the 10 seconds.

  • Events
    • Unit - A unit Begins casting an ability
  • Actions
    • Set baseDMGE = (Base Damage of (Target unit of ability being cast) for weapon index 1)
    • Set TargetigUnit = (Target unit of ability being cast)
    • Game - Send a text message to (Owner of (triggering unit)) with the text (real(baseDMGE))
    • Wait 0.00 seconds
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Level of The Chosen One for (Triggering unit)) Equal to 1
      • Then - Actions
        • Unit - Set Base Damage of TargetigUnit to ((Base Damage of TargetigUnit for weapon index 1) x 10) for weapon index: 1
        • Set baseDMGE = (Base Damage of (Target unit of ability being cast) for weapon index 1)
        • Game - Send a text message to (Owner of (triggering unit)) with the text (real(baseDMGE))
        • Wait 10.00 seconds
        • Unit - Set Base Damage of TargetigUnit to ((Base Damage of TargetigUnit for weapon index 1) / 10) for weapon index: 1
        • Set baseDMGE = (Base Damage of (Target unit of ability being cast) for weapon index 1)
        • Game - Send a text message to (Owner of (triggering unit)) with the text (real(baseDMGE))
      • Else - Actions

This might not be correct though, I don't have access to the WE atm.
 
Last edited:
Level 3
Joined
Mar 10, 2018
Messages
32
Is Set BaseDamage a new native of the latest patch?

Btw do maps with new natives work on 1.26a?
 
Level 9
Joined
Feb 20, 2014
Messages
409
Is there any particular reason why you first refer to "Target unit of ability being cast" and then after 10 seconds you refer to "TargetigUnit"? Maybe you should try to print a chat message with Base Damage of TargetigUnit as a string to see the actual values and how/if they change before and after the 10 seconds.

  • Events
    • Unit - A unit Begins casting an ability
  • Actions
    • Set baseDMGE = (Base Damage of (Target unit of ability being cast) for weapon index 1)
    • Set TargetigUnit = (Target unit of ability being cast)
    • Wait 0.00 seconds
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Level of The Chosen One for (Triggering unit)) Equal to 1
      • Then - Actions
        • Unit - Set Base Damage of TargetigUnit to ((Base Damage of TargetigUnit for weapon index 1) x 10) for weapon index: 1
        • Game - Send a text message to (Owner of (triggering unit)) with the text (real(baseDMGE))
        • Wait 10.00 seconds
        • Game - Send a text message to (Owner of (triggering unit)) with the text (real(baseDMGE))
        • Unit - Set Base Damage of TargetigUnit to ((Base Damage of TargetigUnit for weapon index 1) / 10) for weapon index: 1
      • Else - Actions

This might not be correct though, I don't have access to the WE atm.

Yes I set targeting unit of ability being cast to "TargetingUnit" cause it didn't work without it. It was just a try.
But anyway it still doesn't work. The damage boost works so it's weird that I can't reduce them after 10 sec
 
Yes I set targeting unit of ability being cast to "TargetingUnit" cause it didn't work without it. It was just a try.
But anyway it still doesn't work. The damage boost works so it's weird that I can't reduce them after 10 sec

I changed it up a little, run the trigger and tell me what the text messages prints.
 
Can't find the send a text message function in Game.... Where is it?

It should be under game. Alternatively use the Quest message function.

EDIT: This is what you're looking for under game:

  • Game - Display to (Owner of TargetigUnit) the text: (real(baseDMGE))

  • Events
    • Unit - A unit Starts the effect of an ability
  • Actions
    • Set TargetigUnit = (Target unit of ability being cast)
    • Set baseDMGE = (Base Damage of TargetigUnit for weapon index 1)
    • Game - Display to (Owner of TargetigUnit) the text: (real(baseDMGE))
    • Wait 0.00 seconds
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Level of The Chosen One for (Triggering unit)) Equal to 1
      • Then - Actions
        • Unit - Set Base Damage of TargetigUnit to (baseDMGE x 10) for weapon index: 1
        • Set baseDMGE = (Base Damage of TargetigUnit for weapon index 1)
        • Game - Display to (Owner of TargetigUnit) the text: (real(baseDMGE))
        • Wait 10.00 seconds
        • Unit - Set Base Damage of TargetigUnit to (baseDMGE / 10) for weapon index: 1
        • Set baseDMGE = (Base Damage of TargetigUnit for weapon index 1)
        • Game - Display to (Owner of TargetigUnit) the text: (real(baseDMGE))
      • Else - Actions

Try this. If it doesn't work then I will help you when I get off work.

EDIT: Also you should use "Starts the effect of an ability".
 
Last edited:
Sorry in advance if this is considered a double post. Please delete or merge it if it is :)

This trigger worked perfectly for me:

  • Test
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Healing Wave
    • Actions
      • Set TargetUnit = (Target unit of ability being cast)
      • Set TargetUnitBaseDamage = (Base Damage of TargetUnit for weapon index 1)
      • Wait 0.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • Unit - Set Base Damage of TargetUnit to (TargetUnitBaseDamage x 10) for weapon index: 1
          • Set TargetUnitBaseDamage = (Base Damage of TargetUnit for weapon index 1)
          • Wait 10.00 seconds
          • Unit - Set Base Damage of TargetUnit to (TargetUnitBaseDamage / 10) for weapon index: 1
          • Set TargetUnitBaseDamage = (Base Damage of TargetUnit for weapon index 1)
        • Else - Actions


Just change it to your variables and spells etc. and you're good.
 
This trigger is not MUI and will permanently increase and decrease units’ attack damage if it’s cast multiple times simultaneously.

There should be no reason for the 0 second wait....

True I guess, I am just going by his initial trigger. I would say it's the 10 second wait that's the real problem though. If someone more seasoned in the WE than me wants to make it MUI then all power to them.
 
Status
Not open for further replies.
Top