• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Help me out with this please...

Status
Not open for further replies.
Level 5
Joined
Mar 17, 2005
Messages
135
Ok i want to make it so that a spawned unit drops a item. This is my trigger please tell me what i did wrong.

Event
Unit - A unit owned by Neutral Hostile Dies

ConditionsOr - Any (Conditions) are true
Conditions
(Unit-type of (Dying unit)) Equal to Dark Troll
(Unit-type of (Dying unit)) Equal to Arachnid
(Unit-type of (Dying unit)) Equal to Unbroken

Actions
Item - Create RandomItem[(Random integer number between 1 and 10)] at (Position of (Dying unit))

Thanks in advanced.
 
Okay, that action looks pretty weird and i dont quite understand it. I think the trigger should go something like this:

Event and conditions are ok

Actions
Set Variable "Random Item" = (Random integer number between 1 and 10)
IF "Random Item" equal to 1 THEN create item "Mask of death" to position of the dying unit ELSE do nothing IF "Random Item" equal to 2 THEN create item "Crown of the kings" to position of the dying unit ELSE do nothing

And so on and so on, i think u get the point, "Random item" is a variable type integer
 
I can't see the problem, only if you had forgot to set the array variables

But do this:
create a variables

Type = <itmetype>
Name = RandomItem
Array= Yes


----------------------------------------------------
Trigger 01.

Event:
Map Initialization

Action:
Set RandomItem[1] = Potion of Healing
Set RandomItem[2] = Claws of Attack +3
Set RandomItem[3] = Potion of Mana
Set RandomItem[4] = wtf!

and so on

----------------------------------------------------
Trigger 2

Event
Unit - A unit owned by Neutral Hostile Dies

ConditionsOr - Any (Conditions) are true
Conditions
(Unit-type of (Dying unit)) Equal to Dark Troll
(Unit-type of (Dying unit)) Equal to Arachnid
(Unit-type of (Dying unit)) Equal to Unbroken

Actions
Item - Create RandomItem[(Random integer number between 1 and 10)] at (Position of (Dying unit))
 
Status
Not open for further replies.
Back
Top