[Trigger] Need Help: Random Units that Re-spawn and Drop Items

Status
Not open for further replies.
Can you toss together a simple non-jass trigger that does this? I couldn't figure out how to do it. I was trying to get something along the lines of: a unit dies, unit is in unit group: undeadinaera1, then drop items. I couldn't figure out the items part. And I wanted it to be a %chance, similar if not exact to the drop table I had.

Also, is there a simpler way to do the random spawn trigger?
 
  • Drop
    • Events
      • Unit - A unit dies
    • Conditions
    • Actions
      • Set TempUnit = (Triggering unit)
      • If (Conditions) then do (Then - Actions), else do (Else - Actions)
        • If - Conditions
          • Random Integer between 1 and 10 Equal to 1 (There's a 10% chance here)
          • TempUnit is in undeadGroup // whatever you want
        • Then - Actions
          • Set TempLoc = (Position of TempUnit)
          • Set TempInt = (Custom value of TempUnit)
          • Create Item at TempLoc of type itemTypes[TempInt]
          • Set itemTypes[TempInt] = 0
          • Custom script: call RemoveLocation(udg_TempLoc)
        • Else - Actions
You need UnitIndexer by Bribe (Spells section) for this to even work.
When you spawn a unit, set itemTypes[(Custom value of YOUR_UNIT)] to the item type you want to drop.

itemTypes is an Item-Type variable
TempUnit is a unit
TempInt is an integer
TempLoc is a point.
 
Status
Not open for further replies.
Back
Top