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

Help with a trigger

Status
Not open for further replies.
Level 13
Joined
Aug 19, 2014
Messages
1,111
Hello guys I need help with a trigger for a passive ability, each time the hero cast a spell he will gain 10% movement speed that last for 4 seconds and stacks up to 5 times.

Swiftness
  • Events
    • Unit - A unit Starts the effect of an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to |cff9acd32Rapid Fire|r
          • (Ability being cast) Equal to |cffadff2fBinding Shot|r
    • Actions


I thought of something like this, however I have no idea what to put in the action.
 
Level 5
Joined
Jun 28, 2010
Messages
110
Hello guys I need help with a trigger for a passive ability, each time the hero cast a spell he will gain 10% movement speed that last for 4 seconds and stacks up to 5 times.

Swiftness
  • Events
    • Unit - A unit Starts the effect of an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to |cff9acd32Rapid Fire|r
          • (Ability being cast) Equal to |cffadff2fBinding Shot|r
    • Actions


I thought of something like this, however I have no idea what to put in the action.

Lets say, Bloodlust is your switfness skill, has 5 level.
If the caster has no "Bloodlust" buff, then create a dummy with a level 1 bloodlust and cast it on the caster.
If the caster has "Bloodlust" buff level 1, then create a dummy with a level 2 bloodlust and cast it on the caster.
Repeat the process as many level as you want. Hope this will help!
 
Level 6
Joined
Mar 17, 2012
Messages
105
I think this might be more easily accomplished without the use of dummies like Stork said, and instead using four variations of Endurance Aura, with four variations of the Endurance Aura buff. I've made these two triggers and tested them in-game, they work nicely:

  • FireySoul
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • ((Ability being cast) Equal to Binding Shot ) or ((Ability being cast) Equal to Rapid Fire )
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • ((Casting unit) has buff Firey Soul [1]) Equal to False
              • ((Casting unit) has buff Firey Soul [2]) Equal to False
              • ((Casting unit) has buff Firey Soul [3]) Equal to False
              • ((Casting unit) has buff Firey Soul [4]) Equal to False
        • Then - Actions
          • Unit - Add Firey Soul [1] to (Casting unit)
          • Countdown Timer - Start Firey_Soul_Timer as a One-shot timer that will expire in Firey_Soul_TIME seconds
          • -------- Firey_Soul_TIME is set to an initial value of 5 seconds. --------
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Casting unit) has buff Firey Soul [1]) Equal to True
            • Then - Actions
              • Unit - Remove Firey Soul [1] from (Casting unit)
              • Unit - Remove Firey Soul [1] buff from (Casting unit)
              • Unit - Add Firey Soul [2] to (Casting unit)
              • Countdown Timer - Start Firey_Soul_Timer as a One-shot timer that will expire in Firey_Soul_TIME seconds
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Casting unit) has buff Firey Soul [2]) Equal to True
                • Then - Actions
                  • Unit - Remove Firey Soul [2] from (Casting unit)
                  • Unit - Remove Firey Soul [2] buff from (Casting unit)
                  • Unit - Add Firey Soul [3] to (Casting unit)
                  • Countdown Timer - Start Firey_Soul_Timer as a One-shot timer that will expire in Firey_Soul_TIME seconds
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Casting unit) has buff Firey Soul [3]) Equal to True
                    • Then - Actions
                      • Unit - Remove Firey Soul [3] from (Casting unit)
                      • Unit - Remove Firey Soul [3] buff from (Casting unit)
                      • Unit - Add Firey Soul [4] to (Casting unit)
                      • Countdown Timer - Start Firey_Soul_Timer as a One-shot timer that will expire in Firey_Soul_TIME seconds
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ((Casting unit) has buff Firey Soul [4]) Equal to True
                        • Then - Actions
                          • Countdown Timer - Start Firey_Soul_Timer as a One-shot timer that will expire in Firey_Soul_TIME seconds
                        • Else - Actions
                          • Do nothing
  • FireySoulTimer
    • Events
      • Time - Firey_Soul_Timer expires
    • Conditions
    • Actions
      • Set Temp_UnitGroup = (Units of type Caster)
      • Unit Group - Pick every unit in Temp_UnitGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Firey Soul [1]) Equal to True
            • Then - Actions
              • Unit - Remove Firey Soul [1] from (Picked unit)
              • Unit - Remove Firey Soul [1] buff from (Picked unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) has buff Firey Soul [2]) Equal to True
                • Then - Actions
                  • Unit - Remove Firey Soul [2] from (Picked unit)
                  • Unit - Remove Firey Soul [2] buff from (Picked unit)
                  • Unit - Add Firey Soul [1] to (Picked unit)
                  • Countdown Timer - Start Firey_Soul_Timer as a One-shot timer that will expire in Firey_Soul_TIME seconds
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) has buff Firey Soul [3]) Equal to True
                    • Then - Actions
                      • Unit - Remove Firey Soul [3] from (Picked unit)
                      • Unit - Remove Firey Soul [3] buff from (Picked unit)
                      • Unit - Add Firey Soul [2] to (Picked unit)
                      • Countdown Timer - Start Firey_Soul_Timer as a One-shot timer that will expire in Firey_Soul_TIME seconds
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ((Picked unit) has buff Firey Soul [4]) Equal to True
                        • Then - Actions
                          • Unit - Remove Firey Soul [4] from (Picked unit)
                          • Unit - Remove Firey Soul [4] buff from (Picked unit)
                          • Unit - Add Firey Soul [3] to (Picked unit)
                          • Countdown Timer - Start Firey_Soul_Timer as a One-shot timer that will expire in Firey_Soul_TIME seconds
                        • Else - Actions
                          • Do nothing
      • Custom script: call DestroyGroup( udg_Temp_UnitGroup )
 

