• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Simple Item Drop Trigger Question

Status
Not open for further replies.
Okay, here is my trigger:

  • Drop
    • Events
      • Player - Player 1 (Red) types a chat message containing -drop as An exact match
      • Player - Player 2 (Blue) types a chat message containing -drop as An exact match
      • Player - Player 3 (Teal) types a chat message containing -drop as An exact match
      • Player - Player 4 (Purple) types a chat message containing -drop as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -drop as An exact match
      • Player - Player 6 (Orange) types a chat message containing -drop as An exact match
      • Player - Player 7 (Green) types a chat message containing -drop as An exact match
      • Player - Player 8 (Pink) types a chat message containing -drop as An exact match
      • Player - Player 9 (Gray) types a chat message containing -drop as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -drop as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -drop as An exact match
      • Player - Player 12 (Brown) types a chat message containing -drop as An exact match
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units currently selected by (Triggering player)) and do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Multiple ConditionsOr - Any (Conditions) are true
                • Conditions
                  • ((Picked unit) is A Hero) Equal to (==) True
                  • ((Picked unit) is A ground unit) Equal to (==) True
            • Then - Actions
              • Set tempPoint = (Position of (Picked unit))
                • Do Multiple ActionsFor each (Integer A) from 1 to 6, do (Actions)
                  • Loop - Actions
                    • Hero - Drop the item from slot (Integer A) of (Picked unit)
              • Custom script: call RemoveLocation(udg_tempPoint)
            • Else - Actions

Now I need to know how to make it stop the hero, drop one by one, and play a sound as each item drops, then unfreeze hero.

If you can anwer I will give you +REP.
 
  • Trigger1
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Hashtable - Create a hashtable
    • Set Hashtable = (Last created hashtable)
    • For each (IntegerA) from 1 to 12, do (Actions)
      • Loop - Actions
        • Trigger - Add to Drop <gen> the event (Player - Player (IntegerA) types a chat message containing -drop as An exact match)
  • Drop
  • Events
  • Conditions
  • Actions
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units currently selected by (Triggering player)) and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Or - Any (Conditions) are true
              • ((Picked unit) is A Hero) Equal to True
              • ((Picked unit) is A ground unit) Equal to True
    • Then - Actions
      • Unit Group - Add (Picked unit) to SlotGroup
      • Hashtable - Save 0 as (Key(slotcount)) of (Key(Picked unit)) in Hashtable
      • Trigger - Turn on Drop2 <gen>
  • Drop2
  • Events
    • Time - Every 0.50 seconds of game-time
  • Conditions
  • Actions
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • (SlotGroup is empty) Equal to True
      • Then - Actions
        • Trigger - Turn off (This trigger)
      • Else - Actions
        • Unit Group - Pick every unit in (SlotGroup) and do (Actions)
          • Loop - Actions
            • Set Count = (Load (Key(slotcount)) of (Key(Picked unit)) in Hashtable)
            • If (All conditions are true) then do (Actions) else do (Actions)
              • If - Conditions
                • (Count) Less than or Equal to 6
              • Then - Actions
                • Hashtable - Save (Count + 1) as (Key(slotcount)) of (Key(Picked unit)) in Hashtable
                • Hero - Drop the item from slot Count of (Picked unit)
                • Sound - Play sound at 100% volume, attached to (Picked unit)
              • Else - Actions
                • Unit Group - Remove (Picked unit) from SlotGroup
                • Unit - Unpause (Picked unit)
                • Hashtable - Clear all child hashtables of (Key(Picked unit)) in Hashtable
 
Last edited:
Status
Not open for further replies.
Top