Item Auto Destroy

Status
Not open for further replies.
Level 11
Joined
Jun 20, 2009
Messages
879
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
 
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
 
Status
Not open for further replies.
Back
Top