• 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.

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

Status
Not open for further replies.
Level 5
Joined
Apr 11, 2011
Messages
107
my units wont drop items, why not? heres the map and the triggers. any help is nice :)
 

Attachments

  • RPG.w3x
    1.2 MB · Views: 42
Level 5
Joined
Apr 11, 2011
Messages
107
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.
 
Level 5
Joined
Apr 11, 2011
Messages
107
i cant find:
  • Create Item at TempLoc of type itemTypes[TempInt]
just
  • Item - Create "x" at TempLoc
 
Status
Not open for further replies.
Top