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

How Do You Make Spawned Units Drop Items???

Status
Not open for further replies.
Level 7
Joined
Dec 8, 2005
Messages
319
i cant get my spawned units to drop items and can only make my creeps that are already on the map drop units. i cant figure how i might be able to do it in trigger but any help will be greatly appreciated.
 
Level 2
Joined
Jul 5, 2005
Messages
19
It can be done with JASS by manually creating your triggers. You have to create a function that drops your item (and have all your random choice stuff in there) then you need to create a trigger and add the event of that units death to the new trigger. Blizzard adds unit death and unit changes owner events to the trigger that drops the item. (If you look at the war3map.j with WinMPQ you can see how they do it)

You might be able to get away with not using JASS, but then creating triggers would be difficult. You would end up doing something like keep on adding events to the same trigger, and the events would never get deleted till the end of the map.
 
Level 7
Joined
Dec 8, 2005
Messages
319
i have tried looking for old posts but nothin comes up with what i'm looking for if you could give me the link to the old post or tell me i will greatly appreciate it
 
Level 6
Joined
May 13, 2005
Messages
164
Create a variable integer called Random to make the item be created randomly whenever a creep dies.


Event-
Unit Dies

Condition-
Owner of unit equal to Neutral Hostile

Action-
Set Random equal to random integer between 1 to 3
If- Random equal to 1 then create tome of power at position of triggering unit else do nothing.
If- Random equal to 2 then do nothing else do nothing.
If- Random equal to 3 then do nothing else do nothing.


This trigger enables the tome of power to be dropped by a creep one-third of the time whenever it dies.
Sorry for the inaccuracy of the trigger but i hope this helps :)
 
Level 22
Joined
Jan 10, 2005
Messages
3,426
LeviathanReborn said:
Create a variable integer called Random to make the item be created randomly whenever a creep dies.


Event-
Unit Dies

Condition-
Owner of unit equal to Neutral Hostile

Action-
Set Random equal to random integer between 1 to 3
If- Random equal to 1 then create tome of power at position of triggering unit else do nothing.
If- Random equal to 2 then do nothing else do nothing.
If- Random equal to 3 then do nothing else do nothing.


This trigger enables the tome of power to be dropped by a creep one-third of the time whenever it dies.
Sorry for the inaccuracy of the trigger but i hope this helps :)

No, its not that simple. What if a boss must drop more items or if u want higher lvl creeps drop other items etc etc. U'll need hundreds of triggers then. U will have to use JASS. (I dunno anything about JASS but maybe u can add item tables with JASS or sumthing)
 
Level 6
Joined
May 13, 2005
Messages
164
Just change the condition to unit-type of dying unit equal to (wateva creep u want). Anyways, thats how i do it coz i dunno about JASS. And if the creep is a boss, just create another similar trigger but different percentage chance for items drop or wateva u want.
 
Status
Not open for further replies.
Top