• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

fix my trigger

Status
Not open for further replies.
Level 3
Joined
Sep 30, 2011
Messages
60
could someone fix my trigger:

  • Chibaku Tensei
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Chibaku Tensei
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • H_Index Equal to 0
        • Then - Actions
          • Trigger - Turn on Chibaku Tensei Loop <gen>
        • Else - Actions
      • Set H_Index = (H_Index + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • H_Index Greater than H_Index_Max
        • Then - Actions
          • Set H_Spell[H_Index] = H_Index
          • Set H_Index_Max = H_Index
        • Else - Actions
      • Set H_Mui = H_Spell[H_Index]
      • Set H_Chibacu[H_Mui] = (Triggering unit)
      • Set H_Cast_Point[H_Mui] = (Target point of ability being cast)
      • Set H_Ability[H_Mui] = Crow Form
      • Unit - Create 1 dummy Chibaku Big Ball for (Owner of H_Chibacu[H_Mui]) at H_Cast_Point[H_Mui] facing Default building facing degrees
      • Set H_BigStone[H_Mui] = (Last created unit)
      • Set H_Stone_Size[H_Mui] = 0
      • Set H_Spell_Last[H_Mui] = 70
      • Set H_Speed1[H_Mui] = 30.00
      • Set H_Speed2[H_Mui] = 10.00
      • Set H_Knockback_Time[H_Mui] = 10
  • Chibaku Tensei
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Chibaku Tensei
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • H_Index Equal to 0
        • Then - Actions
          • Trigger - Turn on Chibaku Tensei Loop <gen>
        • Else - Actions
      • Set H_Index = (H_Index + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • H_Index Greater than H_Index_Max
        • Then - Actions
          • Set H_Spell[H_Index] = H_Index
          • Set H_Index_Max = H_Index
        • Else - Actions
      • Set H_Mui = H_Spell[H_Index]
      • Set H_Chibacu[H_Mui] = (Triggering unit)
      • Set H_Cast_Point[H_Mui] = (Target point of ability being cast)
      • Set H_Ability[H_Mui] = Crow Form
      • Unit - Create 1 dummy Chibaku Big Ball for (Owner of H_Chibacu[H_Mui]) at H_Cast_Point[H_Mui] facing Default building facing degrees
      • Set H_BigStone[H_Mui] = (Last created unit)
      • Set H_Stone_Size[H_Mui] = 0
      • Set H_Spell_Last[H_Mui] = 70
      • Set H_Speed1[H_Mui] = 30.00
      • Set H_Speed2[H_Mui] = 10.00
      • Set H_Knockback_Time[H_Mui] = 10
  • Chibaku Removed
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to dummy Chibaku Big Ball
    • Actions
      • Wait 2.00 seconds
      • Unit - Remove (Triggering unit) from the game
the problem is.. when the enemy died after they got included in the ball they respawn floating.. can someone fix it for me?
(sorry for my bad english)

  • Untitled Trigger 003
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Tavern_Point = (Center of Tavern <gen>)
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Hero Picker for (Player((Integer A))) at Tavern_Point facing Default building facing degrees
  • Anti Teamkill
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacked unit) belongs to an ally of (Owner of (Attacking unit))) Equal to True
    • Actions
      • Unit - Order (Attacking unit) to Stop
  • Rinnegan
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Rinnegan
      • (Unit-type of (Triggering unit)) Equal to Deva Path
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Rinnegan for (Triggering unit)) Equal to 1
        • Then - Actions
          • Unit - Add Rinnegan Spell Shield (Amulet) to (Triggering unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Rinnegan for (Triggering unit)) Equal to 2
            • Then - Actions
              • Unit - Increase level of Rinnegan Spell Shield (Amulet) for (Triggering unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Rinnegan for (Triggering unit)) Equal to 3
                • Then - Actions
                  • Unit - Increase level of Rinnegan Spell Shield (Amulet) for (Triggering unit)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Rinnegan for (Triggering unit)) Equal to 4
                    • Then - Actions
                      • Unit - Increase level of Rinnegan Spell Shield (Amulet) for (Triggering unit)
                    • Else - Actions
  • Untitled Trigger 006
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • ((Sold unit) is A Hero) Equal to True
    • Actions
      • Unit - Remove (Buying unit) from the game

thanks
 
