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

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.
 
Level 16
Joined
Oct 30, 2004
Messages
1,277
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
 
Level 11
Joined
Jul 2, 2004
Messages
471
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.
Top