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

[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))
 
Level 22
Joined
Feb 3, 2009
Messages
3,292
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.
Top