Level 3
Joined
Sep 30, 2011
Messages
60
1. I don't understand why you've posted the same trigger twice?
my bad..
  • Chibaku Tensei
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Chibaku Tensei
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • H_Index Equal to 0
        • Then - Actions
          • Trigger - Turn on Chibaku Tensei Loop <gen>
        • Else - Actions
      • Set H_Index = (H_Index + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • H_Index Greater than H_Index_Max
        • Then - Actions
          • Set H_Spell[H_Index] = H_Index
          • Set H_Index_Max = H_Index
        • Else - Actions
      • Set H_Mui = H_Spell[H_Index]
      • Set H_Chibacu[H_Mui] = (Triggering unit)
      • Set H_Cast_Point[H_Mui] = (Target point of ability being cast)
      • Set H_Ability[H_Mui] = Crow Form
      • Unit - Create 1 dummy Chibaku Big Ball for (Owner of H_Chibacu[H_Mui]) at H_Cast_Point[H_Mui] facing Default building facing degrees
      • Set H_BigStone[H_Mui] = (Last created unit)
      • Set H_Stone_Size[H_Mui] = 0
      • Set H_Spell_Last[H_Mui] = 70
      • Set H_Speed1[H_Mui] = 30.00
      • Set H_Speed2[H_Mui] = 10.00
      • Set H_Knockback_Time[H_Mui] = 10
  • Chibaku Tensei Loop
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • For each (Integer H_Loop) from 1 to H_Index, do (Actions)
        • Loop - Actions
          • Set H_Mui = H_Spell[H_Loop]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • H_Spell_Last[H_Mui] Greater than 0
            • Then - Actions
              • Set H_Spell_Last[H_Mui] = (H_Spell_Last[H_Mui] - 1)
              • For each (Integer A) from 1 to 4, do (Actions)
                • Loop - Actions
                  • Set H_RandomNumber[H_Mui] = (Random real number between 1.00 and 800.00)
                  • Set H_Angle[H_Mui] = (Random real number between 1.00 and 360.00)
                  • Set H_Stones_Create[H_Mui] = (H_Cast_Point[H_Mui] offset by H_RandomNumber[H_Mui] towards H_Angle[H_Mui] degrees)
                  • Unit - Create 1 dummy Chibaku Tensei Small Ball for (Owner of H_Chibacu[H_Mui]) at H_Stones_Create[H_Mui] facing H_Cast_Point[H_Mui]
                  • Set H_Small_Stone[H_Mui] = (Last created unit)
                  • Animation - Change H_Small_Stone[H_Mui] flying height to 700.00 at 800.00
                  • Unit - Order H_Small_Stone[H_Mui] to Move To H_Cast_Point[H_Mui]
                  • Custom script: call RemoveLocation(udg_H_Stones_Create[udg_H_Mui])
              • Set H_Stone_Size[H_Mui] = (H_Stone_Size[H_Mui] + 21)
              • Animation - Change H_BigStone[H_Mui]'s size to ((Real(H_Stone_Size[H_Mui]))%, (Real(H_Stone_Size[H_Mui]))%, (Real(H_Stone_Size[H_Mui]))%) of its original size
              • Set H_PickUpGroup[H_Mui] = (Units within 600.00 of H_Cast_Point[H_Mui] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of H_Chibacu[H_Mui])) Equal to True))))
              • Unit Group - Pick every unit in H_PickUpGroup[H_Mui] and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) is in H_KnockBackGroup[H_Mui]) Equal to False
                    • Then - Actions
                      • Set H_Picked_Unit[H_Mui] = (Picked unit)
                      • Unit - Pause H_Picked_Unit[H_Mui]
                      • Unit Group - Add H_Picked_Unit[H_Mui] to H_KnockBackGroup[H_Mui]
                      • Unit - Add H_Ability[H_Mui] to H_Picked_Unit[H_Mui]
                      • Unit - Turn collision for H_Picked_Unit[H_Mui] Off
                      • Animation - Change H_Picked_Unit[H_Mui] flying height to 700.00 at 500.00
                    • Else - Actions
                  • Set H_Pickedunit2[H_Mui] = (Picked unit)
                  • Set H_Picked_Point[H_Mui] = (Position of H_Pickedunit2[H_Mui])
                  • Set H_Move[H_Mui] = (H_Picked_Point[H_Mui] offset by H_Speed2[H_Mui] towards (Angle from H_Picked_Point[H_Mui] to H_Cast_Point[H_Mui]) degrees)
                  • Unit - Move H_Pickedunit2[H_Mui] instantly to H_Move[H_Mui]
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Distance between H_Picked_Point[H_Mui] and H_Cast_Point[H_Mui]) Less than or equal to 100.00
                    • Then - Actions
                      • Unit - Hide H_Pickedunit2[H_Mui]
                    • Else - Actions
                  • Custom script: call RemoveLocation(udg_H_Picked_Point[udg_H_Mui])
                  • Custom script: call RemoveLocation(udg_H_Move[udg_H_Mui])
              • Custom script: call DestroyGroup(udg_H_PickUpGroup[udg_H_Mui])
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • H_Knockback_Time[H_Mui] Greater than 0
                • Then - Actions
                  • Set H_Knockback_Time[H_Mui] = (H_Knockback_Time[H_Mui] - 1)
                  • Unit Group - Pick every unit in H_KnockBackGroup[H_Mui] and do (Actions)
                    • Loop - Actions
                      • Set H_Pickedunit2[H_Mui] = (Picked unit)
                      • Unit - Unhide H_Pickedunit2[H_Mui]
                      • Set H_Point1[H_Mui] = (Position of H_Pickedunit2[H_Mui])
                      • Set H_Point2[H_Mui] = (H_Point1[H_Mui] offset by H_Speed1[H_Mui] towards (Angle from H_Cast_Point[H_Mui] to H_Point1[H_Mui]) degrees)
                      • Unit - Move H_Pickedunit2[H_Mui] instantly to H_Point2[H_Mui]
                      • Custom script: call RemoveLocation(udg_H_Point1[udg_H_Mui])
                      • Custom script: call RemoveLocation(udg_H_Point2[udg_H_Mui])
                • Else - Actions
                  • Unit - Kill H_BigStone[H_Mui]
                  • Set H_StonesRemove[H_Mui] = (Units of type dummy Chibaku Tensei Small Ball)
                  • Unit Group - Pick every unit in H_StonesRemove[H_Mui] and do (Actions)
                    • Loop - Actions
                      • Set H_Small_Stone[H_Mui] = (Picked unit)
                      • Unit - Remove H_Small_Stone[H_Mui] from the game
                  • Unit Group - Pick every unit in H_KnockBackGroup[H_Mui] and do (Actions)
                    • Loop - Actions
                      • Set H_unit[H_Mui] = (Picked unit)
                      • Animation - Change H_unit[H_Mui] flying height to 0.00 at 1000.00
                      • Unit - Remove H_Ability[H_Mui] from H_unit[H_Mui]
                      • Unit - Unpause H_unit[H_Mui]
                      • Unit - Turn collision for H_unit[H_Mui] On
                      • Unit - Cause H_Chibacu[H_Mui] to damage H_unit[H_Mui], dealing 500.00 damage of attack type Spells and damage type Normal
                  • Unit Group - Remove all units from H_KnockBackGroup[H_Mui]
                  • Custom script: call RemoveLocation(udg_H_Cast_Point[udg_H_Mui])
                  • Custom script: call DestroyGroup(udg_H_StonesRemove[udg_H_Mui])
                  • Set H_Spell[H_Loop] = H_Spell[H_Index]
                  • Set H_Spell[H_Index] = H_Mui
                  • Set H_Index = (H_Index - 1)
                  • Set H_Loop = (H_Loop - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • H_Index Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions

though I'd change the ITE calls in "Rinnegan" and move the "Unit - Increase level of Rinnegan Spell Shield (Amulet) for (Triggering unit)" into the first ITE in the Else part.
what do you mean?

btw +rep :thumbs_up:
 
Level 19
Joined
Feb 25, 2009
Messages
2,004
Instead of checking every level, just check if its level 1, then add the ability and put the "Unit - Increase level of Rinnegan Spell Shield (Amulet) for (Triggering unit)" into the Else part there, which means if its not level 1 (eg: 2,3,4) it will be increased instead of added.

  • Rinnegan
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Rinnegan
      • (Unit-type of (Triggering unit)) Equal to Deva Path
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Rinnegan for (Triggering unit)) Equal to 1
        • Then - Actions
          • Unit - Add Rinnegan Spell Shield (Amulet) to (Triggering unit)
        • Else - Actions
          • Unit - Increase level of Rinnegan Spell Shield (Amulet) for (Triggering unit)
 
Status
Not open for further replies.
Top