• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Trigger] Detect when a unit drops an item

Status
Not open for further replies.
periodically check items of unit, if there are not item at hero then its dropped

  • drop
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • HeroItem[(Integer A)] Not Equal (Item carried by MyUnit in slot (Integer A))
                  • (MyUnit has HeroItem[(Integer A)]) Equals Not
            • Then - Actions
              • Game - Display to (All players) the text: (Name of HeroItem[(Integer A)])
            • Else - Actions
          • Set HeroItem[(Integer A)] = (Item carried by MyUnit in slot (Integer A))
 
Okay, the event is registered like this along with sells and pawns an item (those two work - same trigger):

  • Trigger - Add to The Perfect Clone Item Mod <gen> the event (Unit - (Triggering unit) Loses an item)
This is the actual trigger:

  • The Perfect Clone Item Mod
    • Events
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Hero - Drop the item from slot (Integer A) of ThePerfectClone[(Player number of (Owner of (Triggering unit)))]
          • Item - Remove (Last dropped item)
          • Item - Create (Item-type of (Item carried by (Triggering unit) in slot (Integer A))) at (Position of ThePerfectClone[(Player number of (Owner of (Triggering unit)))])
          • Item - Make (Last created item) Undroppable
          • Hero - Give (Last created item) to ThePerfectClone[(Player number of (Owner of (Triggering unit)))]
And yes, I'm aware of the leaks, but I won't fix those until this actually works.
 
Status
Not open for further replies.
Back
Top