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

Need help with my triggers

Status
Not open for further replies.
Level 13
Joined
Aug 19, 2014
Messages
1,111
Hello guys I made a Unit Target Spell that will damage target, heals the caster and stuns the target on the 3rd cast of the ability. Here's the trigger.

  • Maul
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Maul
    • Actions
      • -------- ------------------------------------------------------------------------------------------------- --------
      • -------- Getting the Spell constants --------
      • -------- ------------------------------------------------------------------------------------------------- --------
      • Set Temp_Unit = (Triggering unit)
      • Set Temp_Target = (Target unit of ability being cast)
      • Set TempPlayer = (Owner of Temp_Unit)
      • Set Temp_Location = (Position of Temp_Target)
      • Set TempAbility = Maul Stun (Dummy Ability)
      • -------- ------------------------------------------------------------------------------------------------- --------
      • -------- Setting the Spell values --------
      • -------- ------------------------------------------------------------------------------------------------- --------
      • Set Temp_Stats = (Strength of Temp_Unit (Include bonuses))
      • Set Temp_Ability_Level = (Level of (Ability being cast) for Temp_Unit)
      • Set Temp_Value = (40.00 x (Real(Temp_Ability_Level)))
      • Set Temp_Value_2 = (10.00 x (Real(Temp_Ability_Level)))
      • Set Temp_Total_Value = (Temp_Value + (0.25 x (Real(Temp_Stats))))
      • -------- ------------------------------------------------------------------------------------------------- --------
      • -------- Damage the target and heals the caster --------
      • -------- ------------------------------------------------------------------------------------------------- --------
      • Unit - Cause Temp_Unit to damage Temp_Target, dealing Temp_Total_Value damage of attack type Normal and damage type Normal
      • Unit - Set life of Temp_Unit to (Real(((Integer((Life of Temp_Unit))) + (Integer(Temp_Total_Value_2)))))
      • -------- ------------------------------------------------------------------------------------------------- --------
      • -------- Stuns the target at 3rd cast --------
      • -------- ------------------------------------------------------------------------------------------------- --------
      • Set TempInteger2 = 2
      • Set Maul_Count[TempInteger2] = (Maul_Count[TempInteger2] + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Maul_Count[TempInteger2] Equal to 3
        • Then - Actions
          • Unit - Create 1 Dummy Unit for TempPlayer at Temp_Location facing Default building facing degrees
          • Set Temp_Dummy = (Last created unit)
          • Unit - Add a 1.50 second Generic expiration timer to Temp_Dummy
          • Unit - Add TempAbility to Temp_Dummy
          • Unit - Set level of TempAbility for Temp_Dummy to Temp_Ability_Level
          • Unit - Order Temp_Dummy to Neutral - Hurl Boulder Temp_Target
          • Set Maul_Count[TempInteger1] = 0
          • Custom script: call RemoveLocation(udg_Temp_Location)
        • Else - Actions
Right now I'm having a couple of bugs from the Maul Trigger.

1) It stuns the target forever in 1st cast, (the Hero ability is based on a hurl boulder ability and the Dummy ability too, both of them are set to 0 stun duration).

2) It doesn't heal the hero.