Deleted member 242951

D

Deleted member 242951

I noticed that u are using colored tooltips in the editor name but actually there is no need for that. Actually to maked it colored in game u need 2 change just the Tooltip : Basic

instead of renaming the editor name as that will just create confusion. :)
 
Level 13
Joined
Aug 19, 2014
Messages
1,111
@Marine, it's quite inefficient that way.

With Bloodlust + One Trigger (or two, if including configurations in separated trigger), this can be obtained actually.

Why is Marine's trigger is inefficient? How should it be then? Should I do what Marine did?
 
If I recall, through Object Editor you can modify the movement speed in Bloodlust.
And since Bloodlust is a timed ability, you can actually just give the ability (first trigger) and disregard the loop check (second trigger).

And below is a quite deep explanation, if you get lost in it, just ask. I'll try to re-explain it if it's too difficult to understand.

By inefficient is with the structure of the code, is that the way the trigger is made, the check can be done in array form (first trigger and second trigger), which will make it easy to look at and modifying it shouldn't be difficult (a combo of variable arrays and for loop function will do the job, with a configuration trigger). Also, screw Do Nothing, it's slowing down the code (unnecessary function calling).

JASS:
function DoNothing takes nothing returns nothing
endfunction
^this two lined function behind Do Nothing will slow down trigger speed by nanosecond, but it's better to be efficient, so don't use them (NEVER EVER USE THEM AT ALL) and leave the block blank instead.
 
Level 13
Joined
Aug 19, 2014
Messages
1,111
Hello guys I want to use this system :fp: http://www.hiveworkshop.com/forums/.../?prev=t=65&search=missile&r=20&d=list&page=2 But I have a few questions about it and the author seems to be inactive, so I decided to post my question here. I have already read each functions and what they do, however I didn't saw anything that will add a ''NUMBER'' of missiles. Also does this system can support multi-level? The example spells doesn't have any level and if it supports multi-level, what function should I put?

