• 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.

[Trigger] Unit didn't use items

Status
Not open for further replies.
Level 10
Joined
Jun 1, 2008
Messages
485
I make a spell. This spell create an illusion of caster that appearing one by one. When caster attacked, it shuffle the caster to random illusion.

I've finish the spell, it work well. but when i make it to MUI, the dummy didn't use the item that create illusion of caster. this is the trigger

  • Domino Theory Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Domino Theory
    • Actions
      • Set domino_caster = (Triggering unit)
      • Set domino_point = (Position of domino_caster)
      • Set domino_lvl = ((Level of Domino Theory for domino_caster) + 1)
      • Set domino_player = (Triggering player)
      • If ((Execution count of (This trigger)) Not equal to (!=) 1) then do (Custom script: set udg_domino_unit = CreateGroup()) else do (Custom script: //Do Nothing)
      • Unit Group - Add domino_caster to domino_unit
      • Unit - Add Domino Theory to domino_caster
      • Unit - Create 1 Dummy Unit for domino_player at domino_point facing Default building facing (270.0) degrees
      • Custom script: call RemoveLocation(udg_domino_point)
      • Set domino_dummy = (Last created unit)
      • Hero - Create Domino Theory and give it to domino_dummy
        • Do Multiple ActionsFor each (Integer A) from 1 to domino_lvl, do (Actions)
          • Loop - Actions
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (domino_caster is dead) Equal to (==) True
              • Then - Actions
                • Trigger - Run Domino Theory End <gen> (ignoring conditions)
                • Skip remaining actions
              • Else - Actions
            • Hero - Order domino_dummy to use (Item carried by domino_dummy of type Domino Theory) on domino_caster
            • Wait 0.50 seconds
      • Unit Group - Pick every unit in (Units owned by domino_player matching (((Matching unit) is an illusion) Equal to (==) True)) and do (Actions)
        • Loop - Actions
          • Unit Group - Add (Picked unit) to domino_unit
          • Unit - Add a (10.00 + ((Real(domino_lvl)) + 0.50)) second Generic expiration timer to (Picked unit)
          • Unit - Add Domino Theory to (Picked unit)
      • Wait (10.00 + ((Real(domino_lvl)) + 0.50)) seconds
      • Trigger - Run Domino Theory End <gen> (ignoring conditions)
  • Domino Theory Scramble
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • Multiple ConditionsAnd - All (Conditions) are true
        • Conditions
          • (Attacked unit) Equal to (==) domino_caster
          • ((Attacked unit) has buff Domino Theory ) Equal to (==) True
    • Actions
      • Set domino_scramble_attack = (Attacked unit)
      • Set domino_scramble_target = (Random unit from domino_unit)
      • If ((domino_scramble_target Equal to (==) domino_scramble_attack) or ((domino_scramble_target is dead) Equal to (==) True)) then do (Skip remaining actions) else do (Custom script: //Do Nothing)
      • Set domino_scramble_attack_point = (Position of domino_scramble_attack)
      • Set domino_scramble_target_point = (Position of domino_scramble_target)
      • Unit - Turn collision for domino_scramble_attack Off
      • Unit - Turn collision for domino_scramble_target Off
      • Unit - Move domino_scramble_target instantly to domino_scramble_attack_point
      • Unit - Move domino_scramble_attack instantly to domino_scramble_target_point
      • Unit - Turn collision for domino_scramble_attack On
      • Unit - Turn collision for domino_scramble_target On
      • Custom script: call RemoveLocation(udg_domino_scramble_attack_point)
      • Custom script: call RemoveLocation(udg_domino_scramble_target_point)
  • Domino Theory End
    • Events
    • Conditions
    • Actions
      • Unit - Remove Domino Theory from domino_caster
      • Item - Remove domino_item
      • Unit - Remove domino_dummy from the game
      • Set domino_caster = No unit
      • Set domino_dummy = No unit
      • Set domino_lvl = 0
      • Set domino_item = No item
      • Custom script: set udg_domino_player = null
      • Custom script: call DestroyGroup(udg_domino_unit)


  • MUI Integer
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • ((Triggering unit) is an illusion) Equal to (==) False
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Custom value of (Triggering unit)) Less than (<) 1
        • Then - Actions
          • Set MUI_Integer = (MUI_Integer + 1)
          • Unit - Set the custom value of (Triggering unit) to MUI_Integer
          • Game - Display to (All players) the text: (MUI + (String(MUI_Integer)))
        • Else - Actions
  • Domino Theory Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Domino Theory
    • Actions
      • -------- Spell Initilization --------
      • Set DT_Illusion[(Custom value of (Triggering unit))] = 0
      • Set DT_Check[(Custom value of (Triggering unit))] = False
      • Set DT_Caster[(Custom value of (Triggering unit))] = (Triggering unit)
      • Set DT_Loc[(Custom value of (Triggering unit))] = (Position of DT_Caster[(Custom value of (Triggering unit))])
      • Set DT_Lvl[(Custom value of (Triggering unit))] = (Level of Domino Theory for DT_Caster[(Custom value of (Triggering unit))])
      • Set DT_Player = (Owner of (Triggering unit))
      • If ((Execution count of (This trigger)) Not equal to (!=) 1) then do (Set DT_Unit[(Custom value of (Triggering unit))] = (CreateGroup())) else do (Custom script: //Do Nothing)
      • Set DT_Casted = (DT_Casted + 1)
      • Unit - Add Domino Theory to DT_Caster[(Custom value of (Triggering unit))]
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • DT_Casted Equal to (==) 1
          • Then - Actions
            • Trigger - Turn on Domino Theory Create Illusion <gen>
            • Trigger - Run Domino Theory Create Illusion <gen> (ignoring conditions)
          • Else - Actions
      • -------- Setting Dummy --------
      • Unit - Create 1 DT_Unit for DT_Player at DT_Loc[(Custom value of (Triggering unit))] facing Default building facing (270.0) degrees
      • Set DT_Dummy[(Custom value of (Triggering unit))] = (Last created unit)
      • Unit - Create 1 Timer Unit for DT_Player at DT_Loc[(Custom value of (Triggering unit))] facing Default building facing (270.0) degrees
      • Unit - Add a (10.00 + ((Real(DT_Lvl[(Custom value of (Triggering unit))])) + 0.50)) second Generic expiration timer to (Last created unit)
      • Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
      • Custom script: call RemoveLocation(udg_DT_Loc[GetUnitUserData(GetTriggerUnit())])
      • Game - Display to (All players) the text: (Cast + ((Name of DT_Caster[(Custom value of (Triggering unit))]) + (String((Custom value of (Triggering unit))))))
      • Game - Display to (All players) the text: (Cast + ((Name of DT_Dummy[(Custom value of (Triggering unit))]) + (String((Custom value of (Triggering unit))))))
  • Domino Theory Create Illusion
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Do Multiple ActionsFor each (Integer A) from 1 to MUI_Integer, do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DT_Check[DT_Int] Equal to (==) False
            • Then - Actions
              • Game - Display to (All players) the text: ((String(DT_Lvl[DT_Int])) + ((Name of DT_Dummy[DT_Int]) + ((Name of DT_Caster[DT_Int]) + ((String(DT_Illusion[DT_Int])) + (String(DT_Int))))))
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • DT_Illusion[DT_Int] Less than (<) (DT_Lvl[DT_Int] + 1)
                  • Then - Actions
                    • Hero - Order DT_Dummy[DT_Int] to use (Item carried by DT_Dummy[DT_Int] of type Domino Theory) on DT_Caster[DT_Int]
                    • Game - Display to (All players) the text: (Order + ((Name of DT_Dummy[DT_Int]) + ((Name of DT_Item[DT_Int]) + (String(DT_Int)))))
                  • Else - Actions
                    • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • DT_Illusion[DT_Int] Equal to (==) (DT_Lvl[DT_Int] + 1)
                      • Then - Actions
                        • Unit Group - Pick every unit in (Units owned by (Owner of DT_Caster[DT_Int]) matching (((Matching unit) is an illusion) Equal to (==) True)) and do (Actions)
                          • Loop - Actions
                            • Unit Group - Add (Picked unit) to DT_Unit[(Custom value of (Triggering unit))]
                            • Unit - Add a (10.00 + ((Real(DT_Lvl[(Custom value of (Triggering unit))])) + 0.50)) second Generic expiration timer to (Picked unit)
                            • Unit - Add Domino Theory to (Picked unit)
                        • Set DT_Illusion[DT_Int] = (DT_Illusion[DT_Int] + 1)
                      • Else - Actions
                        • Set DT_Check[DT_Int] = True
                        • Trigger - Run Domino Theory End <gen> (ignoring conditions)
            • Else - Actions
  • Domino Theory Scramble
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacked unit) has buff Domino Theory ) Equal to (==) True
      • DT_Check[(Custom value of (Attacked unit))] Equal to (==) False
    • Actions
      • Set DT_Scramble_Attack = (Attacked unit)
      • Set DT_Scramble_Target = (Random unit from DT_Unit[(Custom value of (Triggering unit))])
      • Set DT_Scramble_Attack_Loc = (Position of DT_Scramble_Attack)
      • Set DT_Scramble_Target_Loc = (Position of DT_Scramble_Target)
      • Unit - Turn collision for DT_Scramble_Attack Off
      • Unit - Turn collision for DT_Scramble_Target Off
      • Unit - Move DT_Scramble_Target instantly to DT_Scramble_Attack_Loc
      • Unit - Move DT_Scramble_Attack instantly to DT_Scramble_Target_Loc
      • Unit - Turn collision for DT_Scramble_Attack On
      • Unit - Turn collision for DT_Scramble_Target On
      • Custom script: call RemoveLocation(udg_DT_Scramble_Attack_Loc)
      • Custom script: call RemoveLocation(udg_DT_Scramble_Target_Loc)
  • Domino Theory Check
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to (==) Timer Unit
    • Actions
      • Game - Display to (All players) the text: (Dies + ((Name of (Dying unit)) + (String((Custom value of (Dying unit))))))
      • Set DT_Check[(Custom value of (Dying unit))] = True
      • Trigger - Run Domino Theory End <gen> (ignoring conditions)
  • Domino Theory End
    • Events
    • Conditions
    • Actions
      • Do Multiple ActionsFor each (Integer DT_Int) from 1 to MUI_Integer, do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DT_Check[DT_Int] Equal to (==) True
            • Then - Actions
              • Unit - Remove Domino Theory from DT_Caster[DT_Int]
              • Item - Remove DT_Item[DT_Int]
              • Unit - Remove DT_Dummy[DT_Int] from the game
              • Set DT_Caster[DT_Int] = No unit
              • Set DT_Caster[DT_Int] = No unit
              • Set DT_Lvl[DT_Int] = 0
              • Set DT_Item[DT_Int] = No item
              • Custom script: call DestroyGroup(udg_DT_Unit[udg_DT_Int])
              • Game - Display to (All players) the text: (End + (String(DT_Int)))
              • Set DT_Casted = (DT_Casted - 1)
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • DT_Casted Less than or equal to (<=) 0
                  • Then - Actions
                    • Trigger - Turn off Domino Theory Create Illusion <gen>
                  • Else - Actions
            • Else - Actions
ok, the delay between each illusion is 0,5. can anybody help me?

P.S: I'm also attach the map. I use Tinki3 Spell Template
 

Attachments

  • Spell Illusion Scramble.w3x
    48 KB · Views: 38
  • Spell Illusion Scramble MUI.w3x
    51.2 KB · Views: 24
Status
Not open for further replies.
Top