3) Somehow this Fury Trigger below stacks with Maul Trigger.

  • Fury
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • IsDamageSpell Equal to False
      • (Level of Fury or DamageEventSource) Greater than 0
    • Actions
      • Set Temp_Stats = (Intelligence of DamageEventSource (Include bonuses))
      • Set Temp_Ability_Level = (Level of Fury for DamageEventSource)
      • Set Temp_Value = (10.00 x (Real(Temp_Ability_Level)))
      • Set Temp_Total_Value = (Temp_Value + (0.00 x (Real(Temp_Stats))))
      • Set TempInteger1 = 1
      • Set Fury_Count[TempInteger1] = (Fury_Count[TempInteger1] + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Fury_Count[TempInteger1] Equal to 3
        • Then - Actions
          • Unit - Set life of DamageEventSource to (Real(((Integer((Life of DamageEventSource))) + (Integer(Temp_Total_Value)))))
          • Set Fury_Count[TempInteger1] = 0
        • Else - Actions
This trigger heals the hero on his 3rd basic attack. The problem is that when the hero attacked 2 times and cast the Maul Ability, he heals himself. Same as when the hero cast the Maul Ability 2 times, his next attack will heal himself. Need help guys on pointing out what's causing the bugs :ogre_haosis:
 
Level 22
Joined
Feb 6, 2014
Messages
2,466
Everytime a unit cast the spell, Maul Count would increase, so TempInteger2 must be something unique to a unit like a custom value (if you're using Unit Indexer).
1. Now for the stun, setting the duration to zero = stun forever.
2. Try not converting them to integers
3. Same solution as mentioned in my first paragraph.
 
Level 13
Joined
Aug 19, 2014
Messages
1,111
TempInteger1 and 2 should be set to the custom value of the unit who has the ability. You only need just the one TempInteger, as well.

You mean I should set the custom value of the unit in the trigger first? Even if I had a lot of triggers that uses the TempInteger but has different custom values, that won't be a problem?

Are there any other triggers which use Maul_Count or Fury_Count? If not, then add a debug message whenever you add 1 to either count so you can keep track of when it's happening too often.

I only use Maul_Count for the Maul Trigger and Fury_Count for the Fury Trigger.

Everytime a unit cast the spell, Maul Count would increase, so TempInteger2 must be something unique to a unit like a custom value (if you're using Unit Indexer).
1. Now for the stun, setting the duration to zero = stun forever.
2. Try not converting them to integers
3. Same solution as mentioned in my first paragraph.

Yes Maul Count would only increase if Maul Ability is cast, I'm using Bribe's Unit Indexer.
 
Level 13
Joined
Aug 19, 2014
Messages
1,111
Here it is Mr. Bribe, is this right?

  • Fury
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • IsDamageSpell Equal to False
      • (Level of |cffff7f50Fury|r (Hedgehogman) for DamageEventSource) Greater than 0
    • Actions
      • Set Temp_Stats = (Intelligence of DamageEventSource (Include bonuses))
      • Set Temp_Ability_Level = (Level of |cffff7f50Fury|r (Hedgehogman) for DamageEventSource)
      • Set Temp_Value = (10.00 x (Real(Temp_Ability_Level)))
      • Set Temp_Total_Value = (Temp_Value + (0.00 x (Real(Temp_Stats))))
      • Set TempInteger1 = (Custom value of DamageEventSource)
      • Set Berserk_Count[TempInteger1] = (Berserk_Count[TempInteger1] + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Berserk_Count[TempInteger1] Equal to 3
        • Then - Actions
          • Unit - Set life of DamageEventSource to (Real(((Integer((Life of DamageEventSource))) + (Integer(Temp_Total_Value)))))
          • Set Berserk_Count[TempInteger1] = 0
        • Else - Actions
 
Level 13
Joined
Aug 19, 2014
Messages
1,111
I'm not sure why I did that either :ogre_haosis:

Anyway thanks guys, I'll fix the Maul Trigger tomorrow, I'm sleepy :goblin_sleep:
 
Level 13
Joined
Aug 19, 2014
Messages
1,111
I guess its time to bump my thread since I've thread everything I know how to fix my triggers and yet it still bugs.

Here are the updated triggers.....

  • Maul
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Maul
    • Actions
      • -------- ------------------------------------------------------------------------------------------------- --------
      • -------- Getting the Spell constants --------
      • -------- ------------------------------------------------------------------------------------------------- --------
      • Set Temp_Unit = (Triggering unit)
      • Set Temp_Target = (Target unit of ability being cast)
      • Set TempPlayer = (Owner of Temp_Unit)
      • Set Temp_Location = (Position of Temp_Target)
      • Set TempAbility = Maul Stun (Dummy Ability)
      • -------- ------------------------------------------------------------------------------------------------- --------
      • -------- Setting the Spell values --------
      • -------- ------------------------------------------------------------------------------------------------- --------
      • Set Temp_Stats = (Strength of Temp_Unit (Include bonuses))
      • Set Temp_Ability_Level = (Level of (Ability being cast) for Temp_Unit)
      • Set Temp_Value = (40.00 x (Real(Temp_Ability_Level)))
      • Set Temp_Value_2 = (10.00 x (Real(Temp_Ability_Level)))
      • Set Temp_Total_Value = (Temp_Value + (0.25 x (Real(Temp_Stats))))
      • -------- ------------------------------------------------------------------------------------------------- --------
      • -------- Damage the target --------
      • -------- ------------------------------------------------------------------------------------------------- --------
      • Unit - Cause Temp_Unit to damage Temp_Target, dealing Temp_Total_Value damage of attack type Normal and damage type Normal
      • Unit - Set life of Temp_Unit to ((Life of Temp_Unit) + Temp_Value_2)
      • -------- ------------------------------------------------------------------------------------------------- --------
      • -------- Stuns the target at 3rd cast --------
      • -------- ------------------------------------------------------------------------------------------------- --------
      • Set TempInteger1 = (Custom value of DamageEventSource)
      • Set Maul_Count[TempInteger1] = (Maul_Count[TempInteger1] + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Maul_Count[TempInteger1] Equal to 3
        • Then - Actions
          • Unit - Create 1 Dummy Unit for TempPlayer at Temp_Location facing Default building facing degrees
          • Set Temp_Dummy = (Last created unit)
          • Unit - Add a 1.50 second Generic expiration timer to Temp_Dummy
          • Unit - Add TempAbility to Temp_Dummy
          • Unit - Set level of TempAbility for Temp_Dummy to Temp_Ability_Level
          • Unit - Order Temp_Dummy to Neutral - Hurl Boulder Temp_Target
          • Set Maul_Count[TempInteger1] = 0
          • Custom script: call RemoveLocation(udg_Temp_Location)
        • Else - Actions
  • Fury
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • IsDamageSpell Equal to False
      • (Level of Fury for DamageEventSource) Greater than 0
    • Actions
      • Set Temp_Stats = (Intelligence of DamageEventSource (Include bonuses))
      • Set Temp_Ability_Level = (Level of Fury for DamageEventSource)
      • Set Temp_Value = (10.00 x (Real(Temp_Ability_Level)))
      • Set Temp_Total_Value = (Temp_Value + (0.00 x (Real(Temp_Stats))))
      • Set TempInteger1 = (Custom value of DamageEventSource)
      • Set Berserk_Count[TempInteger1] = (Berserk_Count[TempInteger1] + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Berserk_Count[TempInteger1] Equal to 3
        • Then - Actions
          • Unit - Set life of DamageEventSource to (Real(((Integer((Life of DamageEventSource))) + (Integer(Temp_Total_Value)))))
          • Set Berserk_Count[TempInteger1] = 0
        • Else - Actions
The problem is that the Fury Trigger still stacks with the Maul Trigger. If Maul ability is cast and followed by 2 attacks, it will heal the hero. I think it has something to do with the Temp Integer variable or maybe the unique value is the same in both triggers? Need help guys :vw_sad:
 
Level 13
Joined
Aug 19, 2014
Messages
1,111
Here I've changed it to Temp_Unit now. The bug hasn't been fixed though, I guess I'm really not good with triggers :vw_sad:

  • Maul
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Maul
    • Actions
      • -------- ------------------------------------------------------------------------------------------------- --------
      • -------- Getting the Spell constants --------
      • -------- ------------------------------------------------------------------------------------------------- --------
      • Set Temp_Unit = (Triggering unit)
      • Set Temp_Target = (Target unit of ability being cast)
      • Set TempPlayer = (Owner of Temp_Unit)
      • Set Temp_Location = (Position of Temp_Target)
      • Set TempAbility = Maul Stun (Dummy Ability)
      • -------- ------------------------------------------------------------------------------------------------- --------
      • -------- Setting the Spell values --------
      • -------- ------------------------------------------------------------------------------------------------- --------
      • Set Temp_Stats = (Strength of Temp_Unit (Include bonuses))
      • Set Temp_Ability_Level = (Level of (Ability being cast) for Temp_Unit)
      • Set Temp_Value = (40.00 x (Real(Temp_Ability_Level)))
      • Set Temp_Value_2 = (10.00 x (Real(Temp_Ability_Level)))
      • Set Temp_Total_Value = (Temp_Value + (0.25 x (Real(Temp_Stats))))
      • -------- ------------------------------------------------------------------------------------------------- --------
      • -------- Damage the target and heals the caster --------
      • -------- ------------------------------------------------------------------------------------------------- --------
      • Unit - Cause Temp_Unit to damage Temp_Target, dealing Temp_Total_Value damage of attack type Normal and damage type Normal
      • Unit - Set life of Temp_Unit to ((Life of Temp_Unit) + Temp_Value_2)
      • -------- ------------------------------------------------------------------------------------------------- --------
      • -------- Stuns the target at 3rd cast --------
      • -------- ------------------------------------------------------------------------------------------------- --------
      • Set TempInteger1 = (Custom value of Temp_Unit)
      • Set Maul_Count[TempInteger1] = (Maul_Count[TempInteger1] + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Maul_Count[TempInteger1] Equal to 3
        • Then - Actions
          • Unit - Create 1 Dummy Unit for TempPlayer at Temp_Location facing Default building facing degrees
          • Set Temp_Dummy = (Last created unit)
          • Unit - Add a 1.50 second Generic expiration timer to Temp_Dummy
          • Unit - Add TempAbility to Temp_Dummy
          • Unit - Set level of TempAbility for Temp_Dummy to Temp_Ability_Level
          • Unit - Order Temp_Dummy to Neutral - Hurl Boulder Temp_Target
          • Set Maul_Count[TempInteger1] = 0
          • Custom script: call RemoveLocation(udg_Temp_Location)
        • Else - Actions
 
Can you describe in more detail what's happening? So "Fury" is on the unit, and it should only heal on the third attack. If you don't cast Maul, it works normally, but if you cast Maul it counts as a Fury stack... so if you cast Maul 3 times does it heal the unit, too?

Please open Object Manager to its variables tab, then search for the integer array variable called "Berserk_Count" and tell me if there are more than 1 "used by" triggers associated with it. Most likely case is that you have a duplicate trigger in there somewhere that's incrementing the count inadvertently.

If that is not the case, then what you should do is add a game message at the top of the fury trigger saying "fury is running". This will let you know if the trigger is running when it's not supposed to.
 
Level 13
Joined
Aug 19, 2014
Messages
1,111
Can you describe in more detail what's happening? So "Fury" is on the unit, and it should only heal on the third attack. If you don't cast Maul, it works normally, but if you cast Maul it counts as a Fury stack... so if you cast Maul 3 times does it heal the unit, too?

Yeah that's right, Fury heals the hero on his 3rd basic attack. While Maul heals the hero every time he cast this ability and will stun the target enemy on the 3rd cast of this ability. If I cast Maul 3 times the 3rd cast will heal the hero for a higher amount.

Please open Object Manager to its variables tab, then search for the integer array variable called "Berserk_Count" and tell me if there are more than 1 "used by" triggers associated with it. Most likely case is that you have a duplicate trigger in there somewhere that's incrementing the count inadvertently..

I only use Berserk_Count for the Fury Trigger and Maul_Count for the Maul Trigger

If that is not the case, then what you should do is add a game message at the top of the fury trigger saying "fury is running". This will let you know if the trigger is running when it's not supposed to.

Can you show me how to make a game message for the fury trigger?
 
  • Fury
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • IsDamageSpell Equal to False
      • (Level of Fury for DamageEventSource) Greater than 0
    • Actions
      • Game - Display Text Message to (All Players) the text Fury Trigger is Running!
      • Set Temp_Stats = (Intelligence of DamageEventSource (Include bonuses))
      • Set Temp_Ability_Level = (Level of Fury for DamageEventSource)
      • Set Temp_Value = (10.00 x (Real(Temp_Ability_Level)))
      • Set Temp_Total_Value = (Temp_Value + (0.00 x (Real(Temp_Stats))))
      • Set TempInteger1 = (Custom value of DamageEventSource)
      • Set Berserk_Count[TempInteger1] = (Berserk_Count[TempInteger1] + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Berserk_Count[TempInteger1] Equal to 3
        • Then - Actions
          • Unit - Set life of DamageEventSource to (Real(((Integer((Life of DamageEventSource))) + (Integer(Temp_Total_Value)))))
          • Set Berserk_Count[TempInteger1] = 0
        • Else - Actions
 
Level 13
Joined
Aug 19, 2014
Messages
1,111
Indeed Fury Trigger runs :ogre_icwydt: I wonder why :vw_wtf:

Anyway my eyes are tired and I need to get some sleep, I will try to fix the my triggers again tomorrow morning. Thanks a lot Bribe.
 
Ok, that is what I needed to know. I found the problem!

Unit - Cause Temp_Unit to damage Temp_Target, dealing Temp_Total_Value damage of attack type Normal and damage type Normal

^ You are dealing physical damage here. Either change it to deal spell damage or turn off the fury trigger before dealing the damage and turn it on afterward.
 
Level 13
Joined
Aug 19, 2014
Messages
1,111
Now that should fix it :ogre_haosis: Anyway I still want to show the trigger in case what I did was wrong or is there anything that could be improve.

  • Maul
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Maul
    • Actions
      • -------- ------------------------------------------------------------------------------------------------- --------
      • -------- Turn off the Fury Triger --------
      • Trigger - Turn off Fury <gen>
      • -------- ------------------------------------------------------------------------------------------------- --------
      • -------- Getting the Spell constants --------
      • -------- ------------------------------------------------------------------------------------------------- --------
      • Set Temp_Unit = (Triggering unit)
      • Set Temp_Target = (Target unit of ability being cast)
      • Set TempPlayer = (Owner of Temp_Unit)
      • Set Temp_Location = (Position of Temp_Target)
      • Set TempAbility = Maul Stun (Dummy Ability)
      • -------- ------------------------------------------------------------------------------------------------- --------
      • -------- Setting the Spell values --------
      • -------- ------------------------------------------------------------------------------------------------- --------
      • Set Temp_Stats = (Strength of Temp_Unit (Include bonuses))
      • Set Temp_Ability_Level = (Level of (Ability being cast) for Temp_Unit)
      • Set Temp_Value = (40.00 x (Real(Temp_Ability_Level)))
      • Set Temp_Value_2 = (10.00 x (Real(Temp_Ability_Level)))
      • Set Temp_Total_Value = (Temp_Value + (0.25 x (Real(Temp_Stats))))
      • -------- ------------------------------------------------------------------------------------------------- --------
      • -------- Damage the target and heals the caster --------
      • -------- ------------------------------------------------------------------------------------------------- --------
      • Unit - Cause Temp_Unit to damage Temp_Target, dealing Temp_Total_Value damage of attack type Normal and damage type Normal
      • Unit - Set life of Temp_Unit to ((Life of Temp_Unit) + Temp_Value_2)
      • -------- ------------------------------------------------------------------------------------------------- --------
      • -------- Turn on the Fury Triger --------
      • Trigger - Turn on Fury <gen>
      • -------- ------------------------------------------------------------------------------------------------- --------
      • -------- Stuns the target at 3rd cast --------
      • -------- ------------------------------------------------------------------------------------------------- --------
      • Set TempInteger1 = (Custom value of Temp_Unit)
      • Set Maul_Count[TempInteger1] = (Maul_Count[TempInteger1] + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Maul_Count[TempInteger1] Equal to 3
        • Then - Actions
          • Unit - Create 1 Dummy Unit for TempPlayer at Temp_Location facing Default building facing degrees
          • Set Temp_Dummy = (Last created unit)
          • Unit - Add a 1.50 second Generic expiration timer to Temp_Dummy
          • Unit - Add TempAbility to Temp_Dummy
          • Unit - Set level of TempAbility for Temp_Dummy to Temp_Ability_Level
          • Unit - Order Temp_Dummy to Neutral - Hurl Boulder Temp_Target
          • Set Maul_Count[TempInteger1] = 0
          • Custom script: call RemoveLocation(udg_Temp_Location)
        • Else - Actions
I have another trigger that doesn't work, a dummy unit will cast the Unholy Frenzy ability when the hero is hit by a melee attacker. But it doesn't work, anything wrong with the trigger?

  • Toxic Skin
    • Events
      • Game - PDD_damageEventTrigger becomes Equal to 0.00
    • Conditions
      • (PDD_target has buff Toxic Skin) Equal to True
    • Actions
      • Set Temp_Target = (Attacking unit)
      • Set Temp_Location = (Position of PDD_target)
      • Set TempPlayer = (Owner of PDD_target)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Temp_Target is A melee attacker) Equal to True
          • (Temp_Target belongs to an enemy of TempPlayer) Equal to True
          • (Temp_Target is alive) Equal to True
          • (Temp_Target is A structure) Not equal to True
          • (Temp_Target is Magic Immune) Not equal to True
        • Then - Actions
          • Set TempAbility = Toxic Skin (Dummy Ability)
          • Unit - Create 1 Dummy Unit for TempPlayer at Temp_Location facing Default building facing degrees
          • Set Temp_Dummy = (Last created unit)
          • Unit - Add a 1.50 second Generic expiration timer to Temp_Dummy
          • Unit - Add TempAbility to Temp_Dummy
          • Unit - Order Temp_Dummy to Undead Necromancer - Unholy Frenzy Temp_Target
          • Custom script: call RemoveLocation(udg_Temp_Location)
        • Else - Actions
 
Level 13
Joined
Aug 19, 2014
Messages
1,111
Thank for the continuous help Bribe, however I had another trigger problems and I think I will need all the help I can get :ogre_hurrhurr:

Here are the triggers

  • Rock Config
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- --------
      • -------- Variable Creator --------
      • Set Temp_DummyX = 0.00
      • Set Temp_DummyY = 0.00
      • Set Rock_DistanceCounter[0] = 0.00
      • Set Rock_Angle[0] = 0.00
      • -------- --------
      • -------- --------
      • -------- --------
      • -------- CONFIGURATION --------
      • -------- --------
      • -------- Ability being casted --------
      • Set TempAbility = Rock Throw
      • -------- --------
      • -------- Rock Dummy --------
      • Set Temp_UnitType = Rock Dummy
      • -------- --------
      • -------- Duumy Ability --------
      • Set Temp_Dummy_Ability = Hurl Boulder
      • -------- --------
      • -------- Special Effect --------
      • Set Temp_Effect = war3mapImported\Substitute_v2.mdl
      • Set Temp_Effect_2 = none
      • -------- --------
      • -------- Rock size --------
      • Set Rock_Size[1] = 200.00
      • Set Rock_Size[2] = 200.00
      • Set Rock_Size[3] = 200.00
      • Set Rock_Size[4] = 200.00
      • Set Rock_Size[5] = 200.00
      • -------- --------
      • -------- Rock Transparency --------
      • Set Rock_Transparency[1] = 0.00
      • Set Rock_Transparency[2] = 0.00
      • Set Rock_Transparency[3] = 0.00
      • -------- --------
      • -------- Rock Color --------
      • -------- Color Red --------
      • Set Rock_Color[1] = 100.00
      • -------- Color Green --------
      • Set Rock_Color[2] = 100.00
      • -------- Color Blue --------
      • Set Rock_Color[3] = 100.00
      • -------- --------
      • -------- The radius --------
      • Set Rock_Radius[1] = 250.00
      • Set Rock_Radius[2] = 250.00
      • Set Rock_Radius[3] = 250.00
      • Set Rock_Radius[4] = 250.00
      • Set Rock_Radius[5] = 250.00
      • -------- --------
      • -------- Impact damage on the radius --------
      • Set Rock_ImpactDamage[1] = 100.00
      • Set Rock_ImpactDamage[2] = 200.00
      • Set Rock_ImpactDamage[3] = 300.00
      • Set Rock_ImpactDamage[4] = 300.00
      • Set Rock_ImpactDamage[5] = 300.00
      • -------- --------
      • -------- The height of the rock when thrown --------
      • Set Rock_MaxHeight[1] = 300.00
      • Set Rock_MaxHeight[2] = 300.00
      • Set Rock_MaxHeight[3] = 300.00
      • Set Rock_MaxHeight[4] = 300.00
      • Set Rock_MaxHeight[5] = 300.00
      • -------- --------
      • -------- The speed of the rock --------
      • Set Rock_Speed[1] = 20.00
      • Set Rock_Speed[2] = 20.00
      • Set Rock_Speed[3] = 20.00
      • Set Rock_Speed[4] = 20.00
      • Set Rock_Speed[5] = 20.00
      • -------- --------
      • -------- Attack Type & Damage Type --------
      • Set Temp_AttackType = Normal
      • Set Temp_DamageType = Normal
      • -------- --------
      • -------- END OF CONFIGURATION --------
  • Rock Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to TempAbility
    • Actions
      • -------- --------
      • Custom script: local real x
      • Custom script: local real y
      • -------- --------
      • Custom script: local real Temp_SQX
      • Custom script: local real Temp_SQY
      • -------- --------
      • Custom script: local real spellX = GetSpellTargetX ( )
      • Custom script: local real spellY = GetSpellTargetY ( )
      • -------- --------
      • -------- Turning On the Core. --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempInteger1 Equal to 0
        • Then - Actions
          • Trigger - Turn on Rock Loop <gen>
        • Else - Actions
      • -------- --------
      • -------- Setup Settings. --------
      • Set TempInteger1 = (TempInteger1 + 1)
      • Set Rock_Caster[TempInteger1] = (Triggering unit)
      • Set Rock_Level[TempInteger1] = (Level of TempAbility for Rock_Caster[TempInteger1])
      • -------- --------
      • -------- Construct Duo Coordinates. --------
      • Custom script: set x = GetUnitX ( udg_Rock_Caster [ udg_TempInteger1 ] )
      • Custom script: set y = GetUnitY ( udg_Rock_Caster [ udg_TempInteger1 ] )
      • -------- --------
      • -------- Construct Dummy. --------
      • Custom script: set udg_Rock_Dummy [ udg_TempInteger1 ] = CreateUnit ( GetTriggerPlayer ( ) , udg_Temp_UnitType , x , y, 0 )
      • Animation - Change Rock_Dummy[TempInteger1]'s size to (Rock_Size[Rock_Level[TempInteger1]]%, 0.00%, 0.00%) of its original size
      • Special Effect - Create a special effect attached to the chest of Rock_Dummy[TempInteger1] using Temp_Effect
      • Set Rock_EffectHandler[TempInteger1] = (Last created special effect)
      • -------- --------
      • -------- Construct Formulas. --------
      • Custom script: set Temp_SQX = ( spellX - x )
      • Custom script: set Temp_SQY = ( spellY - y )
      • Custom script: set udg_Rock_DistanceCounter [ udg_TempInteger1 ] = SquareRoot( Temp_SQX * Temp_SQX + Temp_SQY * Temp_SQY )
      • Custom script: set udg_Rock_Angle [ udg_TempInteger1 ] = Atan2 ( Temp_SQY, Temp_SQX )
      • -------- --------
      • -------- Construct Counters. --------
      • Custom script: set udg_Rock_CurrentSpeed [ udg_TempInteger1 ] = 0.00
      • -------- --------
  • Rock Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Custom script: local real p
      • Custom script: local real p2
      • Custom script: local real p3
      • Custom script: local real mx
      • Custom script: local real my
      • -------- --------
      • -------- The Core. --------
      • For each (Integer Temp_CurrentIndex) from 1 to TempInteger1, do (Actions)
        • Loop - Actions
          • Game - Display to (All players) the text: Rock Loop is Runnin...
          • -------- --------
          • -------- Construct Dummy Coordinates --------
          • Custom script: set udg_Temp_DummyX= GetUnitX ( udg_Rock_Dummy [ udg_Temp_CurrentIndex ] )
          • Custom script: set udg_Temp_DummyY = GetUnitY ( udg_Rock_Dummy [ udg_Temp_CurrentIndex ] )
          • -------- --------
          • -------- Setup Movement --------
          • Custom script: set mx = udg_Temp_DummyX + udg_Rock_Speed [ udg_Rock_Level [ udg_Temp_CurrentIndex ] ] * Cos ( udg_Rock_Angle [ udg_Temp_CurrentIndex ] )
          • Custom script: set my = udg_Temp_DummyY + udg_Rock_Speed [ udg_Rock_Level [ udg_Temp_CurrentIndex ] ] * Sin ( udg_Rock_Angle [ udg_Temp_CurrentIndex ] )
          • -------- --------
          • -------- Construct Parabola --------
          • Custom script: set udg_Rock_CurrentSpeed [ udg_Temp_CurrentIndex ] = udg_Rock_CurrentSpeed [ udg_Temp_CurrentIndex ] + udg_Rock_Speed [ udg_Rock_Level [ udg_Temp_CurrentIndex ] ]
          • Custom script: set p = ( 4.00 * udg_Rock_MaxHeight [ udg_Rock_Level [ udg_Temp_CurrentIndex ] ] / udg_Rock_DistanceCounter [ udg_Temp_CurrentIndex ] )
          • Custom script: set p2 = ( udg_Rock_DistanceCounter [ udg_Temp_CurrentIndex ] - udg_Rock_CurrentSpeed [ udg_Temp_CurrentIndex ] )
          • Custom script: set p3 = ( p * p2 * ( udg_Rock_CurrentSpeed [ udg_Temp_CurrentIndex ] / udg_Rock_DistanceCounter [ udg_Temp_CurrentIndex ] ) )
          • Custom script: call SetUnitFlyHeight ( udg_Rock_Dummy [ udg_Temp_CurrentIndex ], p3 , 0.00 )
          • -------- --------
          • -------- Construct Movement --------
          • Custom script: call SetUnitX ( udg_Rock_Dummy [ udg_Temp_CurrentIndex ] , mx )
          • Custom script: call SetUnitY ( udg_Rock_Dummy [ udg_Temp_CurrentIndex ] , my )
          • -------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Rock_CurrentSpeed[Temp_CurrentIndex] Greater than or equal to Rock_DistanceCounter[Temp_CurrentIndex]
            • Then - Actions
              • -------- --------
              • -------- Construct Explosion Effect --------
              • Special Effect - Destroy Rock_EffectHandler[Temp_CurrentIndex]
              • Custom script: set udg_Temp_EffectScale = udg_Rock_Radius [ udg_Rock_Level [ udg_Temp_CurrentIndex ] ] * .53
              • Animation - Change Rock_Dummy[Temp_CurrentIndex]'s size to (Temp_EffectScale%, 0.00%, 0.00%) of its original size
              • Custom script: call DestroyEffect ( AddSpecialEffectTarget ( udg_Temp_Effect_2 , udg_Rock_Dummy [ udg_Temp_CurrentIndex ] , "origin" ) )
              • -------- --------
              • -------- Construct Area of Effect. --------
              • Set Temp_Location = (Point(Temp_DummyX, Temp_DummyY))
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in (Units within Rock_Radius[Rock_Level[Temp_CurrentIndex]] of Temp_Location) and do (Actions)
                • Loop - Actions
                  • Set Temp_Target = (Picked unit)
                  • -------- --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Temp_Target belongs to an enemy of (Owner of Rock_Caster[Temp_CurrentIndex])) Equal to True
                      • (Temp_Target is alive) Equal to True
                      • (Temp_Target is A structure) Not equal to True
                      • (Temp_Target is Magic Immune) Not equal to True
                      • (Temp_Target is A flying unit) Not equal to True
                    • Then - Actions
                      • -------- --------
                      • -------- Construct Affect Damage --------
                      • Unit - Cause Rock_Caster[Temp_CurrentIndex] to damage Temp_Target, dealing Rock_ImpactDamage[Rock_Level[Temp_CurrentIndex]] damage of attack type Temp_AttackType and damage type Temp_DamageType
                      • -------- --------
                      • -------- Construct Dummy Caster --------
                      • Set Temp_Location_2 = (Position of Temp_Target)
                      • Unit - Create 1 Temp_UnitType for (Owner of Rock_Caster[Temp_CurrentIndex]) at Temp_Location_2 facing Default building facing degrees
                      • Set Temp_Dummy = (Last created unit)
                      • Unit - Add a 1.00 second Generic expiration timer to Temp_Dummy
                      • Unit - Add Temp_Dummy_Ability to Temp_Dummy
                      • Unit - Set level of Temp_Dummy_Ability for Temp_Dummy to Rock_Level[Temp_CurrentIndex]
                      • Unit - Order Temp_Dummy to Neutral - Hurl Boulder Temp_Target
                      • -------- --------
                      • -------- Remove Leaks --------
                      • Custom script: call RemoveLocation ( udg_Temp_Location_2 )
                      • -------- --------
                    • Else - Actions
              • -------- --------
              • -------- Remove Leaks --------
              • Custom script: call RemoveLocation ( udg_Temp_Location )
              • -------- --------
              • -------- Construct Recycle --------
              • Set Rock_Caster[Temp_CurrentIndex] = Rock_Caster[TempInteger1]
              • Set Rock_Angle[Temp_CurrentIndex] = Rock_Angle[TempInteger1]
              • Set Rock_CurrentSpeed[Temp_CurrentIndex] = Rock_CurrentSpeed[TempInteger1]
              • Set Rock_DistanceCounter[Temp_CurrentIndex] = Rock_DistanceCounter[TempInteger1]
              • Set Rock_Dummy[Temp_CurrentIndex] = Rock_Dummy[TempInteger1]
              • Set Rock_EffectHandler[Temp_CurrentIndex] = Rock_EffectHandler[TempInteger1]
              • Set Rock_Level[Temp_CurrentIndex] = Rock_Level[TempInteger1]
              • Set Temp_CurrentIndex = (Temp_CurrentIndex - 1)
              • Set TempInteger1 = (TempInteger1 - 1)
              • -------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • TempInteger1 Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
              • -------- --------
            • Else - Actions
      • -------- --------
These 3 triggers above are used by the ability Rock Throw. The hero will throw a giant rock at the targeted location that will stun and damage enemies. It works fine, but until I made this trigger....

  • Toxic Skin
    • Events
      • Game - PDD_damageEventTrigger becomes Equal to 0.00
    • Conditions
      • (PDD_target has buff Toxic Skin) Equal to True
    • Actions
      • Set Temp_Target = PDD_source
      • Set Temp_Location = (Position of PDD_target)
      • Set TempPlayer = (Owner of PDD_target)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Temp_Target is A melee attacker) Equal to True
          • (Temp_Target belongs to an enemy of TempPlayer) Equal to True
          • (Temp_Target is alive) Equal to True
          • (Temp_Target is A structure) Not equal to True
          • (Temp_Target is Magic Immune) Not equal to True
        • Then - Actions
          • Set TempAbility = Toxic Skin (Dummy Ability)
          • Unit - Create 1 Dummy Unit for TempPlayer at Temp_Location facing Default building facing degrees
          • Set Temp_Dummy = (Last created unit)
          • Unit - Add a 1.50 second Generic expiration timer to Temp_Dummy
          • Unit - Add TempAbility to Temp_Dummy
          • Unit - Order Temp_Dummy to Undead Necromancer - Unholy Frenzy Temp_Target
          • Custom script: call RemoveLocation(udg_Temp_Location)
        • Else - Actions
This trigger will make the dummy cast Unholy Frenzy when a melee unit attacks the hero that has a buff of Toxic Skin.

The problem is that the 3 Rock Triggers stacks with the Toxic Skin Trigger[/B. So when the hero is attacked by a melee attacker, the attacker will have a buff of Unholy Frenzy and will have a giant rock that will fall in his head :ogre_icwydt:

I tried putting a game text message on the Rock Start Trigger and the message occur when the hero is attacked by a melee attacker, proving that the Rock Start Trigger runs. Any ideas why they stack together :vw_wtf:
 
Level 18
Joined
Nov 21, 2012
Messages
835
Rock Config: on map init:
Set TempAbility = Rock Throw

Toxic Skin:
Set TempAbility = Toxic Skin (Dummy Ability)

looks like you overwrite udg_TempAbility

2nd case: I saw you using:
Temp_Target is A melee attacker) Equal to True
be aware that, for example, paladin hero (melee) with orb of frost (can attack air) is not treated as melee, but as ranged.
 
Level 13
Joined
Aug 19, 2014
Messages
1,111
Rock Config: on map init:
Set TempAbility = Rock Throw

Toxic Skin:
Set TempAbility = Toxic Skin (Dummy Ability)

looks like you overwrite udg_TempAbility

So I can't use TempAbility variable more than once?

2nd case: I saw you using:
Temp_Target is A melee attacker) Equal to True
be aware that, for example, paladin hero (melee) with orb of frost (can attack air) is not treated as melee, but as ranged.

I forgot about that, thanks.
 
Level 18
Joined
Nov 21, 2012
Messages
835
Look, you are using this:
  • Rock Start
  • Events
  • Unit - A unit Starts the effect of an ability
  • Conditions
  • (Ability being cast) Equal to TempAbility
You should look into your triggers and search for udg_TempAbility variable. If youre using it multiple times you can unintentionaly overwrite it, and this RockStart trigger will fire when other ability is casted.

btw. You have nice spells ideas, but it is possible to execute it better. Please look at Bribe's spell template http://www.hiveworkshop.com/forums/spells-569/unit-indexer-spell-template-202003/

theoretically imagine that you will make 100 custom spells. Each spell needs, lets say 4 variables. Are you going to create 400 array variables? :D
Instead use something like this:
udg_Spell_Caster[id] for all your spells to refer to caster
udg_Spell_Damage[id] for all your spells to refer to damage value
udg_Spell_Radius[id] for all your spells to refer to some real radius value
etc...
where id is custom value of dummy , a unit you have to create to represent each cast of each spell /unique number/
 
Level 13
Joined
Aug 19, 2014
Messages
1,111
Look, you are using this:
  • Rock Start
  • Events
  • Unit - A unit Starts the effect of an ability
  • Conditions
  • (Ability being cast) Equal to TempAbility
You should look into your triggers and search for udg_TempAbility variable. If youre using it multiple times you can unintentionaly overwrite it, and this RockStart trigger will fire when other ability is casted.

btw. You have nice spells ideas, but it is possible to execute it better. Please look at Bribe's spell template http://www.hiveworkshop.com/forums/spells-569/unit-indexer-spell-template-202003/

theoretically imagine that you will make 100 custom spells. Each spell needs, lets say 4 variables. Are you going to create 400 array variables? :D
Instead use something like this:
udg_Spell_Caster[id] for all your spells to refer to caster
udg_Spell_Damage[id] for all your spells to refer to damage value
udg_Spell_Radius[id] for all your spells to refer to some real radius value
etc...
where id is custom value of dummy , a unit you have to create to represent each cast of each spell /unique number/

So your saying that I can use and share this array variables you've mention on all of my triggers? Should I put a value of 1 in the ID for my 1st trigger and for the upcoming triggers that I would create I will put 2,3 and so on? Or should I put an integer variable instead?
 
Level 13
Joined
Aug 19, 2014
Messages
1,111
I see the Rock Triggers are not MUI then. If I were to put a variable to get the custom value of the dummy unit, it will be like this?

Set Temp_Unit = (Last created unit)
Set TempInteger1 = (Custom value of Temp_Unit)
Spell_Caster[TempInteger1]
Spell_Damage[TempInteger1]
Spell_Radius[TempInteger1]

If this is right, can I use these array variables in all of my triggers and the TempInteger1 variable also?
 
Status
Not open for further replies.
Top