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

Item Auto Destroy

Status
Not open for further replies.
Level 11
Joined
Jun 20, 2009
Messages
880
So i need this kind of system:

If Item is dropped, it will be automatically destroyed after 7 seconds if not picked.

Here's what i've done so far:

  • Murgul Scout Drop
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Mur'gul Scout
    • Actions
      • Set TempLoc = (Position of (Triggering unit))
      • Item - Create Skull Shield at TempLoc
      • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at (Center of (Playable map area)) facing Default building facing degrees
      • Unit - Add a 7.00 second Generic expiration timer to (Last created unit)
      • Hashtable - Save Handle Of(Triggering unit) as 0 of (Key (Last created unit)) in Hash
      • Hashtable - Save Handle Of(Last created item) as 1 of (Key (Last created unit)) in Hash
      • Custom script: call RemoveLocation(udg_TempLoc)
  • Destroy Items
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Dummy
    • Actions
      • Set LoadUnit = (Load 0 of (Key (Triggering unit)) in Hash)
      • Set LoadItem = (Load 1 of (Key (Triggering unit)) in Hash)
      • Set TempLoc = (Position of LoadItem)
      • Item - Remove LoadItem
      • Special Effect - Create a special effect at TempLoc using Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl
      • Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in Hash
      • Custom script: call RemoveLocation(udg_TempLoc)
My triggers has one problem. If you pick the item, it will still be destroyed after 7 seconds :p
 
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin =)

When the destroying part comes, what will happen if you add this condition before it should be destroyed:
  • ((Last created item) is owned) Equal to False
A tip ( but I thing you know it ) "(Center of (Playable map area)" is a leak and you have to destroy the special effect, else this is a leak too ;)

Greetings and Peace
Dr. Boom
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Test map attached
Try kill those nasty Footmen =D
And get all the items
After you get 3 blades of attacks, drop the 3 items on the ground before the Destory Item trigger starts
Then, watch the result =D
Yeah, it's DESTORY !
 

Attachments

  • Remove Excess Items.w3x
    12.9 KB · Views: 39
Status
Not open for further replies.
Top