I'll post the trigger..

  • Arrows Release 1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Arrows Release
    • Actions
      • Set AR_Caster = (Triggering unit)
      • Set AR_Target = (Target point of ability being cast)
      • Set AR_Int = 1
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • Set Projectile_AoE = 75.00
          • Set Projectile_AttackType = Magic
          • Set Projectile_Damage = 100.00
          • Set Projectile_DamageType = Magic
          • Set Projectile_DestroyTree = False
          • Set Projectile_Impact = Abilities\Weapons\BansheeMissile\BansheeMissile.mdl
          • Set Projectile_Model = Abilities\Weapons\MoonPriestessMissile\MoonPriestessMissile.mdl
          • Set Projectile_Height = 45.00
          • Set Projectile_Size = 100.00
          • Set Projectile_Source = AR_Caster
          • Set Projectile_Speed = 18.00
          • Set Projectile_TargetPoint = (AR_Target offset by (Random real number between 0.00 and 175.00) towards (Random angle) degrees)
          • Custom script: set udg_Projectile_Trigger = null
          • Set Projectile_UnitOrPoint = False
          • Set Projectile_HArc = False
          • Set Projectile_VArc = True
          • Set Projectile_VArcHeight = 25.00
          • Custom script: call TriggerExecute( gg_trg_CPS_Creating )
      • Countdown Timer - Start AR_Timer as a One-shot timer that will expire in 0.50 seconds
  • Arrows Release 2
    • Events
      • Time - AR_Timer expires
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AR_Int Greater than 0
        • Then - Actions
          • For each (Integer A) from 1 to 5, do (Actions)
            • Loop - Actions
              • Set Projectile_AoE = 75.00
              • Set Projectile_AttackType = Magic
              • Set Projectile_Damage = 100.00
              • Set Projectile_DamageType = Magic
              • Set Projectile_DestroyTree = False
              • Set Projectile_Impact = Abilities\Weapons\BansheeMissile\BansheeMissile.mdl
              • Set Projectile_Model = Abilities\Weapons\MoonPriestessMissile\MoonPriestessMissile.mdl
              • Set Projectile_Height = 45.00
              • Set Projectile_Size = 100.00
              • Set Projectile_Source = AR_Caster
              • Set Projectile_Speed = 18.00
              • Set Projectile_TargetPoint = (AR_Target offset by (Random real number between 0.00 and 225.00) towards (Random angle) degrees)
              • Custom script: set udg_Projectile_Trigger = null
              • Set Projectile_UnitOrPoint = False
              • Set Projectile_HArc = False
              • Set Projectile_VArc = True
              • Set Projectile_VArcHeight = 25.00
              • Custom script: call TriggerExecute( gg_trg_CPS_Creating )
          • Set AR_Int = (AR_Int - 1)
          • Countdown Timer - Start AR_Timer as a One-shot timer that will expire in 0.30 seconds
        • Else - Actions
          • Custom script: call RemoveLocation(udg_AR_Target)
 
Last edited:
Level 13
Joined
Aug 19, 2014
Messages
1,111
I attempt to use the system to create the spell I had in mind.

  • Retribution
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Immolation Arrow
    • Actions
      • -------- ------------------------------------------------------------------------------------------------- --------
      • -------- Getting the Spell constants --------
      • -------- ------------------------------------------------------------------------------------------------- --------
      • Set Projectile_VArc = True
      • Set Projectile_HArc = False
      • Set Projectile_UnitOrPoint = False
      • Set Projectile_Source = (Triggering unit)
      • Set Projectile_TargetPoint = (Target point of ability being cast)
      • Set Temp_Ability_Level = (Level of (Ability being cast) for Projectile_Source)
      • Set Ability_Owner = (Owner of Temp_Unit)
      • Set Projectile_AttackType = Magic
      • Set Projectile_DamageType = Magic
      • Set Projectile_DestroyTree = False
      • Set Projectile_Impact = Abilities\Spells\Human\FlameStrike\FlameStrike1.mdl
      • Set Projectile_Model = Abilities\Weapons\SearingArrow\SearingArrowMissile.mdl
      • Set Temp_Group = (Units within Projectile_AoE of Projectile_TargetPoint matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Owner of (Matching unit)) is an enemy of (Owner of Temp_Unit)) Equal to False))))
      • -------- ------------------------------------------------------------------------------------------------- --------
      • -------- Setting the Spell values --------
      • -------- ------------------------------------------------------------------------------------------------- --------
      • Set Projectile_AoE = 250.00
      • Set Projectile_Damage = 100.00
      • Set Temp_Total_Value = (Projectile_Damage x (Real(Temp_Ability_Level)))
      • Set Projectile_Height = 45.00
      • Set Projectile_Size = 150.00
      • Set Projectile_Speed = 22.00
      • Set Projectile_VArcHeight = 25.00
      • Custom script: call TriggerExecute( gg_trg_CPS_Creating )
However I find it hard to use a system, I can't even use ''Projectile_Source'' variable as the ''Owner of triggering unit''
The spell I had in my mind will cause units in the area to received damage and get slown as soon as the missile hits the ground, allied units in the area will be healed. That's why I need the dummy unit to use the ''Holy Light'' ability.
 
Level 5
Joined
Jun 28, 2010
Messages
110
Sorry but i don't find any problem when come to use that system. Its work good, you need to read the instruction in the map really really clearly in order to use it properly. The Execution Trigger is not the matter, the most important thing is the Creating and Loop Trigger. Your questions might be very basic for me - which can be very easily solved by basic knowledge for GUI-er.
 
Level 5
Joined
Jan 17, 2014
Messages
131
Here, I made you 2 triggers + attached test map. I hope it is what you wanted.

  • Spell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • ((Triggering unit) has buff Spell ) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Spell (ivofena) for (Triggering unit)) Equal to 1
        • Then - Actions
          • Set Spell_Index = (Spell_Index + 1)
          • Set Spell_Unit[Spell_Index] = (Triggering unit)
          • Set Spell_Temp_Loc = (Position of (Triggering unit))
          • Unit - Create 1 Dummy (ivofena) for (Owner of (Triggering unit)) at Spell_Temp_Loc facing Default building facing degrees
          • Custom script: call RemoveLocation(udg_Spell_Temp_Loc)
          • Unit - Hide (Last created unit)
          • Unit - Make (Last created unit) Invulnerable
          • Unit - Add Swiftness (ivofena) to (Last created unit)
          • Unit - Set level of Swiftness (ivofena) for (Last created unit) to (Level of Spell (ivofena) for (Triggering unit))
          • Unit - Order (Last created unit) to Orc Shaman - Bloodlust (Triggering unit)
          • Unit - Increase level of Spell (ivofena) for (Triggering unit)
          • Unit - Remove (Last created unit) from the game
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Spell Loop <gen> is on) Equal to False
            • Then - Actions
              • Trigger - Turn on Spell Loop <gen>
            • Else - Actions
              • Do nothing
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Spell (ivofena) for (Triggering unit)) Greater than 1
              • (Level of Spell (ivofena) for (Triggering unit)) Less than 6
            • Then - Actions
              • Set Spell_Temp_Loc = (Position of (Triggering unit))
              • Unit - Create 1 Dummy (ivofena) for (Owner of (Triggering unit)) at Spell_Temp_Loc facing Default building facing degrees
              • Custom script: call RemoveLocation(udg_Spell_Temp_Loc)
              • Unit - Hide (Last created unit)
              • Unit - Make (Last created unit) Invulnerable
              • Unit - Add Swiftness (ivofena) to (Last created unit)
              • Unit - Set level of Swiftness (ivofena) for (Last created unit) to (Level of Spell (ivofena) for (Triggering unit))
              • Unit - Order (Last created unit) to Orc Shaman - Bloodlust (Triggering unit)
              • Unit - Increase level of Spell (ivofena) for (Triggering unit)
              • Unit - Remove (Last created unit) from the game
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Spell (ivofena) for (Triggering unit)) Equal to 6
                • Then - Actions
                  • Set Spell_Temp_Loc = (Position of (Triggering unit))
                  • Unit - Create 1 Dummy (ivofena) for (Owner of (Triggering unit)) at Spell_Temp_Loc facing Default building facing degrees
                  • Custom script: call RemoveLocation(udg_Spell_Temp_Loc)
                  • Unit - Hide (Last created unit)
                  • Unit - Make (Last created unit) Invulnerable
                  • Unit - Add Swiftness (ivofena) to (Last created unit)
                  • Unit - Set level of Swiftness (ivofena) for (Last created unit) to (Level of Spell (ivofena) for (Triggering unit))
                  • Unit - Order (Last created unit) to Orc Shaman - Bloodlust (Triggering unit)
                  • Unit - Remove (Last created unit) from the game
                • Else - Actions
                  • Do nothing
  • Spell Loop
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Spell_Integer) from 1 to Spell_Index, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Spell_Unit[Spell_Integer] has buff Swiftness (ivofena)) Equal to False
            • Then - Actions
              • Unit - Set level of Spell (ivofena) for Spell_Unit[Spell_Integer] to 1
              • Set Spell_Unit[Spell_Integer] = Spell_Unit[Spell_Index]
              • Set Spell_Index = (Spell_Index - 1)
              • Set Spell_Integer = (Spell_Integer - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Spell_Index Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
                  • Do nothing
            • Else - Actions
              • Do nothing
 

Attachments

  • Testmap for jonbon29.w3x
    15.2 KB · Views: 34
Last edited:
Status
Not open for further replies.
Top